信息
您所需的主题如下所示。但此主题未包含在此库中。

WdfDeviceSetPnpCapabilities 方法

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.

返回值

None.

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:

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.

标头

Wdfdevice.h (包括Wdf.h)

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

<=DISPATCH_LEVEL

另请参见

WdfDeviceSetPowerCapabilities
WDF_DEVICE_PNP_CAPABILITIES
WDF_DEVICE_PNP_CAPABILITIES_INIT

 

 

社区附加资源

显示:
© 2014 Microsoft