Expand Minimize

WdfDeviceSetPnpCapabilities method

[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

Device [in]

A handle to a framework device object.

PnpCapabilities [in]

A pointer to a driver-allocated WDF_DEVICE_PNP_CAPABILITIES structure.

Return value

None.

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

Remarks

A driver typically calls WdfDeviceSetPnpCapabilities from within one of the following callback functions:

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.

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

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, KmdfIrql, KmdfIrql2

See also

WdfDeviceSetPowerCapabilities
WDF_DEVICE_PNP_CAPABILITIES
WDF_DEVICE_PNP_CAPABILITIES_INIT

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.