ReactOS  0.4.15-dev-506-ga3ec01c
ioevent.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Kernel
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: ntoskrnl/io/iomgr/ioevent.c
5  * PURPOSE: I/O Wrappers for the Executive Event Functions
6  * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7  * Eric Kohl
8  */
9 
10 /* INCLUDES *****************************************************************/
11 
12 #include <ntoskrnl.h>
13 #include <debug.h>
14 
15 /* PRIVATE FUNCTIONS *********************************************************/
16 
17 PKEVENT
18 NTAPI
22 {
24  PKEVENT Event;
25  HANDLE Handle;
27  PAGED_CODE();
28 
29  /* Initialize the object attributes */
31  EventName,
33  NULL,
34  NULL);
35 
36  /* Create the event */
37  Status = ZwCreateEvent(&Handle,
40  Type,
41  TRUE);
42  if (!NT_SUCCESS(Status)) return NULL;
43 
44  /* Get a handle to it */
46  0,
48  KernelMode,
49  (PVOID*)&Event,
50  NULL);
51  if (!NT_SUCCESS(Status))
52  {
53  ZwClose(Handle);
54  return NULL;
55  }
56 
57  /* Dereference the extra count, and return the handle */
60  return Event;
61 }
62 
63 /* PUBLIC FUNCTIONS **********************************************************/
64 
65 /*
66  * @implemented
67  */
68 PKEVENT
69 NTAPI
72 {
73  /* Call the internal API */
74  return IopCreateEvent(EventName, EventHandle, NotificationEvent);
75 }
76 
77 /*
78  * @implemented
79  */
80 PKEVENT
81 NTAPI
84 {
85  /* Call the internal API */
87 }
88 
89 /* EOF */
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
#define IN
Definition: typedefs.h:39
#define TRUE
Definition: types.h:120
Type
Definition: Type.h:6
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
PKEVENT NTAPI IopCreateEvent(IN PUNICODE_STRING EventName, IN PHANDLE EventHandle, IN EVENT_TYPE Type)
Definition: ioevent.c:19
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_OPENIF
Definition: winternl.h:229
POBJECT_TYPE ExEventObjectType
Definition: event.c:22
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:496
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define EVENT_ALL_ACCESS
Definition: isotest.c:82
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:437
smooth NULL
Definition: ftsmooth.c:416
PKEVENT NTAPI IoCreateNotificationEvent(IN PUNICODE_STRING EventName, IN PHANDLE EventHandle)
Definition: ioevent.c:70
enum _EVENT_TYPE EVENT_TYPE
_In_ HANDLE Handle
Definition: extypes.h:390
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
Status
Definition: gdiplustypes.h:24
PKEVENT NTAPI IoCreateSynchronizationEvent(IN PUNICODE_STRING EventName, IN PHANDLE EventHandle)
Definition: ioevent.c:82
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define PAGED_CODE()
_Out_ PHANDLE EventHandle
Definition: iofuncs.h:855