PowerReadPossibleValue function (powrprof.h)
Retrieves the value for a possible value of a power setting.
Syntax
DWORD PowerReadPossibleValue(
[in, optional] HKEY RootPowerKey,
[in, optional] const GUID *SubGroupOfPowerSettingsGuid,
[in, optional] const GUID *PowerSettingGuid,
[out, optional] PULONG Type,
[in] ULONG PossibleSettingIndex,
[out, optional] PUCHAR Buffer,
[in, out] LPDWORD BufferSize
);
Parameters
[in, optional] RootPowerKey
This parameter is reserved for future use and must be set to NULL.
[in, optional] SubGroupOfPowerSettingsGuid
The subgroup of power settings. This parameter can be one of the following values defined in WinNT.h. Use NO_SUBGROUP_GUID to refer to the default power scheme.
[in, optional] PowerSettingGuid
The identifier of the power setting.
[out, optional] Type
A pointer to a variable that receives the type of data for the value. The possible values are listed in Registry Value Types. This parameter can be NULL and the type of data is not returned.
[in] PossibleSettingIndex
The zero-based index of the possible setting.
[out, optional] Buffer
A pointer to a buffer that receives the value. If this parameter is NULL, the BufferSize parameter receives the required buffer size.
[in, out] BufferSize
A pointer to a variable that contains the size of the buffer pointed to by the Buffer parameter.
If the Buffer parameter is NULL, the function returns ERROR_SUCCESS and the variable receives the required buffer size.
If the specified buffer size is not large enough to hold the requested data, the function returns 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 specified by the BufferSize parameter is too small,
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 |