ReactOS 0.4.16-dev-752-g47bae01
|
Go to the source code of this file.
Functions | |
NTSTATUS NTAPI | CompBattOpenClose (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) |
NTSTATUS NTAPI | CompBattSystemControl (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) |
NTSTATUS NTAPI | CompBattMonitorIrpComplete (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ PVOID Context) |
Queues a work item thread worker which is bound to the individual CM (Control Method) ACPI battery to handle the IRP. | |
VOID NTAPI | CompBattMonitorIrpCompleteWorker (_In_ PCOMPBATT_BATTERY_DATA BatteryData) |
The brains of the battery IRP worker. It monitors the state of the IRP as well as sends the IRP down the device stack to gather battery related data, such tag and status. It also serves as the I/O completion routine of which it elaborates the gathered data. | |
VOID NTAPI | CompBattRecalculateTag (_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension) |
NTSTATUS NTAPI | CompBattIoctl (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp) |
NTSTATUS NTAPI | CompBattQueryTag (_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension, _Out_ PULONG Tag) |
NTSTATUS NTAPI | CompBattDisableStatusNotify (_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension) |
static BOOLEAN | CompBattCalculateTotalRateAndLinkedBatteries (_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension, _Out_ PULONG TotalRate, _Out_ PULONG BatteriesCount) |
Calculates the total discharging/charging rate flow of each individual battery linked with the composite battery and determines whether at least one battery is behaving improperly. | |
NTSTATUS NTAPI | CompBattSetStatusNotify (_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension, _In_ ULONG BatteryTag, _In_ PBATTERY_NOTIFY BatteryNotify) |
Sets a new configuration battery wait status settings of each battery. The purpose of this is so that the composite battery gets notified of new battery status as if it was a single battery. | |
NTSTATUS NTAPI | CompBattQueryStatus (_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension, _In_ ULONG Tag, _Out_ PBATTERY_STATUS BatteryStatus) |
Queries the battery status of each individiual connected battery with the composite battery and combines all the retrieved data as one single battery status for the composite battery. | |
NTSTATUS NTAPI | CompBattGetBatteryInformation (_Out_ PBATTERY_INFORMATION BatteryInfo, _In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension) |
NTSTATUS NTAPI | CompBattGetBatteryGranularity (_Out_ PBATTERY_REPORTING_SCALE ReportingScale, _In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension) |
static LONG | CompBattCalculateAtRateTime (_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension) |
Calculates the "At Rate" flow of the composite battery based on the sum of all connected batteries, in order to retrieve the precise battery time estimation. | |
NTSTATUS NTAPI | CompBattGetEstimatedTime (_Out_ PULONG Time, _In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension) |
Retrieves the estimated time of the composite battery based on the power drain rate of all the batteries present in the system. | |
NTSTATUS NTAPI | CompBattQueryInformation (_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension, _In_ ULONG Tag, _In_ BATTERY_QUERY_INFORMATION_LEVEL InfoLevel, _In_opt_ LONG AtRate, _In_ PVOID Buffer, _In_ ULONG BufferLength, _Out_ PULONG ReturnedLength) |
NTSTATUS NTAPI | DriverEntry (_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath) |
Variables | |
ULONG | CompBattDebug |
|
static |
Calculates the "At Rate" flow of the composite battery based on the sum of all connected batteries, in order to retrieve the precise battery time estimation.
[in] | DeviceExtension | A pointer to a device extension which describes the composite battery itself. It is used to gather each connected battery in the list with the composite battery. |
Definition at line 1409 of file compbatt.c.
Referenced by CompBattGetEstimatedTime().
|
static |
Calculates the total discharging/charging rate flow of each individual battery linked with the composite battery and determines whether at least one battery is behaving improperly.
[in] | DeviceExtension | A pointer to a device extension which describes the composite battery itself. It is used to gather each connected battery in the list with the composite battery. |
[out] | TotalRate | A pointer returned to caller that describes the total accumulated rate flow of all batteries. |
[out] | BatteriesCount | A pointer returned to caller that describes the batteries present. |
Definition at line 540 of file compbatt.c.
Referenced by CompBattSetStatusNotify().
NTSTATUS NTAPI CompBattDisableStatusNotify | ( | _In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension | ) |
Definition at line 489 of file compbatt.c.
Referenced by CompBattAddDevice().
NTSTATUS NTAPI CompBattGetBatteryGranularity | ( | _Out_ PBATTERY_REPORTING_SCALE | ReportingScale, |
_In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension | ||
) |
Definition at line 1308 of file compbatt.c.
Referenced by CompBattQueryInformation().
NTSTATUS NTAPI CompBattGetBatteryInformation | ( | _Out_ PBATTERY_INFORMATION | BatteryInfo, |
_In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension | ||
) |
Definition at line 1151 of file compbatt.c.
Referenced by CompBattQueryInformation().
NTSTATUS NTAPI CompBattGetEstimatedTime | ( | _Out_ PULONG | Time, |
_In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension | ||
) |
Retrieves the estimated time of the composite battery based on the power drain rate of all the batteries present in the system.
[out] | Time | A pointer to the computed estimated time of the composite battery, returned to caller. Note that if there are not any batteries that are draining power, or if the system is powered by external AC source, the estimated time is unknown |
[in] | DeviceExtension | A pointer to a device extension which describes the composite battery itself. It is used to gather each connected battery in the list with the composite battery. |
Definition at line 1500 of file compbatt.c.
Referenced by CompBattQueryInformation().
Definition at line 428 of file compbatt.c.
Referenced by DriverEntry().
NTSTATUS NTAPI CompBattMonitorIrpComplete | ( | _In_ PDEVICE_OBJECT | DeviceObject, |
_In_ PIRP | Irp, | ||
_In_ PVOID | Context | ||
) |
Queues a work item thread worker which is bound to the individual CM (Control Method) ACPI battery to handle the IRP.
[in] | DeviceObject | A pointer to a device object, this parameter is unused. |
[in] | Irp | A pointer to an I/O request packet. It is used to gather the I/O stack location which contains the data of the individual battery. |
[in] | Context | An aribtrary pointer that points to context data, this paramater is unused. |
Definition at line 92 of file compbatt.c.
Referenced by CompBattAddNewBattery(), and CompBattMonitorIrpCompleteWorker().
VOID NTAPI CompBattMonitorIrpCompleteWorker | ( | _In_ PCOMPBATT_BATTERY_DATA | BatteryData | ) |
The brains of the battery IRP worker. It monitors the state of the IRP as well as sends the IRP down the device stack to gather battery related data, such tag and status. It also serves as the I/O completion routine of which it elaborates the gathered data.
[in] | BatteryData | A pointer to battery data of an individual battery that contains the IRP to be send down the device stack. |
Definition at line 125 of file compbatt.c.
Referenced by CompBattAddNewBattery().
Definition at line 23 of file compbatt.c.
Referenced by DriverEntry().
NTSTATUS NTAPI CompBattQueryInformation | ( | _In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension, |
_In_ ULONG | Tag, | ||
_In_ BATTERY_QUERY_INFORMATION_LEVEL | InfoLevel, | ||
_In_opt_ LONG | AtRate, | ||
_In_ PVOID | Buffer, | ||
_In_ ULONG | BufferLength, | ||
_Out_ PULONG | ReturnedLength | ||
) |
Definition at line 1656 of file compbatt.c.
Referenced by CompBattAddDevice().
NTSTATUS NTAPI CompBattQueryStatus | ( | _In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension, |
_In_ ULONG | Tag, | ||
_Out_ PBATTERY_STATUS | BatteryStatus | ||
) |
Queries the battery status of each individiual connected battery with the composite battery and combines all the retrieved data as one single battery status for the composite battery.
[in] | DeviceExtension | A pointer to a device extension which describes the composite battery itself. It is used to gather each connected battery in the list with the composite battery. |
[in] | Tag | A battery tag supplied by the caller. This is typically the tag of the composite battery which is used to check against the cached tag of the composite battery if it has changed or not. |
[out] | BatteryStatus | A pointer to a battery status that contains the combined data, returned to the caller. It serves as the battery status for the composite battery. |
Definition at line 932 of file compbatt.c.
Referenced by CompBattAddDevice(), CompBattGetEstimatedTime(), CompBattMonitorIrpCompleteWorker(), and CompBattSetStatusNotify().
NTSTATUS NTAPI CompBattQueryTag | ( | _In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension, |
_Out_ PULONG | Tag | ||
) |
Definition at line 453 of file compbatt.c.
Referenced by CompBattAddDevice().
VOID NTAPI CompBattRecalculateTag | ( | _In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension | ) |
Definition at line 390 of file compbatt.c.
Referenced by CompBattQueryTag().
NTSTATUS NTAPI CompBattSetStatusNotify | ( | _In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension, |
_In_ ULONG | BatteryTag, | ||
_In_ PBATTERY_NOTIFY | BatteryNotify | ||
) |
Sets a new configuration battery wait status settings of each battery. The purpose of this is so that the composite battery gets notified of new battery status as if it was a single battery.
[in] | DeviceExtension | A pointer to a device extension which describes the composite battery itself. It is used to gather each connected battery in the list with the composite battery. |
[in] | BatteryTag | A battery tag supplied by the caller. This is typically the tag of the composite battery which is used to check against the cached tag of the composite battery if it has changed or not. |
[in] | BatteryNotify | A pointer to a structure filled with battery notification settings, supplied by the caller. It is used as the new values for the configuration wait settings. |
Definition at line 676 of file compbatt.c.
Referenced by CompBattAddDevice().
Definition at line 42 of file compbatt.c.
Referenced by DriverEntry().
NTSTATUS NTAPI DriverEntry | ( | _In_ PDRIVER_OBJECT | DriverObject, |
_In_ PUNICODE_STRING | RegistryPath | ||
) |
Definition at line 1771 of file compbatt.c.
ULONG CompBattDebug |
Definition at line 17 of file compbatt.c.
Referenced by BatteryIoctl(), CompBattAddDevice(), CompBattAddNewBattery(), CompBattCalculateTotalRateAndLinkedBatteries(), CompBattDisableStatusNotify(), CompBattGetBatteries(), CompBattGetBatteryGranularity(), CompBattGetBatteryInformation(), CompBattGetEstimatedTime(), CompBattIoctl(), CompBattMonitorIrpCompleteWorker(), CompBattOpenClose(), CompBattPnpDispatch(), CompBattPnpEventHandler(), CompBattPowerDispatch(), CompBattQueryInformation(), CompBattQueryStatus(), CompBattQueryTag(), CompBattRecalculateTag(), CompBattRemoveBattery(), CompBattSetStatusNotify(), CompBattSystemControl(), IsBatteryAlreadyOnList(), and RemoveBatteryFromList().