IOCTL_BATTERY_GETLIFETIMEINFO (Windows CE 5.0)

Send Feedback

This IOCTL retrieves the time the user changed the batteries, the amount of time they used the batteries, and the amount of time they used the batteries before replacing them. 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_GETLIFETIMEINFO.
  • pInBuf
    [in] Set to NULL.
  • InBufLen
    [in] Set to zero.
  • pOutBuf
    [out] Pointer to a BATTERYLIFETIMEINFO structure.
  • OutBufLen
    [in] Set to sizeof(BATTERYLIFETIMEINFO).
  • 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(BATTERYLIFETIMEINFO). Otherwise, DeviceIoControl returns FALSE. In case of failure, GetLastError contains an error status.

Remarks

This IOCTL does not return meaningful data unless the battery driver supports change notification. For more information, see BatteryPDDSupportsChangeNotification and BatteryDrvrSupportsChangeNotification.

Requirements

OS Versions: Windows CE .NET 4.2 and later.
Header: Battery.h.

See Also

BatteryDrvrSupportsChangeNotification | BATTERYLIFETIMEINFO | BatteryPDDSupportsChangeNotification | DeviceIoControl

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.