Define System Power State Registry Entries (Compact 7)

3/12/2014

To define a system power state, you create a registry key in the system configuration using the name of the system power state. For example, to define a system power state called Off, create the following registry key:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\State\Off]

To map a system power state to one or more device power states, you create registry values (name/value pairs) under that system power state key. Each system power state registry key can have registry values that specify the associated device power state, power state hint flags, and the names of devices to include within the system power state definition.

Power Manager supports the following system power state registry values.

System Power State Registry Values

Value Description

Default

Default device power setting for all devices while in the system power state specified by this registry key. This is an integer representing the power state. 0 (zero) represents D0, 1 represents D1, and so on.

Flags

Bit mask of POWER_STATE_XXX flags that specify the power state hints associated with this system power state. Use this field to configure Power Manager with zero or more power state hints that correspond to this system power state. For more information about power state hints, see Power Management Application Interface.

DeviceName

(Optional) Specifies the maximum device power state for a particular device while the system is in this system power state. Any number of DeviceName entries can be included within a system power state definition.

For example, the following registry values specify the system power state Off with a default device power state of D4 (Powered Off) in which all devices have a device power state of D4, except for the device COM1:, which is limited to device power state D1 (Low On). Because this example system wakes from the powered-off state when the hardware detects a signal change on the COM1 port, the port hardware must be kept in a low power state to detect port activity.

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\State\Off]
   Default=dword:4          ; D4
   Flags=dword:20000        ; POWER_STATE_OFF
   COM1:=dword:1            ; D1

In the preceding code example, the flags field is set to the power state hint POWER_STATE_OFF, which corresponds to D4 (Powered Off). Power Manager maps the power state hint POWER_STATE_OFF to system power state Off. When an application calls SetSystemPowerState and passes the power state hint flag POWER_STATE_OFF, Power Manager selects Off for the next system power state transition.

Power Manager supports multiple device classes, and these classes are represented by GUIDs. For a list of the device class GUIDs supported by Power Manager, see Power Management Device Driver Interface. You can use device class GUIDs to specify the power level of all devices that belong to a device type, and you can make exceptions for specific devices. For example, to specify the device power level of all Network Driver Interface Specification (NDIS) miniport devices, you use the GUID {98C5250D-C29A-4985-AE5F-AFE5367E5006}. You can define the default values of power-managed NDIS miniport devices in the system as follows:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\State\Off\{98C5250D-C29A-4985-AE5F-AFE5367E5006}]
   Default=dword:4          ; D4
   "CISCO1"=dword:2         ; D2

This example configures Power Manager to restrict all NDIS miniport devices to run at device power state D4 (Powered Off) while in system power state Off, except for device CISCO1, which can be set to a device power state as high as D2 (Standby).

The Power Manager PDD sample code includes the file Pm.reg, which provides preconfigured registry settings for the system power states implemented by the sample code. When you integrate the Power Manager PDD sample code into your platform, you can merge these registry settings into your Platform.reg file and modify the registry values according to your needs. For more about Platform.reg, see Registry File.

See Also

Concepts

Configure System Power States