Platform SDK: Hardware |
The BATTERY_INFORMATION structure is returned by the IOCTL_BATTERY_QUERY_INFORMATION operation when the BatteryInformation information level is requested.
typedef struct _BATTERY_INFORMATION { ULONG Capabilities; UCHAR Technology; UCHAR Reserved[3]; UCHAR Chemistry[4]; ULONG DesignedCapacity; ULONG FullChargedCapacity; ULONG DefaultAlert1; ULONG DefaultAlert2; ULONG CriticalBias; ULONG CycleCount; } BATTERY_INFORMATION, *PBATTERY_INFORMATION;
Bits | Meaning |
---|---|
BATTERY_CAPACITY_RELATIVE | Indicates that the battery capacity and rate information are relative and not in any specific units. If this bit is not set the reporting units are milliwatt hours (mWh) or milliwatts (mW), as appropriate. |
BATTERY_FORCE_CHARGE_SUPPORTED | Indicates that Battery Set Information requests of the type BatteryCharge are supported by this battery device. |
BATTERY_FORCE_DISCHARGE_SUPPORTED | Indicates that Battery Set Information requests of the type BatteryDischarge are supported by this battery device. |
BATTERY_IS_SHORT_TERM | Indicates that the normal operation is for a fail-safe function. If this bit is not set the battery is expected to be used during normal system usage. |
BATTERY_SYSTEM_BATTERY | Indicates that the battery can provide general power to run the system. |
1 is a rechargeable battery, for example, lead acid.
Unicode string | Meaning |
---|---|
PbAc | Lead Acid |
LION | Lithium Ion |
NiCd | Nickel Cadmium |
NiMH | Nickel Metal Hydride |
NiZn | Nickel Zinc |
RAM | Rechargeable Alkaline-Manganese |
Other chemistries may appear in the future and your code should be able to handle them.
In general, a "warning" state will occur before a "low" state, but you should not assume that it always will. It is possible to poll a battery and find that neither alert level has occurred, and poll the battery again and find it discharged to the extent that both levels have been achieved. This may indicate that you are not polling often enough. It may also indicate that the battery is unable to hold a charge for very long and is discharging more rapidly than you expected. Such a battery may be nearing the end of its useful life, or it may be damaged.
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