Partager via


IOCTL_BATTERY_GETLEVELS

This IOCTL returns the number of levels that the battery driver is capable of returning in the BatteryFlag and BackupBatteryFlag members of the SYSTEM_POWER_STATUS_EX2 structure. 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_GETLEVELS.
  • pInBuf
    [in] Set to NULL.
  • InBufLen
    [in] Set to zero.
  • pOutBuf
    [out] Pointer to a LONG that will be filled in with battery level information.
  • OutBufLen
    [in] Set to sizeof(LONG).
  • 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(LONG). Otherwise, DeviceIoControl returns FALSE. In case of failure, GetLastError contains an error status.

Remarks

For more information about the data returned by this IOCTL, see BatteryPDDGetLevels and BatteryDrvrGetLevels.

Requirements

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

See Also

Battery Drivers | BatteryDrvrGetLevels | BatteryPDDGetLevels | CreateFile | DeviceIoControl | SYSTEM_POWER_STATUS_EX2

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.