From 0a2b580710c651bf55675671bec074a6ec294f80 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 6 Oct 2000 16:54:04 +0000 Subject: [PATCH] Implemented IoCreateNotificationEvent() and IoCreateSynchronizationEvent() svn path=/trunk/; revision=1381 --- reactos/ntoskrnl/io/event.c | 70 +++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/io/event.c b/reactos/ntoskrnl/io/event.c index de5d0fbdfcc..1e662a7f90c 100644 --- a/reactos/ntoskrnl/io/event.c +++ b/reactos/ntoskrnl/io/event.c @@ -1,4 +1,4 @@ -/* $Id: event.c,v 1.2 2000/03/26 19:38:22 ea Exp $ +/* $Id: event.c,v 1.3 2000/10/06 16:54:04 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -12,6 +12,7 @@ /* INCLUDES *****************************************************************/ #include +#include #include @@ -20,18 +21,75 @@ PKEVENT STDCALL IoCreateNotificationEvent(PUNICODE_STRING EventName, - PHANDLE EventHandle) + PHANDLE EventHandle) { - UNIMPLEMENTED; + OBJECT_ATTRIBUTES ObjectAttributes; + PKEVENT Event; + HANDLE Handle; + NTSTATUS Status; + + InitializeObjectAttributes(&ObjectAttributes, + EventName, + OBJ_OPENIF, + NULL, + NULL); + + Status = NtCreateEvent(&Handle, + EVENT_ALL_ACCESS, + &ObjectAttributes, + FALSE, + TRUE); + if (!NT_SUCCESS(Status)) + return NULL; + + ObReferenceObjectByHandle(Handle, + 0, + ExEventObjectType, + KernelMode, + &Event, + NULL); + ObDereferenceObject(Event); + + *EventHandle = Handle; + + return Event; } PKEVENT STDCALL IoCreateSynchronizationEvent(PUNICODE_STRING EventName, - PHANDLE EventHandle) + PHANDLE EventHandle) { - UNIMPLEMENTED; + OBJECT_ATTRIBUTES ObjectAttributes; + PKEVENT Event; + HANDLE Handle; + NTSTATUS Status; + + InitializeObjectAttributes(&ObjectAttributes, + EventName, + OBJ_OPENIF, + NULL, + NULL); + + Status = NtCreateEvent(&Handle, + EVENT_ALL_ACCESS, + &ObjectAttributes, + TRUE, + TRUE); + if (!NT_SUCCESS(Status)) + return NULL; + + ObReferenceObjectByHandle(Handle, + 0, + ExEventObjectType, + KernelMode, + &Event, + NULL); + ObDereferenceObject(Event); + + *EventHandle = Handle; + + return Event; } - /* EOF */