Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


Contains information about the conditions under which the battery status is to be retrieved. This structure is used by the IOCTL_BATTERY_QUERY_STATUS control code.


typedef struct _BATTERY_WAIT_STATUS {
  ULONG BatteryTag;
  ULONG Timeout;
  ULONG PowerState;
  ULONG LowCapacity;
  ULONG HighCapacity;



The current battery tag for the battery. Only information for a battery matching the tag can be returned. Whenever this value does not match the battery's current tag, the DeviceIoControl operation will fail with an error code of ERROR_FILE_NOT_FOUND, which indicates to the caller that the battery for which it has a tag is no longer installed The caller may opt to use the IOCTL_BATTERY_QUERY_TAG operation to determine the tag of the newly installed battery, if any. In addition, if the request is in progress when the battery is removed, or the tag changes, the operation is aborted with the status of ERROR_FILE_NOT_FOUND. (See Battery Tags for more information.)


The number of milliseconds the request will wait for the condition specified by the PowerState, LowCapacity, and HighCapacity members before completing. A value of -1 indicates that the request will wait indefinitely for the conditions to be satisfied. A value of zero indicates that the requested battery information is to be returned immediately, regardless of the other conditions. Any other value indicates that the request should wait that length of time, or until any one of the other conditions is satisfied.

If the computer has entered sleep mode, the clock will continue to run, but exhausting the count will not wake the computer up. If the count is exhausted when the computer is awoken, and other conditions are satisfied, the call will return immediately on awakening.


Zero, one, or more of the following status bits, which indicate the state of the battery. It is identical to the PowerState member of the BATTERY_STATUS structure.


Indicates that the battery is currently charging.


Indicates that battery failure is imminent. See the Remarks section for more information.


Indicates that the battery is currently discharging.


Indicates that the battery has access to AC power.



The current battery capacity, in mWh (or relative). This value is identical to the Capacity member of the BATTERY_STATUS structure.


The current battery capacity, in mWh (or relative). This value is identical to the Capacity member of the BATTERY_STATUS structure.


Requests for battery information are postponed until one of the following occurs:

  • The time-out expires (assuming Timeout is not -1).
  • The battery's current status does not match PowerState.
  • The battery's capacity is below LowCapacity.
  • The battery's capacity is above HighCapacity.
  • The battery tag changes.

When any one of these conditions is satisfied, the data is collected and the operation returns. This allows applications to monitor typical dynamic battery information without polling the device.

Before using either of the two Capacity conditions, make sure the battery supports them by using the IOCTL_BATTERY_QUERY_STATUS control code with a time-out of zero. Examine the results to determine if the Capacity member is supported (that is, not BATTERY_UNKNOWN_CAPACITY).


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]


Batclass.h on Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP

See also




Community Additions

© 2015 Microsoft