Compartir a través de


IOCTL_POWER_GET (Compact 2013)

3/26/2014

This I/O control gets the current device power state. Send this message with DeviceIoControl.

Syntax

BOOL DeviceIoControl(
    HANDLE hDevice,          // handle to the device
    DWORD dwIoControlCode,   // use IOCTL_POWER_GET
    LPVOID lpInBuffer,       // pointer to input buffer
    DWORD nInBufferSize,     // input buffer size
    LPVOID lpOutBuffer,      // pointer to output buffer
    DWORD nOutBufferSize,    // output buffer size
    LPDWORD lpBytesReturned, // number of bytes returned
    OVERLAPPED lpOverlapped  // pointer to OVERLAPPED structure
);

Parameters

  • hDevice
    [in] Handle to the device.
  • dwIoControlCode
    [in] The control code for the operation. Use IOCTL_POWER_GET for this operation.
  • lpInBuffer
    [in] Set to a pointer to a POWER_RELATIONSHIP structure. This defines the target device for parent and bus drivers. Otherwise, set to NULL.
  • nInBufferSize
    [in] Size of the POWER_RELATIONSHIP structure.
  • lpOutBuffer
    [out] Set to a pointer to CEDEVICE_POWER_STATE. This returns the current device power state.
  • nOutBufferSize
    [out] Size of the CEDEVICE_POWER_STATE parameter.
  • lpBytesReturned
    [out] Number of bytes passed back in the lpOutBuffer buffer.

Return Values

Returns TRUE if successful; otherwise, returns FALSE.

Remarks

Power Manager sends this I/O control only to drivers that support the power management I/O controls.

Power Manager knows the device power state of all power-manageable devices. It does not generally issue an IOCTL_POWER_GET call to the device unless an application calls GetDevicePower with the POWER_FORCE flag set.

Requirements

Header

pm.h

See Also

Reference

Power Management I/O Controls
CEDEVICE_POWER_STATE
POWER_RELATIONSHIP