41 DbgPrint(
"CompBatt: ENTERING RemoveBatteryFromList\n");
45 ListHead = &DeviceExtension->BatteryList;
46 NextEntry = ListHead->
Flink;
47 while (NextEntry != ListHead)
66 NextEntry = NextEntry->
Flink;
84 DbgPrint(
"CompBatt: ENTERING IsBatteryAlreadyOnList\n");
88 ListHead = &DeviceExtension->BatteryList;
89 NextEntry = ListHead->
Flink;
90 while (NextEntry != ListHead)
102 NextEntry = NextEntry->
Flink;
123 DbgPrint(
"CompBatt: ENTERING AddNewBattery \"%w\" \n", BatteryName->Buffer);
190 DbgPrint(
"CompBatt: Couldn't allocate new battery Irp\n");
198 DbgPrint(
"CompBattAddNewBattery: Failed to get device Object. status = %lx\n",
212 DbgPrint(
"CompBatt: Couldn't allocate new battery node\n");
239 DeviceExtension->Flags = 0;
267 if (!LinkString.
Length)
break;
280 DbgPrint(
"CompBatt: Couldn't get list of batteries\n");
301 DbgPrint(
"CompBatt: Received notification of battery arrival\n");
308 DbgPrint(
"CompBatt: Received notification of battery removal\n");
361 DbgPrint(
"CompBattAddDevice: Could not attach to LowerDevice.\n");
373 DeviceExtension->
Flags = 0;
380 MiniportInfo.
Context = DeviceExtension;
425 (
PVOID)&GUID_DEVICE_BATTERY,
434 DbgPrint(
"CompBatt: Successfully registered for PnP notification\n");
441 DbgPrint(
"CompBatt: Couldn't register for PnP notification - %x\n",
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define BATTERY_CLASS_MAJOR_VERSION
PBCLASS_QUERY_INFORMATION_CALLBACK BCLASS_QUERY_INFORMATION
PBCLASS_SET_STATUS_NOTIFY_CALLBACK BCLASS_SET_STATUS_NOTIFY
PBCLASS_DISABLE_STATUS_NOTIFY_CALLBACK BCLASS_DISABLE_STATUS_NOTIFY
#define BATTERY_CLASS_MINOR_VERSION
PBCLASS_QUERY_STATUS_CALLBACK BCLASS_QUERY_STATUS
#define BATTERY_TAG_INVALID
PBCLASS_QUERY_TAG_CALLBACK BCLASS_QUERY_TAG
BCLASSAPI NTSTATUS NTAPI BatteryClassStatusNotify(PVOID ClassData)
BCLASSAPI NTSTATUS NTAPI BatteryClassInitializeDevice(PBATTERY_MINIPORT_INFO MiniportInfo, PVOID *ClassData)
#define FILE_DEVICE_SECURE_OPEN
NTSTATUS NTAPI CompBattMonitorIrpComplete(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PKEVENT Event)
NTSTATUS NTAPI CompBattQueryInformation(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG Tag, IN BATTERY_QUERY_INFORMATION_LEVEL InfoLevel, IN OPTIONAL LONG AtRate, IN PVOID Buffer, IN ULONG BufferLength, OUT PULONG ReturnedLength)
NTSTATUS NTAPI CompBattDisableStatusNotify(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
NTSTATUS NTAPI CompBattMonitorIrpCompleteWorker(IN PCOMPBATT_BATTERY_DATA BatteryData)
NTSTATUS NTAPI CompBattQueryTag(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension, OUT PULONG Tag)
NTSTATUS NTAPI CompBattSetStatusNotify(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG BatteryTag, IN PBATTERY_NOTIFY BatteryNotify)
NTSTATUS NTAPI CompBattQueryStatus(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension, IN ULONG Tag, IN PBATTERY_STATUS BatteryStatus)
NTSTATUS NTAPI CompBattGetDeviceObjectPointer(IN PUNICODE_STRING DeviceName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
NTSTATUS NTAPI CompBattRemoveBattery(IN PCUNICODE_STRING BatteryName, IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
NTSTATUS NTAPI CompBattPnpEventHandler(IN PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification, IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
PCOMPBATT_BATTERY_DATA NTAPI RemoveBatteryFromList(IN PCUNICODE_STRING BatteryName, IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
NTSTATUS NTAPI CompBattPowerDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI CompBattAddNewBattery(IN PUNICODE_STRING BatteryName, IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
BOOLEAN NTAPI IsBatteryAlreadyOnList(IN PCUNICODE_STRING BatteryName, IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
NTSTATUS NTAPI CompBattAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PdoDeviceObject)
NTSTATUS NTAPI CompBattPnpDispatch(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI CompBattGetBatteries(IN PCOMPBATT_DEVICE_EXTENSION DeviceExtension)
#define STATUS_NOT_SUPPORTED
#define NT_SUCCESS(StatCode)
const GUID GUID_DEVICE_INTERFACE_ARRIVAL
const GUID GUID_DEVICE_INTERFACE_REMOVAL
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
#define InitializeListHead(ListHead)
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT _In_ PUSB_PORT_PATH _Out_ PUSB_CD_ERROR_INFORMATION _In_ USHORT _In_ PDEVICE_OBJECT PdoDeviceObject
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define IRP_MN_SURPRISE_REMOVAL
#define IoSkipCurrentIrpStackLocation(Irp)
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
VOID NTAPI IoDetachDevice(IN PDEVICE_OBJECT TargetDevice)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid, IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL, IN ULONG Flags, OUT PWSTR *SymbolicLinkList)
#define IoCompleteRequest
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
NTSTATUS NTAPI IoRegisterPlugPlayNotification(_In_ IO_NOTIFICATION_EVENT_CATEGORY EventCategory, _In_ ULONG EventCategoryFlags, _In_opt_ PVOID EventCategoryData, _In_ PDRIVER_OBJECT DriverObject, _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, _Inout_opt_ PVOID Context, _Out_ PVOID *NotificationEntry)
#define FILE_DEVICE_BATTERY
BCLASS_QUERY_INFORMATION QueryInformation
BCLASS_SET_STATUS_NOTIFY SetStatusNotify
BCLASS_SET_INFORMATION SetInformation
PUNICODE_STRING DeviceName
BCLASS_DISABLE_STATUS_NOTIFY DisableStatusNotify
BCLASS_QUERY_STATUS QueryStatus
BCLASS_QUERY_TAG QueryTag
PDEVICE_OBJECT DeviceObject
UNICODE_STRING BatteryName
IO_REMOVE_LOCK RemoveLock
PDEVICE_OBJECT DeviceObject
PDEVICE_OBJECT AttachedDevice
struct _IO_STACK_LOCATION::@3978::@4017 Others
union _IO_STACK_LOCATION::@1579 Parameters
struct _LIST_ENTRY * Flink
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_DEVICE_NOT_CONNECTED
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
#define IsEqualGUIDAligned(guid1, guid2)
#define ExInitializeWorkItem(Item, Routine, Context)
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#define IoAcquireRemoveLock(RemoveLock, Tag)
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
#define IoReleaseRemoveLockAndWait(_RemoveLock, _Tag)
#define IoInitializeRemoveLock(Lock, AllocateTag, MaxLockedMinutes, HighWatermark)
#define IRP_MN_CANCEL_STOP_DEVICE
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define PNP_DEVICE_NOT_DISABLEABLE
#define IRP_MN_START_DEVICE
@ EventCategoryDeviceInterfaceChange
#define IRP_MN_CANCEL_REMOVE_DEVICE
DRIVER_NOTIFICATION_CALLBACK_ROUTINE * PDRIVER_NOTIFICATION_CALLBACK_ROUTINE
#define ObDereferenceObject
#define ObReferenceObject