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>
15 PopAddRemoveSysCapsCallback(
16 IN PVOID NotificationStructure
,
19 PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification
;
20 OBJECT_ATTRIBUTES ObjectAttributes
;
22 IO_STATUS_BLOCK IoStatusBlock
;
27 DPRINT("PopAddRemoveSysCapsCallback(%p %p)\n",
28 NotificationStructure
, Context
);
30 Notification
= (PDEVICE_INTERFACE_CHANGE_NOTIFICATION
)NotificationStructure
;
31 if (Notification
->Version
!= 1)
32 return STATUS_REVISION_MISMATCH
;
33 if (Notification
->Size
!= sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION
))
34 return STATUS_INVALID_PARAMETER
;
35 if (RtlCompareMemory(&Notification
->Event
, &GUID_DEVICE_INTERFACE_ARRIVAL
, sizeof(GUID
) == sizeof(GUID
)))
37 else if (RtlCompareMemory(&Notification
->Event
, &GUID_DEVICE_INTERFACE_REMOVAL
, sizeof(GUID
) == sizeof(GUID
)))
40 return STATUS_INVALID_PARAMETER
;
44 DPRINT("Arrival of %wZ\n", Notification
->SymbolicLinkName
);
47 InitializeObjectAttributes(
49 Notification
->SymbolicLinkName
,
58 FILE_SHARE_READ
| FILE_SHARE_WRITE
,
60 if (!NT_SUCCESS(Status
))
62 DPRINT("ZwOpenFile() failed with status 0x%08lx\n", Status
);
66 /* Send IOCTL_GET_SYS_BUTTON_CAPS to get new caps */
67 Status
= ZwDeviceIoControlFile(
73 IOCTL_GET_SYS_BUTTON_CAPS
,
78 if (!NT_SUCCESS(Status
))
80 DPRINT("ZwDeviceIoControlFile(IOCTL_GET_SYS_BUTTON_CAPS) failed with status 0x%08lx\n", Status
);
81 ZwClose(DeviceHandle
);
84 /* FIXME: What do do with this? */
85 DPRINT1("Device capabilities: 0x%lx\n", Caps
);
87 /* Send IOCTL_GET_SYS_BUTTON_CAPS to get current caps */
88 /* FIXME: Set a IO completion routine on it to be able to send a new one */
89 DPRINT1("Send a IOCTL_GET_SYS_BUTTON_EVENT\n");
90 return ZwClose(DeviceHandle
);
94 DPRINT1("Removal of a power capable device not implemented\n");
95 return STATUS_NOT_IMPLEMENTED
;