// wdfdevice.h
NTSTATUS WdfDeviceAssignSxWakeSettings(
[in] WDFDEVICE Device,
[in] PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings
);
View the official Windows Driver Kit DDI referenceNo description available.
[Applies to KMDF and UMDF]
The WdfDeviceAssignSxWakeSettings method provides driver-supplied information about a device's ability to trigger a wake signal while both the device and the system are in a low-power state.
Device [in]A handle to a framework device object.
Settings [in]A pointer to a caller-supplied WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure.
If the operation succeeds, WdfDeviceAssignSxWakeSettings returns STATUS_SUCCESS. Additional return values include:
| Return code | Description |
|---|---|
| STATUS_INVALID_DEVICE_REQUEST | The calling driver is not the device's power policy owner. |
| STATUS_INVALID_PARAMETER | An invalid Settings value is detected. |
| STATUS_INFO_LENGTH_MISMATCH | The size of the WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure is incorrect. |
| STATUS_POWER_STATE_INVALID | The bus driver indicates the device cannot trigger a wake signal, or the WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure contains an invalid device power state. |
The method might return other NTSTATUS values.
A bug check occurs if the driver supplies an invalid object handle.
For more information, see Supporting System Wake-Up.
The following code example initializes a WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure and then calls WdfDeviceAssignSxWakeSettings. The example uses the default settings that WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT sets.
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS wakeSettings;
NTSTATUS status = STATUS_SUCCESS;
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS_INIT(&wakeSettings);
status = WdfDeviceAssignSxWakeSettings(
device,
&wakeSettings
);
if (!NT_SUCCESS(status)) {
return status;
}
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS