The WdfDeviceSetPnpCapabilities method reports a device's Plug and Play capabilities.
VOID WdfDeviceSetPnpCapabilities( [in] WDFDEVICE Device, [in] PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities );
- Device [in]
A handle to a framework device object.
- PnpCapabilities [in]
A pointer to a driver-allocated WDF_DEVICE_PNP_CAPABILITIES structure.
A bug check occurs if the driver supplies an invalid object handle.
A driver typically calls WdfDeviceSetPnpCapabilities from within one of the following callback functions:
EvtDeviceD0Entry (if the PreviousState parameter's value is WdfPowerDeviceD3Final)
If more than one driver in the device's driver stack call WdfDeviceSetPnpCapabilities, the Plug and Play manager uses the values that are supplied by the driver that is highest in the stack.
The following code examples initializes a WDF_DEVICE_PNP_CAPABILITIES structure and then calls WdfDeviceSetPnpCapabilities.
WDF_DEVICE_PNP_CAPABILITIES pnpCaps; WDF_DEVICE_PNP_CAPABILITIES_INIT(&pnpCaps); pnpCaps.SurpriseRemovalOK = WdfTrue; WdfDeviceSetPnpCapabilities( device, &pnpCaps );
|Available in version 1.0 and later versions of KMDF.|
|Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)|