Share via


Power-Manageable Device Drivers (Windows Embedded CE 6.0)

1/6/2010

To create a device driver that recognizes the power states of a target device, you must first create a driver that advertises a non-COM-related device interface. This non-COM-related device interface, in turn, specifies that the device is power-managed.

You can advertise a device interface in the following ways:

  • Define the interface in the IClass value of the registry key used to activate the device.
  • Define the IClass value in the Active registry key, using the Init function of the device driver.
  • Define the IClass value, using the REGINI parameter of the ActivateDeviceEx function.
  • Explicitly call the AdvertiseInterface function in the device driver.

For additional information on advertising a non-COM-related interface for power management, see Device Interface Notifications.

You can register a device driver for power management notifications by calling the RequestPowerNotifications function and passing a handle to a message queue created exclusively for power management notifications. Do this only if your driver must respond to a power notification and can afford to incur the associated overhead. Typically, once a driver has been advertised as a power-aware driver, the driver need only process DeviceIoControl calls from Power Manager.

Power Manager communicates to a device with I/O control codes. The following table shows the I/O control codes that Power Manager uses.

Function Description

IOCTL_POWER_CAPABILITIES

Requests that the device inform Power Manager of supported power states, along with any associated characteristics.

IOCTL_POWER_SET

Requests that the device update the power state information.

IOCTL_POWER_QUERY

Checks whether the device is ready to enter a new device power state.

IOCTL_POWER_GET

Requests that the device inform Power Manager of the current device power state.

IOCTL_REGISTER_POWER_RELATIONSHIP

Notifies the parent device to register all controlled devices.

You can implement and use the optional IOCTL_POWER_QUERY control code to delay power state transitions until a driver has completed preparation for a change in power state. Do this by modifying the MDD layer to support IOCTL_POWER_QUERY, although this modification may make the MDD layer incompatible with future versions of Power Manager.

See Also

Tasks

How to Add Power Management to a Device Driver

Concepts

Power Management Implementation in Drivers
Power Management Implementation in Stream Interface Drivers

Other Resources

Device Power Management Guidelines