
When any one of these conditions is satisfied, the data is collected and the operation returns. The battery's capacity is above HighCapacity.The battery's capacity is below LowCapacity.The battery's current status does not match PowerState.The time-out expires (assuming Timeout is not -1).Requests for battery information are postponed until one of the following occurs: This value is identical to the Capacity member of the BATTERY_STATUS structure. The current battery capacity, in mWh (or relative). Indicates that the battery has access to AC power. Indicates that the battery is currently discharging. See the Remarks section for more information. Indicates that battery failure is imminent. Indicates that the battery is currently charging. It is identical to the PowerState member of the BATTERY_STATUS structure. Zero, one, or more of the following status bits, which indicate the state of the battery. If the count is exhausted when the computer is awoken, and other conditions are satisfied, the call will return immediately on awakening. If the computer has entered sleep mode, the clock will continue to run, but exhausting the count will not wake the computer up. Any other value indicates that the request should wait that length of time, or until any one of the other conditions is satisfied. A value of zero indicates that the requested battery information is to be returned immediately, regardless of the other conditions. A value of -1 indicates that the request will wait indefinitely for the conditions to be satisfied. The number of milliseconds the request will wait for the condition specified by the PowerState, LowCapacity, and HighCapacity members before completing.

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.
#Battery status 1.11 code
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.


Only information for a battery matching the tag can be returned. Syntax typedef struct _BATTERY_WAIT_STATUS BATTERY_WAIT_STATUS, *PBATTERY_WAIT_STATUS This structure is used by the IOCTL_BATTERY_QUERY_STATUS control code. Contains information about the conditions under which the battery status is to be retrieved.
