mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 21:46:05 +00:00
[WIN32K]
When dereferencing an object without a handle, don't check for the ready-to-die flag svn path=/trunk/; revision=56517
This commit is contained in:
parent
043a85aad1
commit
7afed148ab
1 changed files with 14 additions and 11 deletions
|
@ -479,6 +479,8 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
|
|||
/* Must not be exclusively locked */
|
||||
ASSERT(pobj->cExclusiveLock == 0);
|
||||
|
||||
DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
|
||||
|
||||
/* Check if the object has a handle */
|
||||
if (GDI_HANDLE_GET_INDEX(pobj->hHmgr))
|
||||
{
|
||||
|
@ -492,6 +494,9 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
|
|||
/* Check if we reached 0 and handle bit is not set */
|
||||
if (cRefs == 0)
|
||||
{
|
||||
/* Make sure it's ok to delete the object */
|
||||
ASSERT(pobj->BaseFlags & BASEFLAG_READY_TO_DIE);
|
||||
|
||||
/* Check if the handle was process owned */
|
||||
if (gpentHmgr[ulIndex].ObjectOwner.ulObj != GDI_OBJ_HMGR_PUBLIC &&
|
||||
gpentHmgr[ulIndex].ObjectOwner.ulObj != GDI_OBJ_HMGR_NONE)
|
||||
|
@ -504,6 +509,9 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
|
|||
|
||||
/* Push entry to the free list */
|
||||
ENTRY_vPushFreeEntry(&gpentHmgr[ulIndex]);
|
||||
|
||||
/* Free the object */
|
||||
GDIOBJ_vFreeObject(pobj);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -511,20 +519,15 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
|
|||
/* Decrement the objects reference count */
|
||||
ASSERT(pobj->ulShareCount > 0);
|
||||
cRefs = InterlockedDecrement((LONG*)&pobj->ulShareCount);
|
||||
}
|
||||
|
||||
DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
|
||||
|
||||
/* Check if we reached 0 */
|
||||
if (cRefs == 0)
|
||||
{
|
||||
/* Make sure it's ok to delete the object */
|
||||
ASSERT(pobj->BaseFlags & BASEFLAG_READY_TO_DIE);
|
||||
|
||||
/* Free the object */
|
||||
GDIOBJ_vFreeObject(pobj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
POBJ
|
||||
NTAPI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue