2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/po/events.c
5 * PURPOSE: Power Manager
7 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
12 #include <internal/debug.h>
14 PKWIN32_POWEREVENT_CALLOUT PopEventCallout
;
15 extern PCALLBACK_OBJECT SetSystemTimeCallback
;
19 PoNotifySystemTimeSet(VOID
)
23 /* Check if Win32k registered a notification callback */
26 /* Raise to dispatch */
27 KeRaiseIrql(DISPATCH_LEVEL
, &OldIrql
);
29 /* Notify the callback */
30 ExNotifyCallback(SetSystemTimeCallback
, NULL
, NULL
);
39 PopAddRemoveSysCapsCallback(
40 IN PVOID NotificationStructure
,
43 PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification
;
44 OBJECT_ATTRIBUTES ObjectAttributes
;
46 IO_STATUS_BLOCK IoStatusBlock
;
51 DPRINT("PopAddRemoveSysCapsCallback(%p %p)\n",
52 NotificationStructure
, Context
);
54 Notification
= (PDEVICE_INTERFACE_CHANGE_NOTIFICATION
)NotificationStructure
;
55 if (Notification
->Version
!= 1)
56 return STATUS_REVISION_MISMATCH
;
57 if (Notification
->Size
!= sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION
))
58 return STATUS_INVALID_PARAMETER
;
59 if (RtlCompareMemory(&Notification
->Event
, &GUID_DEVICE_INTERFACE_ARRIVAL
, sizeof(GUID
) == sizeof(GUID
)))
61 else if (RtlCompareMemory(&Notification
->Event
, &GUID_DEVICE_INTERFACE_REMOVAL
, sizeof(GUID
) == sizeof(GUID
)))
64 return STATUS_INVALID_PARAMETER
;
68 DPRINT("Arrival of %wZ\n", Notification
->SymbolicLinkName
);
71 InitializeObjectAttributes(
73 Notification
->SymbolicLinkName
,
82 FILE_SHARE_READ
| FILE_SHARE_WRITE
,
84 if (!NT_SUCCESS(Status
))
86 DPRINT("ZwOpenFile() failed with status 0x%08lx\n", Status
);
90 /* Send IOCTL_GET_SYS_BUTTON_CAPS to get new caps */
91 Status
= ZwDeviceIoControlFile(
97 IOCTL_GET_SYS_BUTTON_CAPS
,
102 if (!NT_SUCCESS(Status
))
104 DPRINT("ZwDeviceIoControlFile(IOCTL_GET_SYS_BUTTON_CAPS) failed with status 0x%08lx\n", Status
);
105 ZwClose(DeviceHandle
);
108 /* FIXME: What do do with this? */
109 DPRINT1("Device capabilities: 0x%lx\n", Caps
);
111 /* Send IOCTL_GET_SYS_BUTTON_CAPS to get current caps */
112 /* FIXME: Set a IO completion routine on it to be able to send a new one */
113 DPRINT1("Send a IOCTL_GET_SYS_BUTTON_EVENT\n");
114 return ZwClose(DeviceHandle
);
118 DPRINT1("Removal of a power capable device not implemented\n");
119 return STATUS_NOT_IMPLEMENTED
;