Expand Minimize

WdfDeviceAssignSxWakeSettings method

[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.

Syntax


NTSTATUS WdfDeviceAssignSxWakeSettings(
  [in]  WDFDEVICE Device,
  [in]  PWDF_DEVICE_POWER_POLICY_WAKE_SETTINGS Settings
);

Parameters

Device [in]

A handle to a framework device object.

Settings [in]

A pointer to a caller-supplied WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS structure.

Return value

If the operation succeeds, WdfDeviceAssignSxWakeSettings returns STATUS_SUCCESS. Additional return values include:

Return codeDescription
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.

Remarks

For more information, see Supporting System Wake-Up.

Examples

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;
}

Requirements

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

Wdfdevice.h (include Wdf.h)

Library

Wdf01000.sys (KMDF);
WUDFx02000.dll (UMDF)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

DriverCreate, FDOPowerPolicyOwnerAPI, KmdfIrql, KmdfIrql2, NonFDONotPowerPolicyOwnerAPI

See also

WdfDeviceAssignS0IdleSettings
WDF_DEVICE_POWER_POLICY_WAKE_SETTINGS

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft