Author: tkreuzer
Date: Sun May 13 18:29:31 2012
New Revision: 56579
URL:
http://svn.reactos.org/svn/reactos?rev=56579&view=rev
Log:
[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
Modified:
trunk/reactos/win32ss/gdi/ntgdi/dclife.c
trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/dclife.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dclife.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] Sun May 13 18:29:31 2012
@@ -414,8 +414,19 @@
GreSetObjectOwner(pdc->dclevel.hPath, ulOwner);
}
- IntGdiSetBrushOwner(pdc->dclevel.pbrFill, ulOwner);
- IntGdiSetBrushOwner(pdc->dclevel.pbrLine, ulOwner);
+ /* Dereference current brush and pen */
+ 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 */
if (ulOwner == GDI_OBJ_HMGR_PUBLIC || ulOwner == GDI_OBJ_HMGR_NONE)
Modified: trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/gdiobj.c [iso-8859-1] Sun May 13 18:29:31 2012
@@ -476,18 +476,16 @@
{
ULONG cRefs, ulIndex;
- /* Log the event */
- DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
+ /* Calculate the index */
+ ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr);
/* Check if the object has a handle */
- if (GDI_HANDLE_GET_INDEX(pobj->hHmgr))
- {
- /* Calculate the index */
- ulIndex = GDI_HANDLE_GET_INDEX(pobj->hHmgr);
-
+ if (ulIndex)
+ {
/* Decrement reference count */
ASSERT((gpaulRefCount[ulIndex] & REF_MASK_COUNT) > 0);
cRefs = InterlockedDecrement((LONG*)&gpaulRefCount[ulIndex]);
+ DBG_LOGEVENT(&pobj->slhLog, EVENT_DEREFERENCE, cRefs);
/* Check if we reached 0 and handle bit is not set */
if ((cRefs & REF_MASK_INUSE) == 0)
@@ -517,6 +515,7 @@
/* 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)
@@ -777,6 +776,7 @@
/* Set new owner */
pentry->ObjectOwner.ulObj = ulOwner;
+ DBG_LOGEVENT(&pobj->slhLog, EVENT_SET_OWNER, 0);
}
/* Locks 2 or 3 objects at a time */