PowerEnumerate function (powrprof.h)
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
DWORD PowerEnumerate(
[in, optional] HKEY RootPowerKey,
[in, optional] const GUID *SchemeGuid,
[in, optional] const GUID *SubGroupOfPowerSettingsGuid,
[in] POWER_DATA_ACCESSOR AccessFlags,
[in] ULONG Index,
[out, optional] UCHAR *Buffer,
[in, out] DWORD *BufferSize
);
Parameters
[in, optional] RootPowerKey
This parameter is reserved for future use and must be set to NULL.
[in, optional] SchemeGuid
The identifier of the power scheme. If this parameter is NULL, an enumeration of the power policies is returned.
[in, optional] SubGroupOfPowerSettingsGuid
The subgroup of power settings. If this parameter is NULL, an enumeration of settings under the PolicyGuid key is returned.
[in] AccessFlags
A set of flags that specifies what will be enumerated
[in] Index
The zero-based index of the scheme, subgroup, or setting that is being enumerated.
[out, optional] Buffer
A pointer to a variable to receive the elements. If this parameter is NULL, the function retrieves the size of the buffer required.
[in, out] BufferSize
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 nonzero 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
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | powrprof.h |
Library | PowrProf.lib |
DLL | PowrProf.dll |