(GDIOBJ_SetOwnership): Don't try to decrease the GDI object counter for global handles since they're not associated with process.

svn path=/trunk/; revision=14166
This commit is contained in:
Filip Navara 2005-03-17 22:00:19 +00:00
parent 02755a61f0
commit a384c6e670

View file

@ -1216,15 +1216,18 @@ LockHandle:
/* dereference the process' object counter */
/* FIXME */
Status = PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)PrevProcId & ~0x1), &OldProcess);
if(NT_SUCCESS(Status))
if((ULONG_PTR)PrevProcId & ~0x1)
{
W32Process = OldProcess->Win32Process;
if(W32Process != NULL)
Status = PsLookupProcessByProcessId((HANDLE)((ULONG_PTR)PrevProcId & ~0x1), &OldProcess);
if(NT_SUCCESS(Status))
{
InterlockedDecrement(&W32Process->GDIObjects);
W32Process = OldProcess->Win32Process;
if(W32Process != NULL)
{
InterlockedDecrement(&W32Process->GDIObjects);
}
ObDereferenceObject(OldProcess);
}
ObDereferenceObject(OldProcess);
}
if(NewOwner != NULL)