BatteryDrvrGetStatus

This function returns the status of the main and backup batteries.

Syntax

BOOL BatteryDrvrGetStatus( PSYSTEM_POWER_STATUS_EX2 pStatus,
PBOOL
pfBatteriesChangedSinceLastCall );

Parameters

pStatus
Pointer to the return buffer containing the battery status information.
pfBatteriesChangedSinceLastCall
Pointer to a flag that the function sets to true if the system's batteries have been replaced or changed since last call to this function.

Return Values

TRUE indicates success. FALSE indicates failure.

Remarks

Implement this GWES-layer function as part of porting native device drivers. This function is declared in the Battery.h header file.

The syntax for this function is different in Windows CE version 2.12 than in previous versions of the operating system. This function now uses the SYSTEM_POWER_STATUS_EX2 structure instead of the BATTERY_STATUS structure to return the battery status. The new structure contains additional fields to support batteries that can report complex status information. If you are writing a battery driver for a previous version of Windows CE, you should use the following definition of the function BatteryDrvrGetStatus:

Syntax for Windows CE 2.11 and earlier

BOOL BatteryDrvrGetStatus( PBATTERY_STATUS pSystemPowerStatusEx );

Parameters

pSystemPowerStatusEx
Pointer to the buffer in which the battery status information is to be returned.

See Also

BATTERY_STATUS