Platform SDK: Hardware |
The BATTERY_QUERY_INFORMATION structure is used by the IOCTL_BATTERY_QUERY_INFORMATION operation to determine the type of information to return.
typedef struct _BATTERY_QUERY_INFORMATION { ULONG BatteryTag; BATTERY_QUERY_INFORMATION_LEVEL InformationLevel; LONG AtRate; } BATTERY_QUERY_INFORMATION, *PBATTERY_QUERY_INFORMATION;
When a query information request is made, this value is verified. In addition, if the request is in progress while this value changes, the request is aborted with the status of ERROR_FILE_NOT_FOUND.
Information Level | Return |
---|---|
BatteryDeviceName | Zero ('\0') terminated Unicode (wide) string that contains the battery's name. |
BatteryEstimatedTime | ULONG estimated battery run time, in seconds. If the rate of drain provided in the AtRate element of the BATTERY_QUERY_INFORMATION structure is 0, this calculation is based on the present rate of drain. If AtRate is nonzero, the time returned is the expected run time for the given rate. If the estimated time is unknown (for example, the battery is not discharging and the AtRate specified was 0) this will return BATTERY_UNKNOWN_TIME. Note that this value is not very accurate on some battery systems, and may vary widely depending on present power usage, which could be affected by disk activity and other factors. There is no notification mechanism for changes in this value. |
BatteryGranularityInformation | An array of BATTERY_REPORTING_SCALE structures, never more than four entries. |
BatteryInformation | BATTERY_INFORMATION structure. |
BatteryManufactureDate | Returns in the BATTERY_MANUFACTURE_DATE structure the date the cell pack was manufactured. |
BatteryManufactureName | Zero ('\0') terminated Unicode (wide) string that contains the name of the manufacturer of the battery. |
BatterySerialNumber | Zero ('\0') terminated Unicode (wide) string that contains the battery's serial number. |
BatteryTemperature | ULONG that contains the battery's current temperature in 10ths of a degree Kelvin. |
BatteryUniqueID | Zero ('\0') terminated Unicode (wide) string that uniquely identifies the battery. This value can be used to track a specific battery. In the case of smart batteries, this ID would be the concatenation of the manufacturer's name, device name, date of manufacture, and a printable representation of the serial number. This value is not intended to be displayed to the end user. |
If this value is nonzero, it is a rate of drain that will be used to calculate the time until the battery is discharged for the BatteryEstimatedTime of an individual battery. It must be specified in mW, and must be a negative value to represent a battery discharge rate.
Some information about batteries is optional or may be meaningless for some batteries. If the particular type of data requested is not available for the current battery, then ERROR_INVALID_FUNCTION is returned.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Batclass.h.
Device Input and Output Overview, Device Input and Output Structures, DeviceIoControl, IOCTL_BATTERY_QUERY_INFORMATION, IOCTL_BATTERY_QUERY_TAG, BATTERY_REPORTING_SCALE, BATTERY_INFORMATION, BATTERY_MANUFACTURE_DATE