Skip to content

Latest commit

 

History

History
94 lines (68 loc) · 3.72 KB

nf-wdfdevice-wdfdevicesetstaticstopremove.md

File metadata and controls

94 lines (68 loc) · 3.72 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:wdfdevice.WdfDeviceSetStaticStopRemove
WdfDeviceSetStaticStopRemove function (wdfdevice.h)
The WdfDeviceSetStaticStopRemove method informs the framework whether a device can be stopped and removed.
wdf\wdfdevicesetstaticstopremove.htm
wdf
02/26/2018
WdfDeviceSetStaticStopRemove function
DFDeviceObjectGeneralRef_9874b784-6344-4336-9753-0b172563f981.xml, WdfDeviceSetStaticStopRemove, WdfDeviceSetStaticStopRemove method, kmdf.wdfdevicesetstaticstopremove, wdf.wdfdevicesetstaticstopremove, wdfdevice/WdfDeviceSetStaticStopRemove
wdfdevice.h
Wdf.h
Universal
1.0
2.0
DriverCreate, KmdfIrql, KmdfIrql2
Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
<=DISPATCH_LEVEL
Windows
WdfDeviceSetStaticStopRemove
wdfdevice/WdfDeviceSetStaticStopRemove
APIRef
kbSyntax
LibDef
Wdf01000.sys
Wdf01000.sys.dll
WUDFx02000.dll
WUDFx02000.dll.dll
WdfDeviceSetStaticStopRemove

WdfDeviceSetStaticStopRemove function

-description

[Applies to KMDF and UMDF]

The WdfDeviceSetStaticStopRemove method informs the framework whether a device can be stopped and removed.

-parameters

-param Device [in]

A handle to a framework device object.

-param Stoppable [in]

A Boolean value that indicates whether the specified device can be stopped and removed. If TRUE, the device can be stopped and removed. If FALSE, the device cannot be stopped and removed.

-remarks

A bug check occurs if the driver supplies an invalid object handle.

By default, a device can be stopped and removed. Therefore, a driver typically calls WdfDeviceSetStaticStopRemove only if it must temporarily set the Stoppable parameter to FALSE. For example, a driver that controls a DVD writer might call WdfDeviceSetStaticStopRemove with Stoppable set to FALSE before it begins burning a DVD. After the driver has finished burning the DVD, it would call WdfDeviceSetStaticStopRemove again with Stoppable set to TRUE.

If your driver's device is supporting a special file (see WdfDeviceSetSpecialFileSupport), the framework will not allow the device to be stopped or removed. In this case, your driver does not have to call WdfDeviceSetStaticStopRemove .

The driver must match every call to WdfDeviceSetStaticStopRemove with Stoppable set to FALSE with a call to WdfDeviceSetStaticStopRemove with Stoppable set to TRUE.

Calling WdfDeviceSetStaticStopRemove with Stoppable set to FALSE does not prevent the framework from notifying the driver if the device is unexpectedly removed (surprise-removed).

For more information about how to prevent the operating system from stopping a device, see Handling Requests to Stop a Device.

Examples

The following code example informs the framework that the specified device cannot be stopped and removed.

WdfDeviceSetStaticStopRemove(
                             device,
                             FALSE
                             );