mirror of
https://github.com/reactos/reactos.git
synced 2025-01-08 23:31:53 +00:00
[WIN32K]
- In DC_vSetOwner, do not take ownership of the current dc brush and pen, instead dereference them and select default brush and pen. Fixes bug #7070 - Fix debug logging in GDIOBJ_vDereferenceObject - create debug log event in GDIOBJ_vSetObjectOwner svn path=/trunk/; revision=56579
This commit is contained in:
parent
12ad95e140
commit
cb936d362c
2 changed files with 19 additions and 8 deletions
|
@ -414,8 +414,19 @@ DC_vSetOwner(PDC pdc, ULONG ulOwner)
|
||||||
GreSetObjectOwner(pdc->dclevel.hPath, ulOwner);
|
GreSetObjectOwner(pdc->dclevel.hPath, ulOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
IntGdiSetBrushOwner(pdc->dclevel.pbrFill, ulOwner);
|
/* Dereference current brush and pen */
|
||||||
IntGdiSetBrushOwner(pdc->dclevel.pbrLine, ulOwner);
|
BRUSH_ShareUnlockBrush(pdc->dclevel.pbrFill);
|
||||||
|
BRUSH_ShareUnlockBrush(pdc->dclevel.pbrLine);
|
||||||
|
|
||||||
|
/* Select the default fill and line brush */
|
||||||
|
pdc->dcattr.hbrush = StockObjects[WHITE_BRUSH];
|
||||||
|
pdc->dcattr.hpen = StockObjects[BLACK_PEN];
|
||||||
|
pdc->dclevel.pbrFill = BRUSH_ShareLockBrush(pdc->pdcattr->hbrush);
|
||||||
|
pdc->dclevel.pbrLine = PEN_ShareLockPen(pdc->pdcattr->hpen);
|
||||||
|
|
||||||
|
/* Update the EBRUSHOBJs */
|
||||||
|
EBRUSHOBJ_vUpdate(&pdc->eboFill, pdc->dclevel.pbrFill, pdc);
|
||||||
|
EBRUSHOBJ_vUpdate(&pdc->eboLine, pdc->dclevel.pbrLine, pdc);
|
||||||
|
|
||||||
/* Allocate or free DC attribute */
|
/* Allocate or free DC attribute */
|
||||||
if (ulOwner == GDI_OBJ_HMGR_PUBLIC || ulOwner == GDI_OBJ_HMGR_NONE)
|
if (ulOwner == GDI_OBJ_HMGR_PUBLIC || ulOwner == GDI_OBJ_HMGR_NONE)
|
||||||
|
|
|
@ -476,18 +476,16 @@ GDIOBJ_vDereferenceObject(POBJ pobj)
|
||||||
{
|
{
|
||||||
ULONG cRefs, ulIndex;
|
ULONG cRefs, ulIndex;
|
||||||
|
|
||||||
/* Log the event */
|
/* Calculate the index */
|
||||||
DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
|
ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr);
|
||||||
|
|
||||||
/* Check if the object has a handle */
|
/* Check if the object has a handle */
|
||||||
if (GDI_HANDLE_GET_INDEX(pobj->hHmgr))
|
if (ulIndex)
|
||||||
{
|
{
|
||||||
/* Calculate the index */
|
|
||||||
ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr);
|
|
||||||
|
|
||||||
/* Decrement reference count */
|
/* Decrement reference count */
|
||||||
ASSERT((gpaulRefCount[ulIndex] & REF_MASK_COUNT) > 0);
|
ASSERT((gpaulRefCount[ulIndex] & REF_MASK_COUNT) > 0);
|
||||||
cRefs = InterlockedDecrement((LONG*)&gpaulRefCount[ulIndex]);
|
cRefs = InterlockedDecrement((LONG*)&gpaulRefCount[ulIndex]);
|
||||||
|
DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
|
||||||
|
|
||||||
/* Check if we reached 0 and handle bit is not set */
|
/* Check if we reached 0 and handle bit is not set */
|
||||||
if ((cRefs & REF_MASK_INUSE) == 0)
|
if ((cRefs & REF_MASK_INUSE) == 0)
|
||||||
|
@ -517,6 +515,7 @@ 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)
|
||||||
|
@ -777,6 +776,7 @@ GDIOBJ_vSetObjectOwner(
|
||||||
|
|
||||||
/* Set new owner */
|
/* Set new owner */
|
||||||
pentry->ObjectOwner.ulObj = ulOwner;
|
pentry->ObjectOwner.ulObj = ulOwner;
|
||||||
|
DBG_LOGEVENT(&pobj->slhLog, EVENT_SET_OWNER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Locks 2 or 3 objects at a time */
|
/* Locks 2 or 3 objects at a time */
|
||||||
|
|
Loading…
Reference in a new issue