From 366d8d52e382678386e0977a823ac47591b977bf Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 6 May 2012 11:51:57 +0000 Subject: [PATCH] [WIN32K] Do not ASSERT that the object is not exclusively locked in GDIOBJ_vDereferenceObject. The idea behind this was to easily detect cases where someone would accidentally dereference an object, instead of unlocking it. But this function is used from other functions, that can definately deal with exclusively locked objects. Changing this would leat to code duplication / more complex code. Forgetting to unlock an object will still be detected by the kernel, when returning to user mode, since APC would still be disabled. Should fix failed assertion when running dx9 setup. svn path=/trunk/; revision=56525 --- reactos/win32ss/gdi/ntgdi/gdiobj.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/gdiobj.c b/reactos/win32ss/gdi/ntgdi/gdiobj.c index f907160007e..42aa57d3866 100644 --- a/reactos/win32ss/gdi/ntgdi/gdiobj.c +++ b/reactos/win32ss/gdi/ntgdi/gdiobj.c @@ -476,9 +476,7 @@ GDIOBJ_vDereferenceObject(POBJ pobj) { ULONG cRefs, ulIndex; - /* Must not be exclusively locked */ - ASSERT(pobj->cExclusiveLock == 0); - + /* Log the event */ DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs); /* Check if the object has a handle */ @@ -489,10 +487,10 @@ GDIOBJ_vDereferenceObject(POBJ pobj) /* Decrement reference count */ ASSERT((gpaulRefCount[ulIndex] & REF_MASK_COUNT) > 0); - cRefs = InterlockedDecrement((LONG*)&gpaulRefCount[ulIndex]) & REF_MASK_INUSE; + cRefs = InterlockedDecrement((LONG*)&gpaulRefCount[ulIndex]); /* Check if we reached 0 and handle bit is not set */ - if (cRefs == 0) + if ((cRefs & REF_MASK_INUSE) == 0) { /* Make sure it's ok to delete the object */ ASSERT(pobj->BaseFlags & BASEFLAG_READY_TO_DIE);