forked from reactos/reactos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
/* | ||
* PROJECT: ReactOS Composite Battery Driver | ||
* LICENSE: BSD - See COPYING.ARM in the top level directory | ||
* FILE: boot/drivers/bus/acpi/compbatt/compbatt.h | ||
* PURPOSE: Main Header File | ||
* PROGRAMMERS: ReactOS Portable Systems Group | ||
* PROJECT: ReactOS Composite Battery Driver | ||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) | ||
* PURPOSE: Composite battery main header file | ||
* COPYRIGHT: Copyright 2010 ReactOS Portable Systems Group | ||
* Copyright 2024 George Bișoc <[email protected]> | ||
*/ | ||
|
||
/* INCLUDES *******************************************************************/ | ||
|
||
#ifndef _COMPBATT_PCH_ | ||
#define _COMPBATT_PCH_ | ||
|
||
#include <wdm.h> | ||
#include <batclass.h> | ||
|
||
/* DEFINES ********************************************************************/ | ||
|
||
#define COMPBATT_BATTERY_INFORMATION_PRESENT 0x04 | ||
#define COMPBATT_TAG_ASSIGNED 0x80 | ||
|
||
/* STRUCTURES *****************************************************************/ | ||
|
||
typedef struct _COMPBATT_BATTERY_DATA | ||
{ | ||
LIST_ENTRY BatteryLink; | ||
|
@@ -56,101 +62,103 @@ typedef struct _COMPBATT_DEVICE_EXTENSION | |
PVOID NotificationEntry; | ||
} COMPBATT_DEVICE_EXTENSION, *PCOMPBATT_DEVICE_EXTENSION; | ||
|
||
/* PROTOTYPES *****************************************************************/ | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattAddDevice( | ||
IN PDRIVER_OBJECT DriverObject, | ||
IN PDEVICE_OBJECT PdoDeviceObject | ||
_In_ PDRIVER_OBJECT DriverObject, | ||
_In_ PDEVICE_OBJECT PdoDeviceObject | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattPowerDispatch( | ||
IN PDEVICE_OBJECT DeviceObject, | ||
IN PIRP Irp | ||
_In_ PDEVICE_OBJECT DeviceObject, | ||
_In_ PIRP Irp | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattPnpDispatch( | ||
IN PDEVICE_OBJECT DeviceObject, | ||
IN PIRP Irp | ||
_In_ PDEVICE_OBJECT DeviceObject, | ||
_In_ PIRP Irp | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattQueryInformation( | ||
IN PCOMPBATT_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 | ||
_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 | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattQueryStatus( | ||
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension, | ||
IN ULONG Tag, | ||
IN PBATTERY_STATUS BatteryStatus | ||
_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension, | ||
_In_ ULONG Tag, | ||
_In_ PBATTERY_STATUS BatteryStatus | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattSetStatusNotify( | ||
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension, | ||
IN ULONG BatteryTag, | ||
IN PBATTERY_NOTIFY BatteryNotify | ||
_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension, | ||
_In_ ULONG BatteryTag, | ||
_In_ PBATTERY_NOTIFY BatteryNotify | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattDisableStatusNotify( | ||
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension | ||
_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattQueryTag( | ||
IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension, | ||
OUT PULONG Tag | ||
_In_ PCOMPBATT_DEVICE_EXTENSION DeviceExtension, | ||
_Out_ PULONG Tag | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattMonitorIrpComplete( | ||
IN PDEVICE_OBJECT DeviceObject, | ||
IN PIRP Irp, | ||
IN PKEVENT Event | ||
_In_ PDEVICE_OBJECT DeviceObject, | ||
_In_ PIRP Irp, | ||
_In_ PKEVENT Event | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattMonitorIrpCompleteWorker( | ||
IN PCOMPBATT_BATTERY_DATA BatteryData | ||
_In_ PCOMPBATT_BATTERY_DATA BatteryData | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
CompBattGetDeviceObjectPointer( | ||
IN PUNICODE_STRING DeviceName, | ||
IN ACCESS_MASK DesiredAccess, | ||
OUT PFILE_OBJECT *FileObject, | ||
OUT PDEVICE_OBJECT *DeviceObject | ||
_In_ PUNICODE_STRING DeviceName, | ||
_In_ ACCESS_MASK DesiredAccess, | ||
_Out_ PFILE_OBJECT *FileObject, | ||
_Out_ PDEVICE_OBJECT *DeviceObject | ||
); | ||
|
||
NTSTATUS | ||
NTAPI | ||
BatteryIoctl( | ||
IN ULONG IoControlCode, | ||
IN PDEVICE_OBJECT DeviceObject, | ||
IN PVOID InputBuffer, | ||
IN ULONG InputBufferLength, | ||
IN PVOID OutputBuffer, | ||
IN ULONG OutputBufferLength, | ||
IN BOOLEAN InternalDeviceIoControl | ||
_In_ ULONG IoControlCode, | ||
_In_ PDEVICE_OBJECT DeviceObject, | ||
_In_ PVOID InputBuffer, | ||
_In_ ULONG InputBufferLength, | ||
_In_ PVOID OutputBuffer, | ||
_In_ ULONG OutputBufferLength, | ||
_In_ BOOLEAN InternalDeviceIoControl | ||
); | ||
|
||
extern ULONG CompBattDebug; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters