mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:56:26 +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 */
|
/* Must not be exclusively locked */
|
||||||
ASSERT(pobj->cExclusiveLock == 0);
|
ASSERT(pobj->cExclusiveLock == 0);
|
||||||
|
|
||||||
|
DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
|
||||||
|
|
||||||
/* Check if the object has a handle */
|
/* Check if the object has a handle */
|
||||||
if (GDI_HANDLE_GET_INDEX(pobj->hHmgr))
|
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 */
|
/* Check if we reached 0 and handle bit is not set */
|
||||||
if (cRefs == 0)
|
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 */
|
/* Check if the handle was process owned */
|
||||||
if (gpentHmgr[ulIndex].ObjectOwner.ulObj != GDI_OBJ_HMGR_PUBLIC &&
|
if (gpentHmgr[ulIndex].ObjectOwner.ulObj != GDI_OBJ_HMGR_PUBLIC &&
|
||||||
gpentHmgr[ulIndex].ObjectOwner.ulObj != GDI_OBJ_HMGR_NONE)
|
gpentHmgr[ulIndex].ObjectOwner.ulObj != GDI_OBJ_HMGR_NONE)
|
||||||
|
@ -504,6 +509,9 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
|
||||||
|
|
||||||
/* Push entry to the free list */
|
/* Push entry to the free list */
|
||||||
ENTRY_vPushFreeEntry(&gpentHmgr[ulIndex]);
|
ENTRY_vPushFreeEntry(&gpentHmgr[ulIndex]);
|
||||||
|
|
||||||
|
/* Free the object */
|
||||||
|
GDIOBJ_vFreeObject(pobj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -511,20 +519,15 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
|
||||||
/* Decrement the objects reference count */
|
/* Decrement the objects reference count */
|
||||||
ASSERT(pobj->ulShareCount > 0);
|
ASSERT(pobj->ulShareCount > 0);
|
||||||
cRefs = InterlockedDecrement((LONG*)&pobj->ulShareCount);
|
cRefs = InterlockedDecrement((LONG*)&pobj->ulShareCount);
|
||||||
}
|
|
||||||
|
|
||||||
DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
|
|
||||||
|
|
||||||
/* Check if we reached 0 */
|
/* Check if we reached 0 */
|
||||||
if (cRefs == 0)
|
if (cRefs == 0)
|
||||||
{
|
{
|
||||||
/* Make sure it's ok to delete the object */
|
|
||||||
ASSERT(pobj->BaseFlags & BASEFLAG_READY_TO_DIE);
|
|
||||||
|
|
||||||
/* Free the object */
|
/* Free the object */
|
||||||
GDIOBJ_vFreeObject(pobj);
|
GDIOBJ_vFreeObject(pobj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
POBJ
|
POBJ
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue