Share via


IOCTL_BATTERY_GETSYSTEMPOWERSTATUSEX2 (Windows Embedded CE 6.0)

1/6/2010

This IOCTL retrieves information for the GetSystemPowerStatusEx2 system call. The DeviceIoControl function calls this IOCTL.

Parameters

  • hDevice
    [in] Handle to the device that is to perform the operation. To obtain a device handle, call the CreateFile function.
  • dwIoControlCode
    [in] Set to IOCTL_BATTERY_GETSYSTEMPOWERSTATUSEX2.
  • pInBuf
    [in] Pointer to a BOOL, fUpdate.
  • InBufLen
    [in] Set to sizeof(BOOL).
  • OutBufLen
    [in] Size of the structure pointed to by pOutBuf, in bytes.
  • lpBytesReturned
    [out] Long pointer to a variable that receives the size, in bytes, of the data stored into the buffer pointed to by lpOutBuffer.
  • lpOverlapped
    [in] Ignored; set to NULL.

Return Values

If successful, DeviceIoControl returns TRUE and *pdwBytesTransferred will be sizeof(SYSTEM_POWER_STATUS_EX2). Otherwise, DeviceIoControl returns FALSE. In case of failure, GetLastError contains an error status.

Remarks

If fUpdate is set to TRUE, this IOCTL gets the latest information from the battery PDD, otherwise it retrieves cached information that may be out-of-date by several seconds. For more information, see GetSystemPowerStatusEx2 and BatteryPDDGetStatus.

To return additional battery information, such as information about an extra battery, provide a data buffer larger than SYSTEM_POWER_STATUS_EX2 in the GetSystemPowerStatusEx2 function. Any extra information must be added after the BatteryChemistry member of the SYSTEM_POWER_STATUS_EX2 structure. There must be support for this implemented in the battery driver, and the implementation of this support varies depending on the hardware platform.

Requirements

Header battery.h
Windows Embedded CE Windows CE .NET 4.2 and later

See Also

Reference

BatteryPDDGetStatus
DeviceIoControl

Concepts

Battery Driver IOCTLs

Other Resources

GetSystemPowerStatusEx2
SYSTEM_POWER_STATUS_EX2