PowerReadFriendlyName function
Retrieves the friendly name for the specified power setting, subgroup, or scheme. If the SchemeGuid parameter is not NULL but both the SubGroupOfPowerSettingsGuid and PowerSettingGuid parameters are NULL, the friendly name of the power scheme will be returned. If the SchemeGuid and SubGroupOfPowerSettingsGuid parameters are not NULLand the PowerSettingGuid parameter is NULL, the friendly name of the subgroup will be returned. If the SchemeGuid, SubGroupOfPowerSettingsGuid, and PowerSettingGuid parameters are not NULL, the friendly name of the power setting will be returned.
Syntax
DWORD WINAPI PowerReadFriendlyName( _In_opt_ HKEY RootPowerKey, _In_opt_ const GUID *SchemeGuid, _In_opt_ const GUID *SubGroupOfPowerSettingsGuid, _In_opt_ const GUID *PowerSettingGuid, _Out_opt_ PUCHAR Buffer, _Inout_ LPDWORD 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.
- SubGroupOfPowerSettingsGuid [in, optional]
-
The subgroup of power settings. Use NO_SUBGROUP_GUID to refer to the default power scheme.
- PowerSettingGuid [in, optional]
-
The identifier of the power setting that is being used.
- Buffer [out, optional]
-
A pointer to a buffer that receives the friendly name. If this parameter is NULL, the BufferSize parameter receives the required buffer size. The strings returned are all wide (Unicode) strings.
- BufferSize [in, out]
-
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
|
Minimum supported client |
Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also