A Device Enters a Low-Power State

Warning

UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2.

For more info, see Getting Started with UMDF.

A device leaves its working (D0) state and enters a low-power state if one of the following occurs:

  • The device is idle (that is, not being accessed) and is capable of entering a low-power idle state while the system remains in its working (S0) state.

  • The system's power state has changed from its working (S0) state to a low-power state. (Drivers can call IWDFDevice2::GetSystemPowerAction to determine the reason for the change in the system's power state.)

For each UMDF-based function and filter driver that supports the device, the framework does the following, in sequence, one driver at a time, starting with the driver that is highest in the driver stack:

  1. If the driver is using self-managed I/O, the framework calls the driver's IPnpCallbackSelfManagedIo::OnSelfManagedIoSuspend callback function.

  2. The framework stops all of the device's power-managed I/O queues and calls their IPnpCallbackSelfManagedIo::OnSelfManagedIoStop callback functions (if they exist).

  3. If the driver is the device's power policy owner, the framework calls its IPowerPolicyCallbackWakeFromS0::OnArmWakeFromS0 or IPowerPolicyCallbackWakeFromSx::OnArmWakeFromSx callback function.

  4. The framework calls the driver's IPnpCallback::OnD0Exit callback function (if it exists).

To see a diagram that shows these steps, see the orderly removal figure in A User Unplugs a Device.