Author: jimtabor
Date: Fri Nov 9 12:13:01 2007
New Revision: 30287
URL:
http://svn.reactos.org/svn/reactos?rev=30287&view=rev
Log:
Fix bug spoted by Stefan100 on IRC.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Fri Nov 9 12:13:01 2007
@@ -668,9 +668,19 @@
NtGdiDeleteObject(HGDIOBJ hObject)
{
DPRINT("NtGdiDeleteObject handle 0x%08x\n", hObject);
-
- return NULL != hObject
- ? GDIOBJ_FreeObj(GdiHandleTable, hObject, GDI_OBJECT_TYPE_DONTCARE) : FALSE;
+ INT Index = GDI_HANDLE_GET_INDEX(hObject);
+ PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
+ // We check to see if the objects are knocking on deaths door.
+ if ((Entry->Type & ~GDI_ENTRY_REUSE_MASK) != 0 && Entry->KernelData
!= NULL)
+ {
+ return NULL != hObject
+ ? GDIOBJ_FreeObj(GdiHandleTable, hObject, GDI_OBJECT_TYPE_DONTCARE) :
FALSE;
+ }
+ else
+ {
+ DPRINT1("Attempt DeleteObject 0x%x currently being
destroyed!!!\n",hObject);
+ return TRUE; // return true and move on.
+ }
}
/*!