Author: sginsberg
Date: Tue Sep 16 06:57:24 2008
New Revision: 36266
URL: 
http://svn.reactos.org/svn/reactos?rev=36266&view=rev
Log:
- EngCreateEvent: Don't allocate with zero tag
- EngAllocMem: Make sure we get a tag
- Misc cleanup
Modified:
    branches/nwin32/subsystems/win32/win32k/eng/engevent.c
    branches/nwin32/subsystems/win32/win32k/eng/engmem.c
    branches/nwin32/subsystems/win32/win32k/eng/engrtl.c
Modified: branches/nwin32/subsystems/win32/win32k/eng/engevent.c
URL:
http://svn.reactos.org/svn/reactos/branches/nwin32/subsystems/win32/win32k/…
==============================================================================
--- branches/nwin32/subsystems/win32/win32k/eng/engevent.c [iso-8859-1] (original)
+++ branches/nwin32/subsystems/win32/win32k/eng/engevent.c [iso-8859-1] Tue Sep 16
06:57:24 2008
@@ -12,28 +12,33 @@
 #define NDEBUG
 #include <debug.h>
+#define TAG_ENG TAG('E', 'n', 'g', ' ')
+
 /* PUBLIC FUNCTIONS **********************************************************/
 BOOL
 APIENTRY
 EngCreateEvent(OUT PEVENT* Event)
 {
+    PKEVENT LocalEvent;
+
     /* Allocate memory for the event */
-    *Event = EngAllocMem(FL_NONPAGED_MEMORY,
-                            sizeof(KEVENT),
-                            0);
+    LocalEvent = EngAllocMem(FL_NONPAGED_MEMORY,
+                                sizeof(KEVENT),
+                                TAG_ENG);
     /* Check if we are out of memory  */
-       if (!*Event)
+       if (!LocalEvent)
        {
            /* We are, fail */
         return FALSE;
     }
-    /* Initialize the event */
-    KeInitializeEvent((PKEVENT)*Event,
+    /* Initialize the event and return it */
+    KeInitializeEvent(LocalEvent,
                       SynchronizationEvent,
                       FALSE);
+    *Event = (PEVENT)LocalEvent;
        /* Return success */
     return TRUE;
@@ -43,10 +48,8 @@
 APIENTRY
 EngDeleteEvent(IN PEVENT Event)
 {
-    /* Free the event */
+    /* Just free the event */
     EngFreeMem(Event);
-
-    /* Return success */
     return TRUE;
 }
@@ -86,8 +89,9 @@
 {
     PKEVENT Event;
     NTSTATUS Status;
-
-    /* FIXME: Should we do anything with the reserved parameters? */
+
+    /* Assume failure */
+    Event = NULL;
     /* Reference the object  */
     Status = ObReferenceObjectByHandle(hUserObject,
@@ -114,10 +118,8 @@
 APIENTRY
 EngUnmapEvent(IN PEVENT Event)
 {
-    /* Dereference the event */
+    /* Just dereference the event */
     ObDereferenceObject(Event);
-
-    /* Return success */
     return TRUE;
 }
Modified: branches/nwin32/subsystems/win32/win32k/eng/engmem.c
URL:
http://svn.reactos.org/svn/reactos/branches/nwin32/subsystems/win32/win32k/…
==============================================================================
--- branches/nwin32/subsystems/win32/win32k/eng/engmem.c [iso-8859-1] (original)
+++ branches/nwin32/subsystems/win32/win32k/eng/engmem.c [iso-8859-1] Tue Sep 16 06:57:24
2008
@@ -22,6 +22,9 @@
 {
     PVOID AllocatedMemory;
        POOL_TYPE AllocationType;
+
+    /* Make sure we get a tag */
+    ASSERT(Tag != 0);
        /* Get the requested pool type */
     AllocationType = (Flags & FL_NONPAGED_MEMORY) ? NonPagedPool : PagedPool;
Modified: branches/nwin32/subsystems/win32/win32k/eng/engrtl.c
URL:
http://svn.reactos.org/svn/reactos/branches/nwin32/subsystems/win32/win32k/…
==============================================================================
--- branches/nwin32/subsystems/win32/win32k/eng/engrtl.c [iso-8859-1] (original)
+++ branches/nwin32/subsystems/win32/win32k/eng/engrtl.c [iso-8859-1] Tue Sep 16 06:57:24
2008
@@ -25,12 +25,11 @@
 VOID
 APIENTRY
-EngMultiByteToUnicodeN(
-  OUT LPWSTR  UnicodeString,
-  IN ULONG  MaxBytesInUnicodeString,
-  OUT PULONG  BytesInUnicodeString,
-  IN PCHAR  MultiByteString,
-  IN ULONG  BytesInMultiByteString)
+EngMultiByteToUnicodeN(OUT LPWSTR UnicodeString,
+                       IN ULONG MaxBytesInUnicodeString,
+                       OUT PULONG BytesInUnicodeString,
+                       IN PCHAR MultiByteString,
+                       IN ULONG BytesInMultiByteString)
 {
     /* Call Rtl */
     RtlMultiByteToUnicodeN(UnicodeString,