ReactOS 0.4.16-dev-125-g798ea90
cmbatt.h File Reference
#include <wdm.h>
#include <batclass.h>
#include <wmilib.h>
#include <wdmguid.h>
Include dependency graph for cmbatt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ACPI_BST_DATA
 
struct  _ACPI_BIF_DATA
 
struct  _CMBATT_DEVICE_EXTENSION
 

Macros

#define IOCTL_BATTERY_QUERY_UNIQUE_ID    CTL_CODE(FILE_DEVICE_BATTERY, 0x101, METHOD_BUFFERED, FILE_READ_ACCESS)
 
#define IOCTL_BATTERY_QUERY_STA    CTL_CODE(FILE_DEVICE_BATTERY, 0x102, METHOD_BUFFERED, FILE_READ_ACCESS)
 
#define IOCTL_BATTERY_QUERY_PSR    CTL_CODE(FILE_DEVICE_BATTERY, 0x103, METHOD_BUFFERED, FILE_READ_ACCESS)
 
#define IOCTL_BATTERY_SET_TRIP_POINT    CTL_CODE(FILE_DEVICE_BATTERY, 0x104, METHOD_BUFFERED, FILE_READ_ACCESS)
 
#define IOCTL_BATTERY_QUERY_BIF    CTL_CODE(FILE_DEVICE_BATTERY, 0x105, METHOD_BUFFERED, FILE_READ_ACCESS)
 
#define IOCTL_BATTERY_QUERY_BST    CTL_CODE(FILE_DEVICE_BATTERY, 0x106, METHOD_BUFFERED, FILE_READ_ACCESS)
 
#define CMBATT_GENERIC_STATUS   0x01
 
#define CMBATT_GENERIC_INFO   0x02
 
#define CMBATT_GENERIC_WARNING   0x04
 
#define CMBATT_ACPI_WARNING   0x08
 
#define CMBATT_POWER_INFO   0x10
 
#define CMBATT_PNP_INFO   0x20
 
#define CMBATT_ACPI_ENTRY_EXIT   0x40
 
#define CMBATT_PNP_ENTRY_EXIT   0x200
 
#define CMBATT_ACPI_ASSERT   0x400
 
#define ACPI_BUS_CHECK   0x00
 
#define ACPI_DEVICE_CHECK   0x01
 
#define ACPI_STA_PRESENT   0x01
 
#define ACPI_STA_ENABLED   0x02
 
#define ACPI_STA_SHOW_UI   0x04
 
#define ACPI_STA_FUNCTIONAL   0x08
 
#define ACPI_STA_BATTERY_PRESENT   0x10
 
#define ACPI_BATT_NOTIFY_STATUS   0x80
 
#define ACPI_BATT_NOTIFY_INFO   0x81
 
#define ACPI_BATT_STAT_DISCHARG   0x0001
 
#define ACPI_BATT_STAT_CHARGING   0x0002
 
#define ACPI_BATT_STAT_CRITICAL   0x0004
 
#define CM_MAX_VALUE   0x7FFFFFFF
 
#define CM_UNKNOWN_VALUE   0xFFFFFFFF
 
#define ACPI_BATT_POWER_UNIT_WATTS   0x0
 
#define ACPI_BATT_POWER_UNIT_AMPS   0x1
 
#define CMBATT_AR_NOTIFY   0x01
 
#define CMBATT_AR_INSERT   0x02
 
#define CMBATT_AR_REMOVE   0x04
 

Typedefs

typedef enum _CMBATT_EXTENSION_TYPE CMBATT_EXTENSION_TYPE
 
typedef struct _ACPI_BST_DATA ACPI_BST_DATA
 
typedef struct _ACPI_BST_DATAPACPI_BST_DATA
 
typedef struct _ACPI_BIF_DATA ACPI_BIF_DATA
 
typedef struct _ACPI_BIF_DATAPACPI_BIF_DATA
 
typedef struct _CMBATT_DEVICE_EXTENSION CMBATT_DEVICE_EXTENSION
 
typedef struct _CMBATT_DEVICE_EXTENSIONPCMBATT_DEVICE_EXTENSION
 

Enumerations

enum  _CMBATT_EXTENSION_TYPE { CmBattAcAdapter , CmBattBattery }
 

Functions

NTSTATUS NTAPI CmBattPowerDispatch (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS NTAPI CmBattPnpDispatch (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS NTAPI CmBattAddDevice (PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT DeviceObject)
 
NTSTATUS NTAPI CmBattSystemControl (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS NTAPI CmBattGetBstData (PCMBATT_DEVICE_EXTENSION DeviceExtension, PACPI_BST_DATA BstData)
 
NTSTATUS NTAPI CmBattGetPsrData (PDEVICE_OBJECT DeviceObject, PULONG PsrData)
 
NTSTATUS NTAPI CmBattGetStaData (PDEVICE_OBJECT DeviceObject, PULONG StaData)
 
NTSTATUS NTAPI CmBattGetBifData (PCMBATT_DEVICE_EXTENSION DeviceExtension, PACPI_BIF_DATA BifData)
 
NTSTATUS NTAPI CmBattSetTripPpoint (PCMBATT_DEVICE_EXTENSION DeviceExtension, ULONG AlarmValue)
 
VOID NTAPI CmBattNotifyHandler (IN PCMBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG NotifyValue)
 
NTSTATUS NTAPI CmBattWmiDeRegistration (PCMBATT_DEVICE_EXTENSION DeviceExtension)
 
NTSTATUS NTAPI CmBattWmiRegistration (PCMBATT_DEVICE_EXTENSION DeviceExtension)
 
NTSTATUS NTAPI CmBattGetUniqueId (PDEVICE_OBJECT DeviceObject, PULONG UniqueId)
 
NTSTATUS NTAPI CmBattQueryInformation (IN PCMBATT_DEVICE_EXTENSION FdoExtension, IN ULONG Tag, IN BATTERY_QUERY_INFORMATION_LEVEL InfoLevel, IN OPTIONAL LONG AtRate, IN PVOID Buffer, IN ULONG BufferLength, OUT PULONG ReturnedLength)
 
NTSTATUS NTAPI CmBattQueryStatus (IN PCMBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG Tag, IN PBATTERY_STATUS BatteryStatus)
 
NTSTATUS NTAPI CmBattSetStatusNotify (IN PCMBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG BatteryTag, IN PBATTERY_NOTIFY BatteryNotify)
 
NTSTATUS NTAPI CmBattDisableStatusNotify (IN PCMBATT_DEVICE_EXTENSION DeviceExtension)
 
NTSTATUS NTAPI CmBattQueryTag (IN PCMBATT_DEVICE_EXTENSION DeviceExtension, OUT PULONG Tag)
 

Variables

PDEVICE_OBJECT AcAdapterPdo
 
ULONG CmBattDebug
 

Macro Definition Documentation

◆ ACPI_BATT_NOTIFY_INFO

#define ACPI_BATT_NOTIFY_INFO   0x81

Definition at line 61 of file cmbatt.h.

◆ ACPI_BATT_NOTIFY_STATUS

#define ACPI_BATT_NOTIFY_STATUS   0x80

Definition at line 60 of file cmbatt.h.

◆ ACPI_BATT_POWER_UNIT_AMPS

#define ACPI_BATT_POWER_UNIT_AMPS   0x1

Definition at line 79 of file cmbatt.h.

◆ ACPI_BATT_POWER_UNIT_WATTS

#define ACPI_BATT_POWER_UNIT_WATTS   0x0

Definition at line 78 of file cmbatt.h.

◆ ACPI_BATT_STAT_CHARGING

#define ACPI_BATT_STAT_CHARGING   0x0002

Definition at line 64 of file cmbatt.h.

◆ ACPI_BATT_STAT_CRITICAL

#define ACPI_BATT_STAT_CRITICAL   0x0004

Definition at line 65 of file cmbatt.h.

◆ ACPI_BATT_STAT_DISCHARG

#define ACPI_BATT_STAT_DISCHARG   0x0001

Definition at line 63 of file cmbatt.h.

◆ ACPI_BUS_CHECK

#define ACPI_BUS_CHECK   0x00

Definition at line 51 of file cmbatt.h.

◆ ACPI_DEVICE_CHECK

#define ACPI_DEVICE_CHECK   0x01

Definition at line 52 of file cmbatt.h.

◆ ACPI_STA_BATTERY_PRESENT

#define ACPI_STA_BATTERY_PRESENT   0x10

Definition at line 58 of file cmbatt.h.

◆ ACPI_STA_ENABLED

#define ACPI_STA_ENABLED   0x02

Definition at line 55 of file cmbatt.h.

◆ ACPI_STA_FUNCTIONAL

#define ACPI_STA_FUNCTIONAL   0x08

Definition at line 57 of file cmbatt.h.

◆ ACPI_STA_PRESENT

#define ACPI_STA_PRESENT   0x01

Definition at line 54 of file cmbatt.h.

◆ ACPI_STA_SHOW_UI

#define ACPI_STA_SHOW_UI   0x04

Definition at line 56 of file cmbatt.h.

◆ CM_MAX_VALUE

#define CM_MAX_VALUE   0x7FFFFFFF

Definition at line 67 of file cmbatt.h.

◆ CM_UNKNOWN_VALUE

#define CM_UNKNOWN_VALUE   0xFFFFFFFF

Definition at line 68 of file cmbatt.h.

◆ CMBATT_ACPI_ASSERT

#define CMBATT_ACPI_ASSERT   0x400

Definition at line 43 of file cmbatt.h.

◆ CMBATT_ACPI_ENTRY_EXIT

#define CMBATT_ACPI_ENTRY_EXIT   0x40

Definition at line 41 of file cmbatt.h.

◆ CMBATT_ACPI_WARNING

#define CMBATT_ACPI_WARNING   0x08

Definition at line 38 of file cmbatt.h.

◆ CMBATT_AR_INSERT

#define CMBATT_AR_INSERT   0x02

Definition at line 99 of file cmbatt.h.

◆ CMBATT_AR_NOTIFY

#define CMBATT_AR_NOTIFY   0x01

Definition at line 98 of file cmbatt.h.

◆ CMBATT_AR_REMOVE

#define CMBATT_AR_REMOVE   0x04

Definition at line 100 of file cmbatt.h.

◆ CMBATT_GENERIC_INFO

#define CMBATT_GENERIC_INFO   0x02

Definition at line 36 of file cmbatt.h.

◆ CMBATT_GENERIC_STATUS

#define CMBATT_GENERIC_STATUS   0x01

Definition at line 35 of file cmbatt.h.

◆ CMBATT_GENERIC_WARNING

#define CMBATT_GENERIC_WARNING   0x04

Definition at line 37 of file cmbatt.h.

◆ CMBATT_PNP_ENTRY_EXIT

#define CMBATT_PNP_ENTRY_EXIT   0x200

Definition at line 42 of file cmbatt.h.

◆ CMBATT_PNP_INFO

#define CMBATT_PNP_INFO   0x20

Definition at line 40 of file cmbatt.h.

◆ CMBATT_POWER_INFO

#define CMBATT_POWER_INFO   0x10

Definition at line 39 of file cmbatt.h.

◆ IOCTL_BATTERY_QUERY_BIF

#define IOCTL_BATTERY_QUERY_BIF    CTL_CODE(FILE_DEVICE_BATTERY, 0x105, METHOD_BUFFERED, FILE_READ_ACCESS)

Definition at line 29 of file cmbatt.h.

◆ IOCTL_BATTERY_QUERY_BST

#define IOCTL_BATTERY_QUERY_BST    CTL_CODE(FILE_DEVICE_BATTERY, 0x106, METHOD_BUFFERED, FILE_READ_ACCESS)

Definition at line 32 of file cmbatt.h.

◆ IOCTL_BATTERY_QUERY_PSR

#define IOCTL_BATTERY_QUERY_PSR    CTL_CODE(FILE_DEVICE_BATTERY, 0x103, METHOD_BUFFERED, FILE_READ_ACCESS)

Definition at line 23 of file cmbatt.h.

◆ IOCTL_BATTERY_QUERY_STA

#define IOCTL_BATTERY_QUERY_STA    CTL_CODE(FILE_DEVICE_BATTERY, 0x102, METHOD_BUFFERED, FILE_READ_ACCESS)

Definition at line 20 of file cmbatt.h.

◆ IOCTL_BATTERY_QUERY_UNIQUE_ID

#define IOCTL_BATTERY_QUERY_UNIQUE_ID    CTL_CODE(FILE_DEVICE_BATTERY, 0x101, METHOD_BUFFERED, FILE_READ_ACCESS)

Definition at line 17 of file cmbatt.h.

◆ IOCTL_BATTERY_SET_TRIP_POINT

#define IOCTL_BATTERY_SET_TRIP_POINT    CTL_CODE(FILE_DEVICE_BATTERY, 0x104, METHOD_BUFFERED, FILE_READ_ACCESS)

Definition at line 26 of file cmbatt.h.

Typedef Documentation

◆ ACPI_BIF_DATA

◆ ACPI_BST_DATA

◆ CMBATT_DEVICE_EXTENSION

◆ CMBATT_EXTENSION_TYPE

◆ PACPI_BIF_DATA

◆ PACPI_BST_DATA

◆ PCMBATT_DEVICE_EXTENSION

Enumeration Type Documentation

◆ _CMBATT_EXTENSION_TYPE

Enumerator
CmBattAcAdapter 
CmBattBattery 

Definition at line 45 of file cmbatt.h.

46{
enum _CMBATT_EXTENSION_TYPE CMBATT_EXTENSION_TYPE
@ CmBattAcAdapter
Definition: cmbatt.h:47
@ CmBattBattery
Definition: cmbatt.h:48

Function Documentation

◆ CmBattAddDevice()

NTSTATUS NTAPI CmBattAddDevice ( PDRIVER_OBJECT  DriverObject,
PDEVICE_OBJECT  DeviceObject 
)

Referenced by DriverEntry().

◆ CmBattDisableStatusNotify()

NTSTATUS NTAPI CmBattDisableStatusNotify ( IN PCMBATT_DEVICE_EXTENSION  DeviceExtension)

Definition at line 625 of file cmbatt.c.

626{
628 PAGED_CODE();
629 if (CmBattDebug & 0xA) DbgPrint("CmBattDisableStatusNotify\n");
630
631 /* Do we have a trip point */
632 if (DeviceExtension->TripPointSet)
633 {
634 /* Is there a current value set? */
635 if (DeviceExtension->TripPointValue)
636 {
637 /* Reset it back to 0 */
638 DeviceExtension->TripPointValue = 0;
639 Status = CmBattSetTripPpoint(DeviceExtension, 0);
640 if (!NT_SUCCESS(Status))
641 {
642 /* If it failed, set unknown/invalid value */
643 DeviceExtension->TripPointValue = BATTERY_UNKNOWN_CAPACITY;
644 if (CmBattDebug & 8)
645 DbgPrint("CmBattDisableStatusNotify: SetTripPoint failed - %x\n", Status);
646 }
647 }
648 else
649 {
650 /* No trip point set, so this is a successful no-op */
652 }
653 }
654 else
655 {
656 /* Nothing we can do */
658 }
659
660 /* Return status */
661 return Status;
662}
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
#define BATTERY_UNKNOWN_CAPACITY
Definition: batclass.h:65
ULONG CmBattDebug
Definition: cmbatt.c:17
NTSTATUS NTAPI CmBattSetTripPpoint(PCMBATT_DEVICE_EXTENSION DeviceExtension, ULONG AlarmValue)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
#define DbgPrint
Definition: hal.h:12
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149

Referenced by CmBattAddBattery().

◆ CmBattGetBifData()

NTSTATUS NTAPI CmBattGetBifData ( PCMBATT_DEVICE_EXTENSION  DeviceExtension,
PACPI_BIF_DATA  BifData 
)

Definition at line 412 of file cmexec.c.

414{
415 ACPI_PACKAGE_FIELD BifFields[] = {
416 { "PowerUnit", FALSE, &BifData->PowerUnit },
417 { "DesignCapacity", FALSE, &BifData->DesignCapacity },
418 { "LastFullCapacity", FALSE, &BifData->LastFullCapacity },
419 { "BatteryTechnology", FALSE, &BifData->BatteryTechnology },
420 { "DesignVoltage", FALSE, &BifData->DesignVoltage },
421 { "DesignCapacityWarning", FALSE, &BifData->DesignCapacityWarning },
422 { "DesignCapacityLow", FALSE, &BifData->DesignCapacityLow },
423 { "BatteryCapacityGranularity1", FALSE, &BifData->BatteryCapacityGranularity1 },
424 { "BatteryCapacityGranularity2", FALSE, &BifData->BatteryCapacityGranularity2 },
425 { "ModelNumber", TRUE, &BifData->ModelNumber },
426 { "SerialNumber", TRUE, &BifData->SerialNumber },
427 { "BatteryType", TRUE, &BifData->BatteryType },
428 { "OemInfo", TRUE, &BifData->OemInfo },
429 };
430 PAGED_CODE();
431
433 DbgPrint("CmBattGetBifData: Buffer (0x%x) Device %x Tid %x\n",
434 BifData, DeviceExtension->DeviceId, KeGetCurrentThread());
435
436 /* Request the _BIF method */
437 /* Note that _BIF method is deprecated since ACPI 4.0, and replaced by _BIX method.
438 * However, VirtualBox 7.0 only support _BIF method.
439 */
440 return CmBattCallAcpiPackage("CmBattGetBifData",
441 DeviceExtension,
442 'FIB_',
443 512,
444 BifFields,
445 RTL_NUMBER_OF(BifFields));
446}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define CMBATT_ACPI_ENTRY_EXIT
Definition: cmbatt.h:41
static NTSTATUS CmBattCallAcpiPackage(_In_ LPCSTR FunctionName, _In_ PCMBATT_DEVICE_EXTENSION DeviceExtension, _In_ ULONG PackageName, _In_ ULONG OutputBufferSize, _In_ PACPI_PACKAGE_FIELD PackageFields, _In_ ULONG PackageFieldCount)
Definition: cmexec.c:163
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define KeGetCurrentThread
Definition: hal.h:55
CHAR BatteryType[256]
Definition: cmbatt.h:94
ULONG DesignCapacityLow
Definition: cmbatt.h:89
ULONG DesignVoltage
Definition: cmbatt.h:87
CHAR ModelNumber[256]
Definition: cmbatt.h:92
ULONG LastFullCapacity
Definition: cmbatt.h:85
ULONG DesignCapacity
Definition: cmbatt.h:84
CHAR SerialNumber[256]
Definition: cmbatt.h:93
ULONG BatteryTechnology
Definition: cmbatt.h:86
ULONG BatteryCapacityGranularity1
Definition: cmbatt.h:90
ULONG DesignCapacityWarning
Definition: cmbatt.h:88
ULONG BatteryCapacityGranularity2
Definition: cmbatt.h:91
CHAR OemInfo[256]
Definition: cmbatt.h:95
ULONG PowerUnit
Definition: cmbatt.h:83

Referenced by CmBattIoctl(), and CmBattVerifyStaticInfo().

◆ CmBattGetBstData()

NTSTATUS NTAPI CmBattGetBstData ( PCMBATT_DEVICE_EXTENSION  DeviceExtension,
PACPI_BST_DATA  BstData 
)

Definition at line 450 of file cmexec.c.

452{
453 ACPI_PACKAGE_FIELD BstFields[] = {
454 { "State", FALSE, &BstData->State },
455 { "PresentRate", FALSE, &BstData->PresentRate },
456 { "RemainingCapacity", FALSE, &BstData->RemainingCapacity },
457 { "PresentVoltage", FALSE, &BstData->PresentVoltage },
458 };
459 PAGED_CODE();
460
462 DbgPrint("CmBattGetBstData: Buffer (0x%x) Device %x Tid %x\n",
463 BstData, DeviceExtension->DeviceId, KeGetCurrentThread());
464
465
466 return CmBattCallAcpiPackage("CmBattGetBstData",
467 DeviceExtension,
468 'TSB_',
469 512,
470 BstFields,
471 RTL_NUMBER_OF(BstFields));
472}
ULONG PresentRate
Definition: cmbatt.h:73
ULONG RemainingCapacity
Definition: cmbatt.h:74
ULONG PresentVoltage
Definition: cmbatt.h:75
ULONG State
Definition: cmbatt.h:72

Referenced by CmBattGetBatteryStatus(), CmBattIoctl(), and CmBattSetStatusNotify().

◆ CmBattGetPsrData()

NTSTATUS NTAPI CmBattGetPsrData ( PDEVICE_OBJECT  DeviceObject,
PULONG  PsrData 
)

◆ CmBattGetStaData()

NTSTATUS NTAPI CmBattGetStaData ( PDEVICE_OBJECT  DeviceObject,
PULONG  StaData 
)

Referenced by CmBattIoctl(), and CmBattQueryTag().

◆ CmBattGetUniqueId()

NTSTATUS NTAPI CmBattGetUniqueId ( PDEVICE_OBJECT  DeviceObject,
PULONG  UniqueId 
)

Referenced by CmBattCreateFdo(), and CmBattIoctl().

◆ CmBattNotifyHandler()

VOID NTAPI CmBattNotifyHandler ( IN PCMBATT_DEVICE_EXTENSION  DeviceExtension,
IN ULONG  NotifyValue 
)

Definition at line 142 of file cmbatt.c.

144{
145 ULONG ArFlag;
148
150 DbgPrint("CmBattNotifyHandler: CmBatt 0x%08x Type %d Number %d Notify Value: %x\n",
151 DeviceExtension,
152 DeviceExtension->FdoType,
153 DeviceExtension->DeviceId,
154 NotifyValue);
155
156 /* Check what kind of notification was received */
157 switch (NotifyValue)
158 {
159 /* ACPI Specification says is sends a "Bus Check" when power source changes */
160 case ACPI_BUS_CHECK:
161
162 /* We treat it as possible physical change */
163 DeviceExtension->ArFlag |= (CMBATT_AR_NOTIFY | CMBATT_AR_INSERT);
164 if ((DeviceExtension->Tag) &&
166 DbgPrint("CmBattNotifyHandler: Received battery #%x insertion, but tag was not invalid.\n",
167 DeviceExtension->DeviceId);
168 break;
169
170 /* Status of the battery has changed */
172
173 /* All we'll do is notify the class driver */
174 DeviceExtension->ArFlag |= CMBATT_AR_NOTIFY;
175 break;
176
177 /* Information on the battery has changed, such as physical presence */
180
181 /* Reset all state and let the class driver re-evaluate it all */
182 DeviceExtension->ArFlag |= (CMBATT_AR_NOTIFY |
185 break;
186
187 default:
188
190 DbgPrint("CmBattNotifyHandler: Unknown Notify Value: %x\n", NotifyValue);
191 }
192
193 /* Check if we're supposed to delay the notification till later */
194 if (DeviceExtension->DelayNotification)
195 {
196 /* We'll handle this when we get a status query later on */
198 DbgPrint("CmBattNotifyHandler: Notification delayed: ARs = %01x\n",
199 DeviceExtension->ArFlag);
200 return;
201 }
202
203 /* We're going to handle this now */
205 DbgPrint("CmBattNotifyHandler: Performing ARs: %01x\n", DeviceExtension->ArFlag);
206
207 /* Check if this is a battery or AC adapter notification */
208 if (DeviceExtension->FdoType == CmBattBattery)
209 {
210 /* Reset the current trip point */
211 DeviceExtension->TripPointValue = BATTERY_UNKNOWN_CAPACITY;
212
213 /* Check what ARs have to be done */
214 ArFlag = DeviceExtension->ArFlag;
215
216 /* New battery inserted, reset lock value */
217 if (ArFlag & CMBATT_AR_INSERT) InterlockedExchange(&DeviceExtension->ArLockValue, 0);
218
219 /* Check if the battery may have been removed */
220 if (ArFlag & CMBATT_AR_REMOVE) DeviceExtension->Tag = 0;
221
222 /* Check if there's been any sort of change to the battery */
223 if (ArFlag & CMBATT_AR_NOTIFY)
224 {
225 /* We'll probably end up re-evaluating _BIF and _BST */
226 DeviceExtension->NotifySent = TRUE;
227 BatteryClassStatusNotify(DeviceExtension->ClassData);
228 }
229 }
230 else if (DeviceExtension->ArFlag & CMBATT_AR_NOTIFY)
231 {
232 /* The only known notification is AC/DC change. Loop device objects. */
233 for (DeviceObject = DeviceExtension->FdoDeviceObject->DriverObject->DeviceObject;
235 DeviceObject = DeviceObject->NextDevice)
236 {
237 /* Is this a battery? */
238 FdoExtension = DeviceObject->DeviceExtension;
239 if (FdoExtension->FdoType == CmBattBattery)
240 {
241 /* Send a notification to the class driver */
242 FdoExtension->NotifySent = TRUE;
244 }
245 }
246 }
247
248 /* ARs have been processed */
249 DeviceExtension->ArFlag = 0;
250}
#define InterlockedExchange
Definition: armddk.h:54
BCLASSAPI NTSTATUS NTAPI BatteryClassStatusNotify(PVOID ClassData)
Definition: battc.c:79
#define ACPI_BUS_CHECK
Definition: cmbatt.h:51
#define CMBATT_ACPI_WARNING
Definition: cmbatt.h:38
#define CMBATT_ACPI_ASSERT
Definition: cmbatt.h:43
#define ACPI_BATT_NOTIFY_INFO
Definition: cmbatt.h:61
#define CMBATT_AR_INSERT
Definition: cmbatt.h:99
#define CMBATT_AR_REMOVE
Definition: cmbatt.h:100
#define ACPI_DEVICE_CHECK
Definition: cmbatt.h:52
#define CMBATT_GENERIC_WARNING
Definition: cmbatt.h:37
#define CMBATT_PNP_INFO
Definition: cmbatt.h:40
#define CMBATT_AR_NOTIFY
Definition: cmbatt.h:98
#define ACPI_BATT_NOTIFY_STATUS
Definition: cmbatt.h:60
@ FdoExtension
Definition: precomp.h:48
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

Referenced by CmBattAddAcAdapter(), CmBattAddBattery(), CmBattGetBatteryStatus(), CmBattRemoveDevice(), and CmBattSetStatusNotify().

◆ CmBattPnpDispatch()

NTSTATUS NTAPI CmBattPnpDispatch ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Referenced by DriverEntry().

◆ CmBattPowerDispatch()

NTSTATUS NTAPI CmBattPowerDispatch ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Referenced by DriverEntry().

◆ CmBattQueryInformation()

NTSTATUS NTAPI CmBattQueryInformation ( IN PCMBATT_DEVICE_EXTENSION  FdoExtension,
IN ULONG  Tag,
IN BATTERY_QUERY_INFORMATION_LEVEL  InfoLevel,
IN OPTIONAL LONG  AtRate,
IN PVOID  Buffer,
IN ULONG  BufferLength,
OUT PULONG  ReturnedLength 
)

Definition at line 1031 of file cmbatt.c.

1038{
1040 PVOID QueryData = NULL;
1041 ULONG QueryLength = 0;
1042 ULONG RemainingTime = 0;
1043 ANSI_STRING TempString;
1044 UNICODE_STRING TempString2;
1045 WCHAR InfoBuffer[256];
1046 WCHAR TempBuffer[256];
1047 UNICODE_STRING InfoString;
1048 ULONG RemainingCapacity;
1049 BATTERY_REPORTING_SCALE BatteryReportingScale[2];
1050 LONG Rate;
1051 PAGED_CODE();
1053 DbgPrint("CmBattQueryInformation - Tag (%d) Device %d, Informationlevel %d\n",
1054 Tag,
1055 FdoExtension->DeviceId,
1056 InfoLevel);
1057
1058 /* Check ACPI Data */
1060 if (!NT_SUCCESS(Status)) return Status;
1061
1062 /* Check what caller wants */
1063 switch (InfoLevel)
1064 {
1065 case BatteryInformation:
1066 /* Just return our static information */
1067 QueryData = &FdoExtension->BatteryInformation;
1068 QueryLength = sizeof(BATTERY_INFORMATION);
1069 break;
1070
1072
1073 /* Return our static information, we have two scales */
1074 BatteryReportingScale[0].Granularity = FdoExtension->BatteryCapacityGranularity1;
1075 BatteryReportingScale[0].Capacity = FdoExtension->BatteryInformation.DefaultAlert1;
1076 BatteryReportingScale[1].Granularity = FdoExtension->BatteryCapacityGranularity2;
1077 BatteryReportingScale[1].Capacity = FdoExtension->BatteryInformation.DesignedCapacity;
1078 QueryData = BatteryReportingScale;
1079 QueryLength = sizeof(BATTERY_REPORTING_SCALE) * 2;
1080 break;
1081
1083
1084 /* Check if it's been more than 2 1/2 minutes since the last change */
1085 if ((KeQueryInterruptTime() - 150000000) > (FdoExtension->InterruptTime))
1086 {
1087 /* Get new battery status */
1089
1090 /* If the caller didn't specify a rate, use our static one */
1091 Rate = AtRate;
1092 if (!Rate) Rate = FdoExtension->Rate;
1093
1094 /* If we don't have a valid negative rate, use unknown value */
1095 if (Rate >= 0) Rate = BATTERY_UNKNOWN_RATE;
1096
1097 /* Grab the remaining capacity */
1098 RemainingCapacity = FdoExtension->RemainingCapacity;
1099
1100 /* See if we don't know one or the other */
1101 if ((Rate == BATTERY_UNKNOWN_RATE) ||
1102 (RemainingCapacity == BATTERY_UNKNOWN_CAPACITY))
1103 {
1104 /* If the battery is discharging, we can't give out a time */
1105 if ((FdoExtension->BstData.State & ACPI_BATT_STAT_DISCHARG) &&
1107 DbgPrint("CmBattQueryInformation: Can't calculate EstimatedTime.\n");
1108
1109 /* Check if we don't have a rate and capacity is going down */
1110 if ((FdoExtension->Rate == BATTERY_UNKNOWN_RATE) &&
1111 (FdoExtension->BstData.State & ACPI_BATT_STAT_DISCHARG))
1112 {
1113 /* We have to fail, since we lack data */
1116 DbgPrint("---------------------- PresentRate = BATTERY_UNKNOWN_RATE\n");
1117 }
1118
1119 /* If we don't have capacity, the rate is useless */
1120 if (RemainingCapacity == BATTERY_UNKNOWN_CAPACITY)
1121 {
1122 /* We have to fail the request */
1125 DbgPrint("---------------------- RemainingCapacity = BATTERY_UNKNOWN_CAPACITY\n");
1126 }
1127 }
1128 else
1129 {
1130 /* We have data, but is it valid? */
1131 if (RemainingCapacity > 0x123456)
1132 {
1133 /* The capacity seems bogus, so don't use it */
1135 DbgPrint("CmBattQueryInformation: Data Overflow in calculating Remaining Capacity.\n");
1136 }
1137 else
1138 {
1139 /* Compute the remaining time in seconds, based on rate */
1140 RemainingTime = (RemainingCapacity * 3600) / -Rate;
1141 }
1142 }
1143 }
1144
1145 /* Return the remaining time */
1146 QueryData = &RemainingTime;
1147 QueryLength = sizeof(ULONG);
1148 break;
1149
1150 case BatteryDeviceName:
1151
1152 /* Build the model number string */
1153 RtlInitAnsiString(&TempString, FdoExtension->BifData.ModelNumber);
1154
1155 /* Convert it to Unicode */
1156 InfoString.Buffer = InfoBuffer;
1157 InfoString.MaximumLength = sizeof(InfoBuffer);
1158 Status = RtlAnsiStringToUnicodeString(&InfoString, &TempString, 0);
1159
1160 /* Return the unicode buffer */
1161 QueryData = InfoString.Buffer;
1162 QueryLength = InfoString.Length;
1163 break;
1164
1165 case BatteryTemperature:
1167
1168 /* We don't support these */
1170 break;
1171
1173
1174 /* Build the OEM info string */
1175 RtlInitAnsiString(&TempString, FdoExtension->BifData.OemInfo);
1176
1177 /* Convert it to Unicode */
1178 InfoString.Buffer = InfoBuffer;
1179 InfoString.MaximumLength = sizeof(InfoBuffer);
1180 Status = RtlAnsiStringToUnicodeString(&InfoString, &TempString, 0);
1181
1182 /* Return the unicode buffer */
1183 QueryData = InfoString.Buffer;
1184 QueryLength = InfoString.Length;
1185 break;
1186
1187 case BatteryUniqueID:
1188
1189 /* Build the serial number string */
1190 RtlInitAnsiString(&TempString, FdoExtension->BifData.SerialNumber);
1191
1192 /* Convert it to Unicode */
1193 InfoString.Buffer = InfoBuffer;
1194 InfoString.MaximumLength = sizeof(InfoBuffer);
1195 RtlAnsiStringToUnicodeString(&InfoString, &TempString, 0);
1196
1197 /* Setup a temporary string for concatenation */
1198 TempString2.Buffer = TempBuffer;
1199 TempString2.MaximumLength = sizeof(TempBuffer);
1200
1201 /* Check if there's an OEM string */
1202 if (FdoExtension->BifData.OemInfo[0])
1203 {
1204 /* Build the OEM info string */
1205 RtlInitAnsiString(&TempString, FdoExtension->BifData.OemInfo);
1206
1207 /* Convert it to Unicode and append it */
1208 RtlAnsiStringToUnicodeString(&TempString2, &TempString, 0);
1209 RtlAppendUnicodeStringToString(&InfoString, &TempString2);
1210 }
1211
1212 /* Build the model number string */
1213 RtlInitAnsiString(&TempString, FdoExtension->BifData.ModelNumber);
1214
1215 /* Convert it to Unicode and append it */
1216 RtlAnsiStringToUnicodeString(&TempString2, &TempString, 0);
1217 RtlAppendUnicodeStringToString(&InfoString, &TempString2);
1218
1219 /* Return the final appended string */
1220 QueryData = InfoString.Buffer;
1221 QueryLength = InfoString.Length;
1222 break;
1223
1224 default:
1225
1226 /* Everything else is unknown */
1228 break;
1229 }
1230
1231 /* Return the required length and check if the caller supplied enough */
1232 *ReturnedLength = QueryLength;
1233 if (BufferLength < QueryLength) Status = STATUS_BUFFER_TOO_SMALL;
1234
1235 /* Copy the data if there's enough space and it exists */
1236 if ((NT_SUCCESS(Status)) && (QueryData)) RtlCopyMemory(Buffer, QueryData, QueryLength);
1237
1238 /* Return function result */
1239 return Status;
1240}
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG _In_ ULONG _Out_ PULONG ReturnedLength
Definition: batclass.h:188
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG AtRate
Definition: batclass.h:185
struct _BATTERY_INFORMATION BATTERY_INFORMATION
@ BatteryInformation
Definition: batclass.h:97
@ BatteryManufactureName
Definition: batclass.h:103
@ BatteryGranularityInformation
Definition: batclass.h:98
@ BatteryUniqueID
Definition: batclass.h:104
@ BatteryEstimatedTime
Definition: batclass.h:100
@ BatteryDeviceName
Definition: batclass.h:101
@ BatteryTemperature
Definition: batclass.h:99
@ BatteryManufactureDate
Definition: batclass.h:102
#define BATTERY_UNKNOWN_RATE
Definition: batclass.h:82
Definition: bufpool.h:45
NTSTATUS NTAPI CmBattGetBatteryStatus(IN PCMBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG Tag)
Definition: cmbatt.c:813
NTSTATUS NTAPI CmBattVerifyStaticInfo(PCMBATT_DEVICE_EXTENSION DeviceExtension, ULONG BatteryTag)
Definition: cmbatt.c:278
#define CMBATT_GENERIC_INFO
Definition: cmbatt.h:36
#define ACPI_BATT_STAT_DISCHARG
Definition: cmbatt.h:63
#define NULL
Definition: types.h:112
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
long LONG
Definition: pedump.c:60
#define KeQueryInterruptTime()
Definition: ke.h:37
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4065
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CmBattAddBattery().

◆ CmBattQueryStatus()

NTSTATUS NTAPI CmBattQueryStatus ( IN PCMBATT_DEVICE_EXTENSION  DeviceExtension,
IN ULONG  Tag,
IN PBATTERY_STATUS  BatteryStatus 
)

Definition at line 1244 of file cmbatt.c.

1247{
1249 PAGED_CODE();
1251 DbgPrint("CmBattQueryStatus - Tag (%d) Device %x\n", Tag, DeviceExtension->DeviceId);
1252
1253 /* Query ACPI information */
1254 Status = CmBattGetBatteryStatus(DeviceExtension, Tag);
1255 if (NT_SUCCESS(Status))
1256 {
1257 BatteryStatus->PowerState = DeviceExtension->State;
1258 BatteryStatus->Capacity = DeviceExtension->RemainingCapacity;
1259 BatteryStatus->Voltage = DeviceExtension->PresentVoltage;
1260 BatteryStatus->Rate = DeviceExtension->Rate;
1261 }
1262
1263 /* Return status */
1265 DbgPrint("CmBattQueryStatus: Returning [%#08lx][%#08lx][%#08lx][%#08lx]\n",
1270 return Status;
1271}
_In_ ULONG _Out_ PBATTERY_STATUS BatteryStatus
Definition: batclass.h:199
ULONG PowerState
Definition: batclass.h:154
ULONG Capacity
Definition: batclass.h:155

Referenced by CmBattAddBattery().

◆ CmBattQueryTag()

NTSTATUS NTAPI CmBattQueryTag ( IN PCMBATT_DEVICE_EXTENSION  DeviceExtension,
OUT PULONG  Tag 
)

Definition at line 566 of file cmbatt.c.

568{
569 PDEVICE_OBJECT PdoDevice;
570 ULONG StaData;
571 ULONG NewTag;
573 PAGED_CODE();
575 DbgPrint("CmBattQueryTag - Tag (%d), Battery %x, Device %d\n",
576 *Tag, DeviceExtension, DeviceExtension->DeviceId);
577
578 /* Get PDO and clear notification flag */
579 PdoDevice = DeviceExtension->PdoDeviceObject;
580 DeviceExtension->NotifySent = 0;
581
582 /* Get _STA from PDO (we need the machine status, not the battery status) */
583 Status = CmBattGetStaData(PdoDevice, &StaData);
584 if (NT_SUCCESS(Status))
585 {
586 /* Is a battery present? */
587 if (StaData & ACPI_STA_BATTERY_PRESENT)
588 {
589 /* Do we not have a tag yet? */
590 if (!DeviceExtension->Tag)
591 {
592 /* Set the new tag value, reset tags if we reached the maximum */
593 NewTag = DeviceExtension->TagData;
594 if (DeviceExtension->TagData++ == 0xFFFFFFFF) NewTag = 1;
595 DeviceExtension->Tag = NewTag;
597 DbgPrint("CmBattQueryTag - New Tag: (%d)\n", DeviceExtension->Tag);
598
599 /* Reset trip point data */
600 DeviceExtension->TripPointOld = 0;
601 DeviceExtension->TripPointValue = BATTERY_UNKNOWN_CAPACITY;
602
603 /* Clear AR lock and set new interrupt time */
604 InterlockedExchange(&DeviceExtension->ArLockValue, 0);
605 DeviceExtension->InterruptTime = KeQueryInterruptTime();
606 }
607 }
608 else
609 {
610 /* No battery, so no tag */
611 DeviceExtension->Tag = 0;
613 }
614 }
615
616 /* Return the tag and status result */
617 *Tag = DeviceExtension->Tag;
619 DbgPrint("CmBattQueryTag: Returning Tag: 0x%x, status 0x%x\n", *Tag, Status);
620 return Status;
621}
#define ACPI_STA_BATTERY_PRESENT
Definition: actypes.h:1344
NTSTATUS NTAPI CmBattGetStaData(PDEVICE_OBJECT DeviceObject, PULONG StaData)
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136

Referenced by CmBattAddBattery().

◆ CmBattSetStatusNotify()

NTSTATUS NTAPI CmBattSetStatusNotify ( IN PCMBATT_DEVICE_EXTENSION  DeviceExtension,
IN ULONG  BatteryTag,
IN PBATTERY_NOTIFY  BatteryNotify 
)

Definition at line 666 of file cmbatt.c.

669{
671 ACPI_BST_DATA BstData;
672 ULONG Capacity, NewTripPoint, TripPoint, DesignVoltage;
673 BOOLEAN Charging;
674 PAGED_CODE();
676 DbgPrint("CmBattSetStatusNotify: Tag (%d) Target(0x%x)\n",
678
679 /* Update any ACPI evaluations */
680 Status = CmBattVerifyStaticInfo(DeviceExtension, BatteryTag);
681 if (!NT_SUCCESS(Status)) return Status;
682
683 /* Trip point not supported, fail */
684 if (!DeviceExtension->TripPointSet) return STATUS_OBJECT_NAME_NOT_FOUND;
685
686 /* Are both capacities known? */
689 {
690 /* We can't set trip points without these */
692 DbgPrint("CmBattSetStatusNotify: Failing request because of BATTERY_UNKNOWN_CAPACITY.\n");
694 }
695
696 /* Is the battery charging? */
697 Charging = DeviceExtension->BstData.State & ACPI_BATT_STAT_CHARGING;
698 if (Charging)
699 {
700 /* Then the trip point is when we hit the cap */
701 Capacity = BatteryNotify->HighCapacity;
702 NewTripPoint = BatteryNotify->HighCapacity;
703 }
704 else
705 {
706 /* Otherwise it's when we discharge to the bottom */
707 Capacity = BatteryNotify->LowCapacity;
708 NewTripPoint = BatteryNotify->LowCapacity;
709 }
710
711 /* Do we have data in Amps or Watts? */
712 if (DeviceExtension->BifData.PowerUnit == ACPI_BATT_POWER_UNIT_AMPS)
713 {
714 /* We need the voltage to do the conversion */
715 DesignVoltage = DeviceExtension->BifData.DesignVoltage;
716 if ((DesignVoltage != BATTERY_UNKNOWN_VOLTAGE) && (DesignVoltage))
717 {
718 /* Convert from mAh into Ah */
719 TripPoint = 1000 * NewTripPoint;
720 if (Charging)
721 {
722 /* Scale the high trip point */
723 NewTripPoint = (TripPoint + 500) / DesignVoltage + ((TripPoint + 500) % DesignVoltage != 0);
724 }
725 else
726 {
727 /* Scale the low trip point */
728 NewTripPoint = (TripPoint - 500) / DesignVoltage - ((TripPoint - 500) % DesignVoltage == 0);
729 }
730 }
731 else
732 {
733 /* Without knowing the voltage, Amps are not enough data on consumption */
736 DbgPrint("CmBattSetStatusNotify: Can't calculate BTP, DesignVoltage = 0x%08x\n",
737 DesignVoltage);
738 }
739 }
740 else if (Charging)
741 {
742 /* Make it trip just one past the charge cap */
743 ++NewTripPoint;
744 }
745 else if (NewTripPoint > 0)
746 {
747 /* Make it trip just one below the drain cap */
748 --NewTripPoint;
749 }
750
751 /* Do we actually have a new trip point? */
752 if (NewTripPoint == DeviceExtension->TripPointValue)
753 {
754 /* No, so there is no work to be done */
756 DbgPrint("CmBattSetStatusNotify: Keeping original setting: %X\n", DeviceExtension->TripPointValue);
757 return STATUS_SUCCESS;
758 }
759
760 /* Set the trip point with ACPI and check for success */
761 DeviceExtension->TripPointValue = NewTripPoint;
762 Status = CmBattSetTripPpoint(DeviceExtension, NewTripPoint);
763 if (!(NewTripPoint) && (Capacity)) Status = STATUS_NOT_SUPPORTED;
764 if (!NT_SUCCESS(Status))
765 {
766 /* We failed to set the trip point, or there wasn't one settable */
767 DeviceExtension->TripPointValue = BATTERY_UNKNOWN_CAPACITY;
769 DbgPrint("CmBattSetStatusNotify: SetTripPoint failed - %x\n", Status);
770 return Status;
771 }
772
773 /* Read the new BST data to see the latest state */
774 Status = CmBattGetBstData(DeviceExtension, &BstData);
775 if (!NT_SUCCESS(Status))
776 {
777 /* We'll return failure to the caller */
779 DbgPrint("CmBattSetStatusNotify: GetBstData - %x\n", Status);
780 }
781 else if ((Charging) && (BstData.RemainingCapacity >= NewTripPoint))
782 {
783 /* We are charging and our capacity is past the trip point, so trip now */
785 DbgPrint("CmBattSetStatusNotify: Trip point already crossed (1): TP = %08x, remaining capacity = %08x\n",
786 NewTripPoint, BstData.RemainingCapacity);
788 }
789 else if ((BstData.RemainingCapacity) && (Capacity))
790 {
791 /* We are discharging, and our capacity is below the trip point, trip now */
793 DbgPrint("CmBattSetStatusNotify: Trip point already crossed (1): TP = %08x, remaining capacity = %08x\n",
794 NewTripPoint, BstData.RemainingCapacity);
796 }
797
798 /* All should've went well if we got here, unless BST failed... return! */
800 DbgPrint("CmBattSetStatusNotify: Want %X CurrentCap %X\n",
801 Capacity, DeviceExtension->RemainingCapacity);
803 DbgPrint("CmBattSetStatusNotify: Set to: [%#08lx][%#08lx][%#08lx] Status %lx\n",
807 Status);
808 return Status;
809}
unsigned char BOOLEAN
_In_ ULONG _In_ PBATTERY_NOTIFY BatteryNotify
Definition: batclass.h:216
_Out_ PULONG BatteryTag
Definition: batclass.h:173
#define BATTERY_UNKNOWN_VOLTAGE
Definition: batclass.h:79
VOID NTAPI CmBattNotifyHandler(IN PCMBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG NotifyValue)
Definition: cmbatt.c:142
#define CMBATT_GENERIC_STATUS
Definition: cmbatt.h:35
NTSTATUS NTAPI CmBattGetBstData(PCMBATT_DEVICE_EXTENSION DeviceExtension, PACPI_BST_DATA BstData)
Definition: cmexec.c:450
#define ACPI_BATT_STAT_CHARGING
Definition: cmbatt.h:64
#define ACPI_BATT_POWER_UNIT_AMPS
Definition: cmbatt.h:79
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
ULONG LowCapacity
Definition: batclass.h:204
ULONG HighCapacity
Definition: batclass.h:205
ULONG PowerState
Definition: batclass.h:203

Referenced by CmBattAddBattery().

◆ CmBattSetTripPpoint()

NTSTATUS NTAPI CmBattSetTripPpoint ( PCMBATT_DEVICE_EXTENSION  DeviceExtension,
ULONG  AlarmValue 
)

◆ CmBattSystemControl()

NTSTATUS NTAPI CmBattSystemControl ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Referenced by DriverEntry().

◆ CmBattWmiDeRegistration()

NTSTATUS NTAPI CmBattWmiDeRegistration ( PCMBATT_DEVICE_EXTENSION  DeviceExtension)

◆ CmBattWmiRegistration()

NTSTATUS NTAPI CmBattWmiRegistration ( PCMBATT_DEVICE_EXTENSION  DeviceExtension)

Variable Documentation

◆ AcAdapterPdo

PDEVICE_OBJECT AcAdapterPdo
extern

◆ CmBattDebug