BCLASS_QUERY_STATUS_CALLBACK callback function (batclass.h)
BatteryMiniQueryStatus returns status information about the given battery device.
Syntax
BCLASS_QUERY_STATUS_CALLBACK BclassQueryStatusCallback;
NTSTATUS BclassQueryStatusCallback(
[in] PVOID Context,
[in] ULONG BatteryTag,
[out] PBATTERY_STATUS BatteryStatus
)
{...}
Parameters
[in] Context
A pointer to the context area allocated by the miniclass driver for the battery device.
[in] BatteryTag
A battery tag value previously returned by BatteryMiniQueryTag.
[out] BatteryStatus
A pointer to a BATTERY_STATUS structure in which the miniclass driver returns information.
Return value
BatteryMiniQueryStatus returns one of the following:
Return code | Description |
---|---|
|
The battery designated by BatteryTag is currently installed. |
|
The battery designated by BatteryTag is not present. |
Remarks
The battery class driver calls BatteryMiniQueryStatus to get status information about the battery. The status information includes the battery's power state, capacity, voltage, and the amount of current flowing at the time of the request.
If the miniclass driver does not supply fully functional BatteryMiniSetStatusNotify and BatteryMiniDisableStatusNotify routines, the battery class driver calls BatteryMiniQueryStatus at regular but infrequent intervals to poll the battery's status. Otherwise, the class driver calls this routine after the miniclass driver has notified it of a change in battery status.
Before reporting a critically low, discharging battery (BATTERY_DISCHARGING and BATTERY_CRITICAL), the miniclass driver should ensure that the problem is legitimate (rather than a transitory state) and if so, should attempt to solve the problem. Possible solutions might include switching to AC power or to another battery. When the miniclass driver reports that a battery is critical and discharging, the system assumes that battery failure is imminent and prepares to shut down.
Requirements
Requirement | Value |
---|---|
Target Platform | Desktop |
Header | batclass.h (include Batclass.h) |
IRQL | PASSIVE_LEVEL |