// wdfdevice.h
VOID WdfDeviceInitSetPowerPolicyEventCallbacks(
[in] PWDFDEVICE_INIT DeviceInit,
[in] PWDF_POWER_POLICY_EVENT_CALLBACKS PowerPolicyEventCallbacks
);
View the official Windows Driver Kit DDI reference
No description available.
[Applies to KMDF and UMDF]
The WdfDeviceInitSetPowerPolicyEventCallbacks method registers a driver's power policy event callback functions.
DeviceInit
[in]A caller-supplied pointer to a WDFDEVICE_INIT structure.
PowerPolicyEventCallbacks
[in]A pointer to a caller-initialized WDF_POWER_POLICY_EVENT_CALLBACKS structure.
If your driver calls WdfDeviceInitSetPowerPolicyEventCallbacks, it must do so before it calls WdfDeviceCreate. For more information, see Creating a Framework Device Object.
For more information about WdfDeviceInitSetPowerPolicyEventCallbacks, see Power Policy Ownership.
The following code example initializes a WDF_POWER_POLICY_EVENT_CALLBACKS structure and then calls WdfDeviceInitSetPowerPolicyEventCallbacks.
WDF_POWER_POLICY_EVENT_CALLBACKS powerPolicyCallbacks;
WDF_POWER_POLICY_EVENT_CALLBACKS_INIT(&powerPolicyCallbacks);
powerPolicyCallbacks.EvtDeviceArmWakeFromS0 = PciDrvEvtDeviceWakeArmS0;
powerPolicyCallbacks.EvtDeviceDisarmWakeFromS0 = PciDrvEvtDeviceWakeDisarmS0;
powerPolicyCallbacks.EvtDeviceWakeFromS0Triggered = PciDrvEvtDeviceWakeTriggeredS0;
powerPolicyCallbacks.EvtDeviceArmWakeFromSx = PciDrvEvtDeviceWakeArmSx;
powerPolicyCallbacks.EvtDeviceDisarmWakeFromSx = PciDrvEvtDeviceWakeDisarmSx;
powerPolicyCallbacks.EvtDeviceWakeFromSxTriggered = PciDrvEvtDeviceWakeTriggeredSx;
WdfDeviceInitSetPowerPolicyEventCallbacks(
DeviceInit,
&powerPolicyCallbacks
);
WDF_POWER_POLICY_EVENT_CALLBACKS_INIT
WdfDeviceInitSetPnpPowerEventCallbacks