Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
DevicePowerEnumDevices function (powrprof.h)
Enumerates devices on the system that meet the specified criteria.
Syntax
BOOLEAN DevicePowerEnumDevices(
[in] ULONG QueryIndex,
[in] ULONG QueryInterpretationFlags,
[in] ULONG QueryFlags,
[out, optional] PBYTE pReturnBuffer,
[in, out] PULONG pBufferSize
);
Parameters
[in] QueryIndex
The index of the requested device. For initial calls, this value should be zero.
[in] QueryInterpretationFlags
The criteria applied to the search results.
| Value | Meaning |
|---|---|
|
Return a hardware ID string rather than friendly device name. |
|
Ignore devices not currently present in the system. |
|
Perform an AND operation on QueryFlags. |
|
Check whether the device is currently enabled to wake the system from a sleep state. |
|
Find a device whose name matches the string passed in pReturnBuffer and check its capabilities against QueryFlags. |
[in] QueryFlags
The query criteria.
| Value | Meaning |
|---|---|
|
The device supports system power state D0. |
|
The device supports system power state D1. |
|
The device supports system power state D2. |
|
The device supports system power state D3. |
|
The device supports system sleep state S0. |
|
The device supports system sleep state S1. |
|
The device supports system sleep state S2. |
|
The device supports system sleep state S3. |
|
The device supports system sleep state S4. |
|
The device supports system sleep state S5. |
|
The device supports waking from system power state D0. |
|
The device supports waking from system power state D1. |
|
The device supports waking from system power state D2. |
|
The device supports waking from system power state D3. |
|
The device supports waking from system sleep state S0. |
|
The device supports waking from system sleep state S1. |
|
The device supports waking from system sleep state S2. |
|
The device supports waking from system sleep state S3. |
|
The device supports warm eject. |
[out, optional] pReturnBuffer
Pointer to a buffer that receives the requested information.
[in, out] pBufferSize
The size, in bytes, of the return buffer.
Return value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
The values of the QueryFlags parameter may be combined to query for devices that support two or more criteria. For example; if PDCAP_D3_SUPPORTED | PDCAP_D1_SUPPORTED is passed as the QueryFlags parameter, the function will query for devices that support either D3 or D1.
QueryFlags also may be combined with QueryInterpretationFlags set to DEVICEPOWER_AND_OPERATION to produce a query of devices that support all of the requested criteria. For example; if PDCAP_D3_SUPPORTED | PDCAP_D1_SUPPORTED is passed as the QueryFlags parameter and DEVICEPOWER_AND_OPERATION is passed as the QueryInterpretationFlags parameter, the function will query devices that support both D3 and D1.
Examples
For an example that uses this function, see Using the Device Power API.
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 |
See also
Feedback
Was this page helpful?
