[NTOS:PO] Give the power device type to PopAddRemoveSysCapsCallback function

This commit is contained in:
Hervé Poussineau 2024-02-01 22:38:55 +01:00
parent 0be4e4aa6d
commit dff8b93ee2
2 changed files with 15 additions and 2 deletions

View file

@ -33,6 +33,19 @@
#define POTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__) #define POTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
#endif #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 typedef struct _PO_HIBER_PERF
{ {
ULONGLONG IoTicks; ULONGLONG IoTicks;

View file

@ -410,7 +410,7 @@ PoInitSystem(IN ULONG BootPhase)
(PVOID)&GUID_DEVICE_SYS_BUTTON, (PVOID)&GUID_DEVICE_SYS_BUTTON,
IopRootDeviceNode->PhysicalDeviceObject->DriverObject, IopRootDeviceNode->PhysicalDeviceObject->DriverObject,
PopAddRemoveSysCapsCallback, PopAddRemoveSysCapsCallback,
NULL, (PVOID)(ULONG_PTR)PolicyDeviceSystemButton,
&NotificationEntry); &NotificationEntry);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
return FALSE; return FALSE;
@ -421,7 +421,7 @@ PoInitSystem(IN ULONG BootPhase)
(PVOID)&GUID_DEVICE_LID, (PVOID)&GUID_DEVICE_LID,
IopRootDeviceNode->PhysicalDeviceObject->DriverObject, IopRootDeviceNode->PhysicalDeviceObject->DriverObject,
PopAddRemoveSysCapsCallback, PopAddRemoveSysCapsCallback,
NULL, (PVOID)(ULONG_PTR)PolicyDeviceSystemButton,
&NotificationEntry); &NotificationEntry);
return NT_SUCCESS(Status); return NT_SUCCESS(Status);
} }