ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ioevent.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS Kernel
00003  * LICENSE:         GPL - See COPYING in the top level directory
00004  * FILE:            ntoskrnl/io/event.c
00005  * PURPOSE:         I/O Wrappers for the Executive Event Functions
00006  * PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
00007  *                  Eric Kohl
00008  */
00009 
00010 /* INCLUDES *****************************************************************/
00011 
00012 #include <ntoskrnl.h>
00013 #include <debug.h>
00014 
00015 /* PRIVATE FUNCTIONS *********************************************************/
00016 
00017 PKEVENT
00018 NTAPI
00019 IopCreateEvent(IN PUNICODE_STRING EventName,
00020                IN PHANDLE EventHandle,
00021                IN EVENT_TYPE Type)
00022 {
00023     OBJECT_ATTRIBUTES ObjectAttributes;
00024     PKEVENT Event;
00025     HANDLE Handle;
00026     NTSTATUS Status;
00027     PAGED_CODE();
00028 
00029     /* Initialize the object attributes */
00030     InitializeObjectAttributes(&ObjectAttributes,
00031                                EventName,
00032                                OBJ_OPENIF | OBJ_KERNEL_HANDLE,
00033                                NULL,
00034                                NULL);
00035 
00036     /* Create the event */
00037     Status = ZwCreateEvent(&Handle,
00038                            EVENT_ALL_ACCESS,
00039                            &ObjectAttributes,
00040                            Type,
00041                            TRUE);
00042     if (!NT_SUCCESS(Status)) return NULL;
00043 
00044     /* Get a handle to it */
00045     ObReferenceObjectByHandle(Handle,
00046                               0,
00047                               ExEventObjectType,
00048                               KernelMode,
00049                               (PVOID*)&Event,
00050                               NULL);
00051 
00052     /* Dereference the extra count, and return the handle */
00053     ObDereferenceObject(Event);
00054     *EventHandle = Handle;
00055     return Event;
00056 }
00057 
00058 /* PUBLIC FUNCTIONS **********************************************************/
00059 
00060 /*
00061  * @implemented
00062  */
00063 PKEVENT
00064 NTAPI
00065 IoCreateNotificationEvent(IN PUNICODE_STRING EventName,
00066                           IN PHANDLE EventHandle)
00067 {
00068     /* Call the internal API */
00069     return IopCreateEvent(EventName, EventHandle, NotificationEvent);
00070 }
00071 
00072 /*
00073  * @implemented
00074  */
00075 PKEVENT
00076 NTAPI
00077 IoCreateSynchronizationEvent(IN PUNICODE_STRING EventName,
00078                              IN PHANDLE EventHandle)
00079 {
00080     /* Call the internal API */
00081     return IopCreateEvent(EventName, EventHandle, SynchronizationEvent);
00082 }
00083 
00084 /* EOF */

Generated on Sat May 26 2012 04:35:43 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.