[Applies to KMDF and UMDF]
The WdfDeviceAssignS0IdleSettings method provides driver-supplied information that the framework uses when a device is idle and the system is in its working (S0) state.
NTSTATUS WdfDeviceAssignS0IdleSettings( WDFDEVICE Device, PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings );
A handle to a framework device object.
A pointer to a caller-supplied WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS structure.
If the operation succeeds, WdfDeviceAssignS0IdleSettings returns STATUS_SUCCESS. Additional return values include:
||The calling driver is not the device's power policy owner.|
||An invalid Settings value is detected.|
||The size of the WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS structure is incorrect.|
This value is returned if one of the following occurs:
The method might return other NTSTATUS values.
A bug check occurs if the driver supplies an invalid object handle.
If the driver sets the IdleTimeoutType member of WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS to SystemManagedIdleTimeout or SystemManagedIdleTimeoutWithHint, it must call WdfDeviceAssignS0IdleSettings before returning from EvtDeviceD0Entry. Typically, a driver first calls WdfDeviceAssignS0IdleSettings from EvtDriverDeviceAdd.
Additional calls to WdfDeviceAssignS0IdleSettings can be made at any time. However, after the driver sets the value of the IdleTimeoutType member in its first call to WdfDeviceAssignS0IdleSettings, it must not change this value in later calls to this method.
If the driver registers for asynchronous notifications in EvtDriverDeviceAdd (for example by calling PoRegisterPowerSettingCallback or IoRegisterPlugPlayNotification), the driver must not subsequently call WdfDeviceAssignS0IdleSettings from within the driver callback routine that it registered.
For more information, see Supporting Idle Power-Down.
The following code example initializes a WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS structure, sets an idle time-out value of 10 seconds, and calls WdfDeviceAssignS0IdleSettings.
WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS idleSettings; NTSTATUS status = STATUS_SUCCESS;
|Minimum KMDF version||1.0|
|Minimum UMDF version||2.0|
|Header||wdfdevice.h (include Wdf.h)|
|Library||Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)|
|DDI compliance rules||DriverCreate, FDOPowerPolicyOwnerAPI, KmdfIrql, KmdfIrql2, NonFDONotPowerPolicyOwnerAPI|
Send feedback about: