Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
Power Management
 PowerEnumerate Function

  Switch on low bandwidth view
PowerEnumerate Function

Enumerates the specified elements in a power scheme. This function is normally called in a loop incrementing the Index parameter to retrieve subkeys until they've all been enumerated.

Syntax

C++

DWORD WINAPI PowerEnumerate(
  __in_opt   HKEY RootPowerKey,
  __in_opt   const GUID *SchemeGuid,
  __in_opt   const GUID *SubGroupOfPowerSettingsGuid,
  __in       POWER_DATA_ACCESSOR AccessFlags,
  __in       ULONG Index,
  __out_opt  UCHAR *Buffer,
  __inout    DWORD *BufferSize
);

Parameters

RootPowerKey [in, optional]

This parameter is reserved for future use and must be set to NULL.

SchemeGuid [in, optional]

The identifier of the power scheme. If this parameter is NULL, an enumeration of the power policies is returned.

SubGroupOfPowerSettingsGuid [in, optional]

The subgroup of power settings. If this parameter is NULL, an enumeration of settings under the PolicyGuid key is returned.

ValueMeaning
NO_SUBGROUP_GUID
fea3413e-7e05-4911-9a71-700331f1c294

Settings in this subgroup will be part of the default power scheme.

GUID_DISK_SUBGROUP
0012ee47-9041-4b5d-9b77-535fba8b1442

Settings in this subgroup control power management configuration of the system's hard disk drives.

GUID_SYSTEM_BUTTON_SUBGROUP
4f971e89-eebd-4455-a8de-9e59040e7347

Settings in this subgroup control configuration of the system power buttons.

GUID_PROCESSOR_SETTINGS_SUBGROUP
54533251-82be-4824-96c1-47b60b740d00

Settings in this subgroup control configuration of processor power management features.

GUID_VIDEO_SUBGROUP
7516b95f-f776-4464-8c53-06167f40cc99

Settings in this subgroup control configuration of the video power management features.

GUID_BATTERY_SUBGROUP
e73a048d-bf27-4f12-9731-8b2076e8891f

Settings in this subgroup control battery alarm trip points and actions.

GUID_SLEEP_SUBGROUP
238C9FA8-0AAD-41ED-83F4-97BE242C8F20

Settings in this subgroup control system sleep settings.

GUID_PCIEXPRESS_SETTINGS_SUBGROUP
501a4d13-42af-4429-9fd1-a8218c268e20

Settings in this subgroup control PCI Express settings.

 

AccessFlags [in]

A set of flags that specifies what will be enumerated

ValueMeaning
ACCESS_SCHEME
16

Enumerate power schemes. The SchemeGuid and SubgroupOfPowerSettingsGuid parameters will be ignored.

ACCESS_SUBGROUP
17

Enumerate subgroups under SchemeGuid. The SubgroupOfPowerSettingsGuid parameter will be ignored.

ACCESS_INDIVIDUAL_SETTING
18

Enumerate individual power settings under SchemeGuid\SubgroupOfPowerSettingsGuid. To enumerate power settings directly under the SchemeGuid key, use NO_SUBGROUP_GUID as the SubgroupOfPowerSettingsGuid parameter.

 

Index [in]

The zero-based index of the scheme, subgroup, or setting that is being enumerated.

Buffer [out, optional]

A pointer to a variable to receive the elements. If this parameter is NULL, the function retrieves the size of the buffer required.

BufferSize [in, out]

A pointer to a variable that on input contains the size of the buffer pointed to by the Buffer parameter. If the Buffer parameter is NULL or if the BufferSize is not large enough, the function will return ERROR_MORE_DATA and the variable receives the required buffer size.

Return Value

Returns ERROR_SUCCESS (zero) if the call was successful, and a non-zero value if the call failed. If the buffer size passed in the BufferSize parameter is too small, or if the Buffer parameter is NULL, ERROR_MORE_DATA will be returned and the DWORD pointed to by the BufferSize parameter will be filled in with the required buffer size.

Requirements

Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderPowrProf.h
LibraryPowrProf.lib
DLLPowrProf.dll

See Also

Power Management Functions
POWER_DATA_ACCESSOR

Send comments about this topic to Microsoft

Build date: 5/7/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Buffer Parameter      Latinneo   |   Edit   |   Show History

Buffer points to a GUID string

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker