Share via


Battery Driver Global Variables (Compact 2013)

3/26/2014

You can send commands to and retrieve status from the platform dependent driver (PDD) layer of the battery driver by using the following battery driver global variables, which are declared in the model device driver (MDD) layer of the battery driver and defined in Battimpl.h.

Name

Type

Description

gpfnBatteryPddIOControl

PFN_BATTERY_PDD_IOCONTROL

A pointer to the IOCTL handler of the battery driver's PDD layer.

gcsBattery

CRITICAL_SECTION

A critical section that you can use to serialize access to the battery driver state. You typically access it indirectly through the LOCKBATTERY and UNLOCKBATTERY macros, which are defined in Battimpl.h. For more information on the use of critical sections, see EnterCriticalSection.

gpPddBuffer

BYTE *

A pointer to a memory buffer that the MDD allocates for retrieving status information from the PDD layer of the battery driver.

gpPddBufferTemp

BYTE *

Used by the MDD layer of the battery driver to cache the last status read from the PDD layer of the battery driver. The MDD maintains this cache to avoid blocking other threads that attempt to retrieve battery status from the battery driver PDD.

gcsPddBuffer

CRITICAL_SECTION

A critical section that you can use to serialize access to gpPddBuffer. You typically access it indirectly through the LOCKPDDBUFFER and UNLOCKPDDBUFFER macros, which are defined in Battimpl.h.

gdwPddBufferSize

DWORD

The size, in bytes, of gpPddBuffer. The MDD layer of the battery driver sets the value during battery driver initialization.

See Also

Reference

Battery Driver Reference