Author: jimtabor
Date: Wed Jun 4 12:45:18 2008
New Revision: 33857
URL: http://svn.reactos.org/svn/reactos?rev=33857&view=rev
Log:
Sorry, I should have spotted this when I was in here.. I think this takes care of the leak and crash. Wine testing is back with the same errors. So we are good to go.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/pen.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/pen.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/pen.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/pen.c [iso-8859-1] Wed Jun 4 12:45:18 2008
@@ -95,7 +95,7 @@
// If dwPenStyle is PS_COSMETIC, the width must be set to 1.
if ( !(bOldStylePen) && ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) && ( dwWidth != 1) )
- goto EEXIT;
+ goto ExitCleanup;
switch (dwPenStyle & PS_STYLE_MASK)
{
@@ -109,7 +109,7 @@
case PS_ALTERNATE:
/* PS_ALTERNATE is applicable only for cosmetic pens */
- if ((dwPenStyle & PS_TYPE_MASK) == PS_GEOMETRIC) goto EEXIT;
+ if ((dwPenStyle & PS_TYPE_MASK) == PS_GEOMETRIC) goto ExitCleanup;
PenObject->flAttrs |= GDIBRUSH_IS_BITMAP;
PenObject->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate);
break;
@@ -137,7 +137,7 @@
case PS_INSIDEFRAME:
/* FIXME: does it need some additional work? */
/* PS_INSIDEFRAME is applicable only for geometric pens */
- if ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) goto EEXIT;
+ if ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) goto ExitCleanup;
PenObject->flAttrs |= (GDIBRUSH_IS_SOLID|GDIBRUSH_IS_INSIDEFRAME);
break;
@@ -162,7 +162,7 @@
if(all_zero || has_neg)
{
- goto EEXIT;
+ goto ExitCleanup;
}
}
/* FIXME: what style here? */
@@ -175,8 +175,13 @@
PENOBJ_UnlockPen(PenObject);
return hPen;
-EEXIT:
+ExitCleanup:
SetLastWin32Error(ERROR_INVALID_PARAMETER);
+ if (PenObject->pStyle)
+ {
+ ExFreePool(PenObject->pStyle);
+ PenObject->pStyle = NULL;
+ }
PENOBJ_UnlockPen(PenObject);
if (bOldStylePen)
PENOBJ_FreePenByHandle(hPen);
@@ -339,11 +344,6 @@
bOldStylePen,
hBrush);
- if (!hPen && pSafeStyle)
- {
- ExFreePool(pSafeStyle);
- }
-// BRUSH_Cleanup takes care of pSafeStyle when deleteing the pen
return hPen;
}
Author: jimtabor
Date: Wed Jun 4 11:07:47 2008
New Revision: 33855
URL: http://svn.reactos.org/svn/reactos?rev=33855&view=rev
Log:
Prevent a crash if the list is empty and check for zero. If (List is Empty! DCE!) is called before the crash, this means we have a thread that is not finished running before shutdown. There is a proper way for handling this
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] Wed Jun 4 11:07:47 2008
@@ -632,6 +632,7 @@
KeEnterCriticalRegion();
do
{
+ if (!pDCE) break;
if (pDCE->hwndCurrent == Window->hSelf)
{
if (!(pDCE->DCXFlags & DCX_CACHE)) /* owned or Class DCE*/
@@ -651,6 +652,7 @@
Window->Wnd->Style & CS_OWNDC) /* owned DCE*/
{
pDCE = DceFreeDCE(pDCE, FALSE);
+ if (!pDCE) break;
Window->Dce = NULL;
continue;
}
Author: jimtabor
Date: Wed Jun 4 01:10:49 2008
New Revision: 33849
URL: http://svn.reactos.org/svn/reactos?rev=33849&view=rev
Log:
No need to do it twice.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Wed Jun 4 01:10:49 2008
@@ -1506,8 +1506,6 @@
// Set this Brush to inaccessible mode and to an Owner of NONE.
// if (OwnerMask == GDI_OBJ_HMGR_NONE) Owner = OwnerMask;
- // Deny user access to User Data.
- pEntry->UserData = NULL; // This hBR is inaccessible!
if (!GDIOBJ_SetOwnership((HGDIOBJ) hBR, Owner))
return FALSE;