PowrProfPowerReadFriendlyName Method

Retrieves the friendly name for the specified power setting, subgroup, or scheme.

If the schemeGuid parameter is not but both the subGroupOfPowerSettingsGuid and powerSettingGuid parameters are Zero, the friendly name of the power scheme will be returned.

If the schemeGuid is not , and subGroupOfPowerSettingsGuid parameter is not Zero, and the powerSettingGuid parameter is Zero, the friendly name of the subgroup will be returned.

If the schemeGuid is not , and subGroupOfPowerSettingsGuid and powerSettingGuid parameters are not Zero, the friendly name of the power setting will be returned.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("PowrProf.dll")]
public static Win32ErrorCode PowerReadFriendlyName(
	IntPtr rootPowerKey,
	Guid schemeGuid,
	IntPtr subGroupOfPowerSettingsGuid,
	IntPtr powerSettingGuid,
	IntPtr buffer,
	ref uint refBufferSize
)

Parameters

rootPowerKey  IntPtr
Reserved for future use, this must be set to Zero.
schemeGuid  Guid
The Guid referring to the power scheme.
subGroupOfPowerSettingsGuid  IntPtr
The subgroup of power settings.

If this parameter is , an enumeration of settings under the PolicyGuid key is returned.

powerSettingGuid  IntPtr
buffer  IntPtr
A pointer to a buffer that receives the friendly name.

If this parameter is , the refBufferSize parameter receives the required buffer size.

The strings returned are all wide (Unicode) strings.

refBufferSize  UInt32
A pointer to a variable that contains the size of the buffer pointed to by the Buffer parameter.

Return Value

Win32ErrorCode
Returns ERROR_SUCCESS (zero) if the call was successful, and a nonzero value if the call failed.

If the buffer size specified by the refBufferSize parameter is too small, ERROR_MORE_DATA will be returned and the DWORD pointed to by the refBufferSize parameter will be filled in with the required buffer size.

Remarks

See Also