From 95b01d03429c1dd0f13a50dacfe5215cfe190b19 Mon Sep 17 00:00:00 2001 From: Gregor Schneider Date: Mon, 24 Nov 2008 18:40:46 +0000 Subject: [PATCH] - Move slightly changed PS_ALTERNATE and PS_INSIDEFRAME checks from win32k to gdi32 - Don't restrict the width of PS_SOLID pens - Fixes 25 gdi32 pen winetests - Pen types left tbd: PS_NULL (problems in GetObject and ExtCreatePen) and PS_ALTNATE (EngLineTo/StrokePath does not support bitmap pens) svn path=/trunk/; revision=37620 --- reactos/dll/win32/gdi32/objects/brush.c | 12 ++++++++++++ reactos/subsystems/win32/win32k/objects/pen.c | 7 +------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/reactos/dll/win32/gdi32/objects/brush.c b/reactos/dll/win32/gdi32/objects/brush.c index 51cf766698b..c8b4b66d662 100644 --- a/reactos/dll/win32/gdi32/objects/brush.c +++ b/reactos/dll/win32/gdi32/objects/brush.c @@ -30,6 +30,18 @@ ExtCreatePen(DWORD dwPenStyle, return 0; } } + else if ((dwPenStyle & PS_STYLE_MASK) == PS_INSIDEFRAME && + (dwPenStyle & PS_TYPE_MASK) != PS_GEOMETRIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + else if ((dwPenStyle & PS_STYLE_MASK) == PS_ALTERNATE && + (dwPenStyle & PS_TYPE_MASK) != PS_COSMETIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } else { if (dwStyleCount || lpStyle) diff --git a/reactos/subsystems/win32/win32k/objects/pen.c b/reactos/subsystems/win32/win32k/objects/pen.c index 83a03ad06e0..8ade40f6af4 100644 --- a/reactos/subsystems/win32/win32k/objects/pen.c +++ b/reactos/subsystems/win32/win32k/objects/pen.c @@ -79,7 +79,7 @@ IntGdiExtCreatePen( hPen = PenObject->BaseObject.hHmgr; // If nWidth is zero, the pen is a single pixel wide, regardless of the current transformation. - if ((bOldStylePen) && (!dwWidth)) dwWidth = 1; + if ((bOldStylePen) && (!dwWidth) && (dwPenStyle & PS_STYLE_MASK) != PS_SOLID) dwWidth = 1; PenObject->ptPenWidth.x = dwWidth; PenObject->ptPenWidth.y = 0; @@ -108,8 +108,6 @@ IntGdiExtCreatePen( break; case PS_ALTERNATE: - /* PS_ALTERNATE is applicable only for cosmetic pens */ - if ((dwPenStyle & PS_TYPE_MASK) == PS_GEOMETRIC) goto ExitCleanup; PenObject->flAttrs |= GDIBRUSH_IS_BITMAP; PenObject->hbmPattern = IntGdiCreateBitmap(24, 1, 1, 1, (LPBYTE)PatternAlternate); break; @@ -135,9 +133,6 @@ IntGdiExtCreatePen( break; 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 ExitCleanup; PenObject->flAttrs |= (GDIBRUSH_IS_SOLID|GDIBRUSH_IS_INSIDEFRAME); break;