https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dff8b93ee26c4ac53330e0455ce7b772259cf847

commit dff8b93ee26c4ac53330e0455ce7b772259cf847
Author:     Hervé Poussineau <hpous...@reactos.org>
AuthorDate: Thu Feb 1 22:38:55 2024 +0100
Commit:     Hervé Poussineau <hpous...@reactos.org>
CommitDate: Mon Feb 5 18:04:02 2024 +0100

    [NTOS:PO] Give the power device type to PopAddRemoveSysCapsCallback function
---
 ntoskrnl/include/internal/po.h | 13 +++++++++++++
 ntoskrnl/po/power.c            |  4 ++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/include/internal/po.h b/ntoskrnl/include/internal/po.h
index f763a33f3ea..32fb6f441b8 100644
--- a/ntoskrnl/include/internal/po.h
+++ b/ntoskrnl/include/internal/po.h
@@ -33,6 +33,19 @@
 #define POTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
 #endif
 
+typedef enum _POP_POLICY_DEVICE_TYPE
+{
+    PolicyDeviceSystemButton = 0,
+    PolicyDeviceThermalZone = 1,
+    PolicyDeviceBattery = 2,
+    PolicyDeviceMemory = 3,
+    PolicyInitiatePowerActionAPI = 4,
+    PolicySetPowerStateAPI = 5,
+    PolicyImmediateDozeS4 = 6,
+    PolicySystemIdle = 7,
+    PolicyDeviceMax = 8,
+} POP_POLICY_DEVICE_TYPE;
+
 typedef struct _PO_HIBER_PERF
 {
     ULONGLONG IoTicks;
diff --git a/ntoskrnl/po/power.c b/ntoskrnl/po/power.c
index 7b5b39fa818..b7143b441d3 100644
--- a/ntoskrnl/po/power.c
+++ b/ntoskrnl/po/power.c
@@ -410,7 +410,7 @@ PoInitSystem(IN ULONG BootPhase)
                                                 (PVOID)&GUID_DEVICE_SYS_BUTTON,
                                                 
IopRootDeviceNode->PhysicalDeviceObject->DriverObject,
                                                 PopAddRemoveSysCapsCallback,
-                                                NULL,
+                                                
(PVOID)(ULONG_PTR)PolicyDeviceSystemButton,
                                                 &NotificationEntry);
         if (!NT_SUCCESS(Status))
             return FALSE;
@@ -421,7 +421,7 @@ PoInitSystem(IN ULONG BootPhase)
                                                 (PVOID)&GUID_DEVICE_LID,
                                                 
IopRootDeviceNode->PhysicalDeviceObject->DriverObject,
                                                 PopAddRemoveSysCapsCallback,
-                                                NULL,
+                                                
(PVOID)(ULONG_PTR)PolicyDeviceSystemButton,
                                                 &NotificationEntry);
         return NT_SUCCESS(Status);
     }

Reply via email to