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>
16 PopAddRemoveSysCapsCallback(
17 IN PVOID NotificationStructure
,
20 PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification
;
21 OBJECT_ATTRIBUTES ObjectAttributes
;
23 IO_STATUS_BLOCK IoStatusBlock
;
28 DPRINT("PopAddRemoveSysCapsCallback(%p %p)\n",
29 NotificationStructure
, Context
);
31 Notification
= (PDEVICE_INTERFACE_CHANGE_NOTIFICATION
)NotificationStructure
;
32 if (Notification
->Version
!= 1)
33 return STATUS_REVISION_MISMATCH
;
34 if (Notification
->Size
!= sizeof(DEVICE_INTERFACE_CHANGE_NOTIFICATION
))
35 return STATUS_INVALID_PARAMETER
;
36 if (RtlCompareMemory(&Notification
->Event
, &GUID_DEVICE_INTERFACE_ARRIVAL
, sizeof(GUID
) == sizeof(GUID
)))
38 else if (RtlCompareMemory(&Notification
->Event
, &GUID_DEVICE_INTERFACE_REMOVAL
, sizeof(GUID
) == sizeof(GUID
)))
41 return STATUS_INVALID_PARAMETER
;
45 DPRINT("Arrival of %wZ\n", Notification
->SymbolicLinkName
);
48 InitializeObjectAttributes(
50 Notification
->SymbolicLinkName
,
59 FILE_SHARE_READ
| FILE_SHARE_WRITE
,
61 if (!NT_SUCCESS(Status
))
63 DPRINT("ZwOpenFile() failed with status 0x%08lx\n", Status
);
67 /* Send IOCTL_GET_SYS_BUTTON_CAPS to get new caps */
68 Status
= ZwDeviceIoControlFile(
74 IOCTL_GET_SYS_BUTTON_CAPS
,
79 if (!NT_SUCCESS(Status
))
81 DPRINT("ZwDeviceIoControlFile(IOCTL_GET_SYS_BUTTON_CAPS) failed with status 0x%08lx\n", Status
);
82 ZwClose(DeviceHandle
);
85 /* FIXME: What do do with this? */
86 DPRINT1("Device capabilities: 0x%lx\n", Caps
);
88 /* Send IOCTL_GET_SYS_BUTTON_CAPS to get current caps */
89 /* FIXME: Set a IO completion routine on it to be able to send a new one */
90 DPRINT1("Send a IOCTL_GET_SYS_BUTTON_EVENT\n");
91 return ZwClose(DeviceHandle
);
95 DPRINT1("Removal of a power capable device not implemented\n");
96 return STATUS_NOT_IMPLEMENTED
;