PowrProfPowerEnumerate Method

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.

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 PowerEnumerate(
	IntPtr rootPowerKey,
	IntPtr schemeGuid,
	IntPtr subGroupOfPowerSettingsGuid,
	PowerPlanAccess acessFlags,
	uint index,
	ref Guid refBuffer,
	ref uint refBufferSize
)

Parameters

rootPowerKey  IntPtr
Reserved for future use, this must be set to Zero.
schemeGuid  IntPtr
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.

acessFlags  PowerPlanAccess
A set of flags that specifies what will be enumerated.
index  UInt32
The zero-based index Of the scheme, subgroup, Or setting that Is being enumerated.
refBuffer  Guid
A pointer To a variable To receive the elements.

If this parameter Is , the Function retrieves the size Of the buffer required.

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