// wdfdevice.h
VOID WdfDeviceInitSetPnpPowerEventCallbacks(
[in] PWDFDEVICE_INIT DeviceInit,
[in] PWDF_PNPPOWER_EVENT_CALLBACKS PnpPowerEventCallbacks
);
View the official Windows Driver Kit DDI reference
No description available.
[Applies to KMDF and UMDF]
The WdfDeviceInitSetPnpPowerEventCallbacks method registers a driver's Plug and Play and power management event callback functions.
DeviceInit
[in]A caller-supplied pointer to a WDFDEVICE_INIT structure.
PnpPowerEventCallbacks
[in]A pointer to a caller-initialized WDF_PNPPOWER_EVENT_CALLBACKS structure.
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.
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
);
WDF_PNPPOWER_EVENT_CALLBACKS_INIT
WdfDeviceInitSetPowerPolicyEventCallbacks