ReactOS 0.4.16-dev-737-g3368adc
|
Go to the source code of this file.
Classes | |
struct | _COMPBATT_BATTERY_DATA |
struct | _COMPBATT_DEVICE_EXTENSION |
Macros | |
#define | COMPBATT_TAG 'aBoC' |
#define | COMPBATT_BATTERY_INFORMATION_PRESENT 0x04 |
#define | COMPBATT_STATUS_NOTIFY_SET 0x10 |
#define | COMPBATT_TAG_ASSIGNED 0x80 |
#define | COMPBATT_QUERY_TAG 1 |
#define | COMPBATT_READ_STATUS 2 |
#define | COMPBATT_WAIT_MIN_LOW_CAPACITY 0 |
#define | COMPBATT_WAIT_MAX_HIGH_CAPACITY 0x7FFFFFFF |
#define | COMPBATT_ATRATE_HOUR_IN_SECS 3600 |
#define | COMPBATT_FRESH_STATUS_TIME 50000000 |
#define | COMPUTE_BATT_CAP_DELTA(LowDiff, Batt, TotalRate) ((ULONG)(((LONGLONG)LowDiff * (Batt)->BatteryStatus.Rate) / TotalRate)) |
#define | COMPUTE_ATRATE_DRAIN(Batt, Time) ((LONG)((Batt)->BatteryStatus.Capacity) * COMPBATT_ATRATE_HOUR_IN_SECS / Time) |
#define | COMPBATT_DEBUG_INFO 0x1 |
#define | COMPBATT_DEBUG_TRACE 0x2 |
#define | COMPBATT_DEBUG_WARN 0x4 |
#define | COMPBATT_DEBUG_ERR 0x10 |
#define | COMPBATT_DEBUG_ALL_LEVELS (COMPBATT_DEBUG_INFO | COMPBATT_DEBUG_TRACE | COMPBATT_DEBUG_WARN | COMPBATT_DEBUG_ERR) |
Typedefs | |
typedef struct _COMPBATT_BATTERY_DATA | COMPBATT_BATTERY_DATA |
typedef struct _COMPBATT_BATTERY_DATA * | PCOMPBATT_BATTERY_DATA |
typedef struct _COMPBATT_DEVICE_EXTENSION | COMPBATT_DEVICE_EXTENSION |
typedef struct _COMPBATT_DEVICE_EXTENSION * | PCOMPBATT_DEVICE_EXTENSION |
Variables | |
ULONG | CompBattDebug |
#define COMPBATT_ATRATE_HOUR_IN_SECS 3600 |
Definition at line 46 of file compbatt.h.
#define COMPBATT_BATTERY_INFORMATION_PRESENT 0x04 |
Definition at line 27 of file compbatt.h.
#define COMPBATT_DEBUG_ALL_LEVELS (COMPBATT_DEBUG_INFO | COMPBATT_DEBUG_TRACE | COMPBATT_DEBUG_WARN | COMPBATT_DEBUG_ERR) |
Definition at line 72 of file compbatt.h.
#define COMPBATT_DEBUG_ERR 0x10 |
Definition at line 71 of file compbatt.h.
#define COMPBATT_DEBUG_INFO 0x1 |
Definition at line 68 of file compbatt.h.
#define COMPBATT_DEBUG_TRACE 0x2 |
Definition at line 69 of file compbatt.h.
#define COMPBATT_DEBUG_WARN 0x4 |
Definition at line 70 of file compbatt.h.
#define COMPBATT_FRESH_STATUS_TIME 50000000 |
Definition at line 51 of file compbatt.h.
#define COMPBATT_QUERY_TAG 1 |
Definition at line 34 of file compbatt.h.
#define COMPBATT_READ_STATUS 2 |
Definition at line 35 of file compbatt.h.
#define COMPBATT_STATUS_NOTIFY_SET 0x10 |
Definition at line 28 of file compbatt.h.
#define COMPBATT_TAG 'aBoC' |
Definition at line 22 of file compbatt.h.
#define COMPBATT_TAG_ASSIGNED 0x80 |
Definition at line 29 of file compbatt.h.
#define COMPBATT_WAIT_MAX_HIGH_CAPACITY 0x7FFFFFFF |
Definition at line 41 of file compbatt.h.
#define COMPBATT_WAIT_MIN_LOW_CAPACITY 0 |
Definition at line 40 of file compbatt.h.
#define COMPUTE_ATRATE_DRAIN | ( | Batt, | |
Time | |||
) | ((LONG)((Batt)->BatteryStatus.Capacity) * COMPBATT_ATRATE_HOUR_IN_SECS / Time) |
Definition at line 62 of file compbatt.h.
#define COMPUTE_BATT_CAP_DELTA | ( | LowDiff, | |
Batt, | |||
TotalRate | |||
) | ((ULONG)(((LONGLONG)LowDiff * (Batt)->BatteryStatus.Rate) / TotalRate)) |
Definition at line 56 of file compbatt.h.
NTSTATUS NTAPI BatteryIoctl | ( | _In_ ULONG | IoControlCode, |
_In_ PDEVICE_OBJECT | DeviceObject, | ||
_In_ PVOID | InputBuffer, | ||
_In_ ULONG | InputBufferLength, | ||
_Out_ PVOID | OutputBuffer, | ||
_Inout_ ULONG | OutputBufferLength, | ||
_In_ BOOLEAN | InternalDeviceIoControl | ||
) |
Definition at line 16 of file compmisc.c.
Referenced by CompBattCalculateAtRateTime(), CompBattGetBatteryGranularity(), CompBattGetBatteryInformation(), CompBattGetEstimatedTime(), and CompBattQueryStatus().
NTSTATUS NTAPI CompBattAddDevice | ( | _In_ PDRIVER_OBJECT | DriverObject, |
_In_ PDEVICE_OBJECT | PdoDeviceObject | ||
) |
Definition at line 328 of file comppnp.c.
Referenced by DriverEntry().
NTSTATUS NTAPI CompBattDisableStatusNotify | ( | _In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension | ) |
Definition at line 489 of file compbatt.c.
Referenced by CompBattAddDevice().
NTSTATUS NTAPI CompBattGetDeviceObjectPointer | ( | _In_ PUNICODE_STRING | DeviceName, |
_In_ ACCESS_MASK | DesiredAccess, | ||
_Out_ PFILE_OBJECT * | FileObject, | ||
_Out_ PDEVICE_OBJECT * | DeviceObject | ||
) |
Definition at line 74 of file compmisc.c.
Referenced by CompBattAddNewBattery().
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().
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 412 of file comppnp.c.
Referenced by DriverEntry().
Definition at line 18 of file comppnp.c.
Referenced by DriverEntry().
NTSTATUS NTAPI CompBattQueryInformation | ( | _In_ PCOMPBATT_DEVICE_EXTENSION | FdoExtension, |
_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().
NTSTATUS NTAPI CompBattRemoveBattery | ( | _In_ PUNICODE_STRING | BatteryName, |
_In_ PCOMPBATT_DEVICE_EXTENSION | DeviceExtension | ||
) |
Definition at line 226 of file comppnp.c.
Referenced by CompBattMonitorIrpCompleteWorker().
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().
|
extern |
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().