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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("PowrProf.dll">]
Public Shared Function PowerEnumerate (
rootPowerKey As IntPtr,
schemeGuid As IntPtr,
subGroupOfPowerSettingsGuid As IntPtr,
acessFlags As PowerPlanAccess,
index As UInteger,
ByRef refBuffer As Guid,
ByRef refBufferSize As UInteger
) As Win32ErrorCode
Dim rootPowerKey As IntPtr
Dim schemeGuid As IntPtr
Dim subGroupOfPowerSettingsGuid As IntPtr
Dim acessFlags As PowerPlanAccess
Dim index As UInteger
Dim refBuffer As Guid
Dim refBufferSize As UInteger
Dim returnValue As Win32ErrorCode
returnValue = PowrProf.PowerEnumerate(rootPowerKey,
schemeGuid, subGroupOfPowerSettingsGuid,
acessFlags, index, refBuffer, refBufferSize)
public:
[DllImportAttribute(L"PowrProf.dll")]
static Win32ErrorCode PowerEnumerate(
IntPtr rootPowerKey,
IntPtr schemeGuid,
IntPtr subGroupOfPowerSettingsGuid,
PowerPlanAccess acessFlags,
unsigned int index,
Guid% refBuffer,
unsigned int% refBufferSize
)
[<DllImportAttribute("PowrProf.dll")>]
static member PowerEnumerate :
rootPowerKey : IntPtr *
schemeGuid : IntPtr *
subGroupOfPowerSettingsGuid : IntPtr *
acessFlags : PowerPlanAccess *
index : uint32 *
refBuffer : Guid byref *
refBufferSize : uint32 byref -> Win32ErrorCode
No code example is currently available or this language may not be supported.
- 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.
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.