// wdfdevice.h
typedef struct _WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS {
ULONG Size;
DEVICE_POWER_STATE DxState;
WDF_POWER_POLICY_SX_WAKE_USER_CONTROL UserControlOfWakeSettings;
WDF_TRI_STATE Enabled;
BOOLEAN ArmForWakeIfChildrenAreArmedForWake;
BOOLEAN IndicateChildWakeOnParentWake;
} WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS, *PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS;
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
The WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure contains driver-supplied information about a device's ability to wake itself and the system, when both are in a low-power state.
SizeThe size, in bytes, of this structure.
DxStateA DEVICE_POWER_STATE-typed enumerator that identifies the low device power state that the device will enter when the system power state drops to a wakeable low-power state. The value of DxState cannot be PowerDeviceD0. DEVICE_POWER_STATE values are defined in wdm.h.
UserControlOfWakeSettingsA WDF_POWER_POLICY_SX_WAKE_USER_CONTROL-typed enumerator that indicates whether users have the ability to modify the device's wake settings.
EnabledA WDF_TRI_STATE-typed enumerator that indicates whether the device can wake the system (that is, restore the system to S0) when the system is in a low-power state. This member can have one of the following values:
WdfTrue - Waking the system is enabled.
WdfFalse - Waking the system is disabled.
WdfUseDefault - Waking the system is initially enabled by default; but if the UserControlOfWakeSettings member is set to WakeAllowUserControl, the user's setting or driver's INF file overrides the initial value.
If waking the system is enabled and the system is about to enter a low-power state, the framework calls the driver's EvtDeviceArmWakeFromSx or EvtDeviceArmWakeFromSxWithReason callback function before the device enters a low-power state.
ArmForWakeIfChildrenAreArmedForWakeA Boolean value that, if set to TRUE, indicates that a parent device's ability to wake itself and the system should be enabled when this ability is enabled for the device's child devices. For more information, see the following Remarks section. This member is available in version 1.7 and later versions of KMDF.
IndicateChildWakeOnParentWakeA Boolean value that, if set to TRUE, indicates that the framework will provide wake-up status to child devices if a parent device detects a wake-up signal. For more information, see the following Remarks section. This member is available in version 1.7 and later versions of KMDF.
The WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure is used as input to WdfDeviceAssignSxWakeSettings.
To initialize its WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure, your driver should call WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT.
The first time a driver calls WdfDeviceAssignSxWakeSettings, the following actions occur:
During subsequent calls to WdfDeviceAssignSxWakeSettings, the framework does not store the value of the UserControlOfWakeSettings member. In other words, the framework performs the following steps the first time the driver calls WdfDeviceAssignSxWakeSettings but not during later calls:
The following rules apply to the value that you specify for the DxState member:
For information about registry entries that control a device's wake capabilities, see User Control of Device Idle and Wake Behavior.
If the device that the WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure describes is a parent device, the driver for the parent device can use the ArmForWakeIfChildrenAreArmedForWake and IndicateChildWakeOnParentWake members as follows:
If the driver sets the ArmForWakeIfChildrenAreArmedForWake member to TRUE, the framework calls the driver's EvtDeviceArmWakeFromSx or EvtDeviceArmWakeFromSxWithReason callback function when a child device's wake ability is enabled, even if the parent device's wake ability is not enabled.
To reduce power consumption, you might not want to enable your device's wake ability unless a child device that also supports a wake ability is plugged in. If your driver sets the ArmForWakeIfChildrenAreArmedForWake member to TRUE, the Enabled member's values have the following meanings:
For more information about how to support a device's wake ability, see Supporting System Wake-Up.
EvtDeviceArmWakeFromSxWithReason
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT
WDF_POWER_POLICY_SX_WAKE_USER_CONTROL