- Implemented event services.
authorDavid Welch <welch@cwcom.net>
Mon, 8 Mar 2004 07:04:57 +0000 (07:04 +0000)
committerDavid Welch <welch@cwcom.net>
Mon, 8 Mar 2004 07:04:57 +0000 (07:04 +0000)
svn path=/trunk/; revision=8583

reactos/subsys/win32k/eng/event.c [new file with mode: 0644]
reactos/subsys/win32k/makefile
reactos/subsys/win32k/stubs/xpstubs.c

diff --git a/reactos/subsys/win32k/eng/event.c b/reactos/subsys/win32k/eng/event.c
new file mode 100644 (file)
index 0000000..c04235e
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ *  ReactOS W32 Subsystem
+ *  Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/* $Id: event.c,v 1.1 2004/03/08 07:04:56 dwelch Exp $
+ *
+ * COPYRIGHT:        See COPYING in the top level directory
+ * PROJECT:          ReactOS kernel
+ * PURPOSE:          Win32k event functions
+ * FILE:             subsys/win32k/eng/event.c
+ * PROGRAMER:        Jason Filby
+ * REVISION HISTORY:
+ *        2/10/1999: Created
+ */
+
+#include <ddk/winddi.h>
+#include <ddk/ntddk.h>
+#include <include/eng.h>
+#include <include/inteng.h>
+#include <include/tags.h>
+
+#define NDEBUG
+#include <win32k/debug1.h>
+
+BOOL
+STDCALL
+EngCreateEvent ( OUT PEVENT *Event )
+{
+  (*Event) = ExAllocatePool(NonPagedPool, sizeof(TAG_DRIVER));
+  if ((*Event) == NULL)
+    {
+      return FALSE;
+    }
+  KeInitializeEvent((PKEVENT)(*Event), SynchronizationEvent, FALSE); 
+  return TRUE;
+}
+
+BOOL
+STDCALL
+EngDeleteEvent ( IN PEVENT Event)
+{
+  ExFreePool(Event);
+  return TRUE;
+}
+
+PEVENT
+STDCALL
+EngMapEvent(IN HDEV    Dev,
+           IN HANDLE  UserObject,
+           IN PVOID   Reserved1,
+           IN PVOID   Reserved2,
+           IN PVOID   Reserved3)
+{
+  NTSTATUS Status;
+  PKEVENT Event;
+
+  Status = ObReferenceObjectByHandle(UserObject,
+                                    EVENT_MODIFY_STATE,
+                                    ExEventObjectType,
+                                    KernelMode,
+                                    (PVOID*)&Event,
+                                    NULL);
+  if (!NT_SUCCESS(Status))
+    {
+      return NULL;
+    }                               
+  return (PEVENT)Event;
+}
+
+LONG
+STDCALL
+EngSetEvent ( IN PEVENT Event )
+{
+  return KeSetEvent((PKEVENT)Event, IO_NO_INCREMENT, FALSE);
+}
+
+BOOL
+STDCALL
+EngUnmapEvent ( IN PEVENT Event )
+{
+  ObDereferenceObject((PVOID)Event);
+  return TRUE;
+}
+
+BOOL
+STDCALL
+EngWaitForSingleObject (IN PEVENT          Event,
+                       IN PLARGE_INTEGER  TimeOut)
+{
+  NTSTATUS Status;
+
+  Status = KeWaitForSingleObject(Event,
+                                Executive,
+                                KernelMode,
+                                FALSE,
+                                TimeOut);
+  if (Status != STATUS_SUCCESS)
+    {
+      return FALSE;
+    }
+  return TRUE;
+}
index 1a52e0e..9bb1da0 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.94 2004/02/24 01:30:57 weiden Exp $
+# $Id: makefile,v 1.95 2004/03/08 07:04:56 dwelch Exp $
 
 PATH_TO_TOP = ../..
 
@@ -42,7 +42,7 @@ ENG_OBJECTS= eng/debug.o eng/error.o eng/mem.o eng/brush.o eng/bitblt.o \
     eng/clip.o eng/copybits.o eng/device.o eng/handle.o eng/lineto.o \
     eng/paint.o eng/palette.o eng/perfcnt.o eng/semaphor.o eng/surface.o \
     eng/xlate.o eng/transblt.o eng/mouse.o eng/misc.o eng/nls.o eng/sort.o \
-    eng/gradient.o 
+    eng/gradient.o eng/event.o
 
 MAIN_OBJECTS = main/dllmain.o main/svctabm.o
 
index 07f7d31..d7920ad 100644 (file)
@@ -15,8 +15,6 @@
 
 #define STUB(x) void x(void) { DbgPrint("WIN32K: Stub for %s\n", #x); }
 
-typedef PVOID EVENT, *PEVENT;
-
 BOOL
 STDCALL
 EngAlphaBlend(
@@ -42,65 +40,3 @@ EngControlSprites(
   return FALSE;
 }
 
-BOOL
-STDCALL
-EngCreateEvent ( OUT PEVENT *ppEvent )
-{
-  // www.osr.com/ddk/graphics/gdifncs_1civ.htm
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-BOOL
-STDCALL
-EngDeleteEvent ( IN PEVENT pEvent)
-{
-  // www.osr.com/ddk/graphics/gdifncs_6qp3.htm
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-PEVENT
-STDCALL
-EngMapEvent(
-       IN HDEV    hDev,
-       IN HANDLE  hUserObject,
-       IN PVOID   Reserved1,
-       IN PVOID   Reserved2,
-       IN PVOID   Reserved3
-       )
-{
-  // www.osr.com/ddk/graphics/gdifncs_3pnr.htm
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-LONG
-STDCALL
-EngSetEvent ( IN PEVENT pEvent )
-{
-  // www.osr.com/ddk/graphics/gdifncs_6p0n.htm
-  UNIMPLEMENTED;
-  return 0;
-}
-
-BOOL
-STDCALL
-EngUnmapEvent ( IN PEVENT pEvent )
-{
-  // www.osr.com/ddk/graphics/gdifncs_5m7b.htm
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-BOOL
-STDCALL
-EngWaitForSingleObject (
-       IN PEVENT          pEvent,
-       IN PLARGE_INTEGER  pTimeOut
-       )
-{
-  // www.osr.com/ddk/graphics/gdifncs_4n53.htm
-  UNIMPLEMENTED;
-  return FALSE;
-}