mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
decrement process gdi object counter on object deletion
svn path=/trunk/; revision=12078
This commit is contained in:
parent
55c08f71b9
commit
56a8abdfa4
1 changed files with 13 additions and 1 deletions
|
@ -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 @@ LockHandle:
|
|||
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 @@ LockHandle:
|
|||
|
||||
/* 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 @@ LockHandle:
|
|||
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 @@ LockHandle:
|
|||
Entry->KernelData = NULL;
|
||||
InterlockedExchange(&Entry->ProcessId, 0);
|
||||
|
||||
if(W32Process != NULL)
|
||||
{
|
||||
InterlockedDecrement(&W32Process->GDIObjects);
|
||||
}
|
||||
|
||||
/* call the cleanup routine. */
|
||||
Ret = RunCleanupCallback(GDIHdrToBdy(GdiHdr), Type);
|
||||
|
||||
|
|
Loading…
Reference in a new issue