WdfDeviceInitSetPnpPowerEventCallbacks method
[Applies to KMDF and UMDF]
The WdfDeviceInitSetPnpPowerEventCallbacks method registers a driver's Plug and Play and power management event callback functions.
Syntax
VOID WdfDeviceInitSetPnpPowerEventCallbacks( [in] PWDFDEVICE_INIT DeviceInit, [in] PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks );
Parameters
- DeviceInit [in]
-
A caller-supplied pointer to a WDFDEVICE_INIT structure.
- PnpPowerEventCallbacks [in]
-
A pointer to a caller-initialized WDF_PNPPOWER_EVENT_CALLBACKS structure.
Return value
None
Remarks
If your driver calls WdfDeviceInitSetPnpPowerEventCallbacks, it must do so before it calls WdfDeviceCreate.
For more information about calling WdfDeviceCreate, see Creating a Framework Device Object.
Examples
The following code example initializes a WDF_PNPPOWER_EVENT_CALLBACKS structure and then calls WdfDeviceInitSetPnpPowerEventCallbacks.
WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks;
WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);
pnpPowerCallbacks.EvtDevicePrepareHardware = SerialEvtPrepareHardware;
pnpPowerCallbacks.EvtDeviceReleaseHardware = SerialEvtReleaseHardware;
pnpPowerCallbacks.EvtDeviceD0Entry = SerialEvtDeviceD0Entry;
pnpPowerCallbacks.EvtDeviceD0Exit = SerialEvtDeviceD0Exit;
WdfDeviceInitSetPnpPowerEventCallbacks(
DeviceInit,
&pnpPowerCallbacks
);
Requirements
|
Minimum KMDF version | 1.0 |
|---|---|
|
Minimum UMDF version | 2.0 |
|
Header |
|
|
Library |
|
|
IRQL | <= DISPATCH_LEVEL |
|
DDI compliance rules | ChildDeviceInitAPI, DeviceInitAPI, DriverCreate, DrvAckIoStop, KmdfIrql, KmdfIrql2, PdoDeviceInitAPI |
See also
Show:
