Partager via


Suspend and Resume Handling (Windows Embedded CE 6.0)

1/6/2010

The PowerDown/PowerUp callback mechanism is independent of Power Manager and enables legacy device drivers to function in Windows CE .NET 4.0 and later.

Device driver developers need to be aware that in a system Suspend state, the microprocessor is no longer active. In theory, Power Manager puts all devices into a device power state that is appropriate to a system Suspend state. However, it is possible that a system Suspend state configuration or an application device power requirement may not be appropriate for a particular device. For example, an audio device might be required to stay in state D0 by a multimedia application. If the audio chip requires frequent microprocessor servicing to set up DMA buffers, the device driver developer may decide that D0 is an inappropriate state for a system Suspend state and turn the device off.

Device driver developers must know what states are appropriate for their device in a system Suspend state and implement their driver accordingly. It is appropriate for driver developers to be conservative when making decisions about power management in a system Suspend state. However, not all devices have to be forced off when the system enters a Suspend state. For example, if the audio device has a line-in jack and can play music independently of the microprocessor, it is appropriate for the device to remain powered in a system Suspend state.

If a device driver developer alters the device power state in a system Suspend state, it should restore it when it enters a system Resume state. Such drivers must have behavior that is as transparent to Power Manager as possible while in a system Suspend state.

Power-manageable stream devices can automatically notify Power Manager of their presence when they are loaded by ActivateDeviceEx. If the GUID "{A32942B7-920C-486b-B0E6-92A702A99B35}" is part of their IClass value, which is a REG_MULTI_SZ, Power Manager receives a device notification when the device is loaded. Power Manager requests notifications for all classes listed in the HKEY_LOCAL_MACHINE\CurrentControlSet\Control\Power\Interfaces registry key.

Devices can manage their own power by calling the DevicePowerNotify function when they receive the IOCTL_POWER_CAPABILITIES I/O control. Power Manager recognizes requests issued while the device is processing the I/O control.

If an OEM implements a device function outside of the stream interface, the OEM must customize Power Manager to communicate using that device function.

See Also

Reference

DevicePowerNotify
IOCTL_POWER_CAPABILITIES

Other Resources

Device Power Management Guidelines
XXX_PowerDown (Device Manager)
XXX_PowerUp (Device Manager)
OEMPowerOff
ActivateDeviceEx