次の方法で共有


IOCTL_POWER_QUERY (Compact 2013)

3/26/2014

This I/O control is deprecated and is not called by Power Manager. It checks whether changing power state is feasible. Send this message with DeviceIoControl.

Syntax

BOOL DeviceIoControl(
    HANDLE hDevice,          // handle to the device
    DWORD dwIoControlCode,   // use IOCTL_POWER_QUERY
    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_QUERY 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
    [in] Set to a pointer to CEDEVICE_POWER_STATE. This is the device power state that the system is querying for a pending IOCTL_POWER_SET operation.

    [out] Optional. Set to PwrDeviceUnspecified to veto the query.

  • 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

To veto the query, the driver should write PwrDeviceUnspecified into lpOutBuffer. Otherwise, Power Manager assumes that the driver accepted.

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

This is not always sent before a state transition.

The default implementation of Power Manager does not use IOCTL_POWER_QUERY. OEMs can customize Power Manager to call IOCTL_POWER_QUERY and to honor the return value associated with it so that the code supporting IOCTL_POWER_QUERY is still in the model device driver (MDD).

Requirements

Header

pm.h

See Also

Reference

Power Management I/O Controls
CEDEVICE_POWER_STATE
IOCTL_POWER_SET
POWER_RELATIONSHIP