WdfDeviceSetPnpCapabilities function (wdfdevice.h)
[Applies to KMDF and UMDF]
The WdfDeviceSetPnpCapabilities method reports a device's Plug and Play capabilities.
Syntax
void WdfDeviceSetPnpCapabilities(
[in] WDFDEVICE Device,
[in] PWDF_DEVICE_PNP_CAPABILITIES PnpCapabilities
);
Parameters
[in] Device
A handle to a framework device object.
[in] PnpCapabilities
A pointer to a driver-allocated WDF_DEVICE_PNP_CAPABILITIES structure.
Return value
None
Remarks
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)
Examples
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
);
Requirements
Requirement | Value |
---|---|
Target Platform | Universal |
Minimum KMDF version | 1.0 |
Minimum UMDF version | 2.0 |
Header | wdfdevice.h (include Wdf.h) |
Library | Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF) |
IRQL | <=DISPATCH_LEVEL |
DDI compliance rules | DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf) |