Commit in reactos/subsys/win32k/objects on MAIN
gdiobj.c+13-11.75 -> 1.76
decrement process gdi object counter on object deletion

reactos/subsys/win32k/objects
gdiobj.c 1.75 -> 1.76
diff -u -r1.75 -r1.76
--- gdiobj.c	12 Dec 2004 21:25:05 -0000	1.75
+++ gdiobj.c	13 Dec 2004 12:51:51 -0000	1.76
@@ -19,7 +19,7 @@
 /*
  * GDIOBJ.C - GDI object manipulation routines
  *
- * $Id: gdiobj.c,v 1.75 2004/12/12 21:25:05 weiden Exp $
+ * $Id: gdiobj.c,v 1.76 2004/12/13 12:51:51 weiden Exp $
  */
 #include <w32k.h>
 
@@ -364,6 +364,7 @@
       if(GdiHdr->LockingThread == NULL)
       {
         BOOL Ret;
+        PW32PROCESS W32Process = PsGetWin32Process();
         ULONG Type = Entry->Type << 16;
 
         /* Clear the type field so when unlocking the handle it gets finally deleted */
@@ -372,6 +373,11 @@
         
         /* unlock the handle slot */
         InterlockedExchange(&Entry->ProcessId, 0);
+        
+        if(W32Process != NULL)
+        {
+          InterlockedDecrement(&W32Process->GDIObjects);
+        }
 
         /* call the cleanup routine. */
         Ret = RunCleanupCallback(GDIHdrToBdy(GdiHdr), Type);
@@ -817,6 +823,7 @@
         if(Entry->Type == 0 && GdiHdr->Locks == 0)
         {
           PPAGED_LOOKASIDE_LIST LookasideList;
+          PW32PROCESS W32Process = PsGetWin32Process();
           DWORD Type = GDI_HANDLE_GET_TYPE(hObj);
           
           ASSERT(ProcessId != 0); /* must not delete a global handle!!!! */
@@ -825,6 +832,11 @@
           Entry->KernelData = NULL;
           InterlockedExchange(&Entry->ProcessId, 0);
           
+          if(W32Process != NULL)
+          {
+            InterlockedDecrement(&W32Process->GDIObjects);
+          }
+          
           /* call the cleanup routine. */
           Ret = RunCleanupCallback(GDIHdrToBdy(GdiHdr), Type);
 
CVSspam 0.2.8