From a68cd30c0de727da4c6154ed06b94db5f620d9af Mon Sep 17 00:00:00 2001 From: Gregor Schneider Date: Thu, 27 Nov 2008 20:31:37 +0000 Subject: [PATCH] - PS_NULL might always be a LOGPEN, but can be retrieved as LOGPEN and EXTLOGPEN, distinguished by the supplied buffer size - Fixes 8 gdi32 pen winetests, finally all left failures are visible in one cmd window ;-) svn path=/trunk/; revision=37693 --- reactos/subsystems/win32/win32k/objects/pen.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/reactos/subsystems/win32/win32k/objects/pen.c b/reactos/subsystems/win32/win32k/objects/pen.c index 0bf2ae13cdc..cedad53dec3 100644 --- a/reactos/subsystems/win32/win32k/objects/pen.c +++ b/reactos/subsystems/win32/win32k/objects/pen.c @@ -209,8 +209,23 @@ PEN_GetObject(PGDIBRUSHOBJ pPenObject, INT cbCount, PLOGPEN pBuffer) PLOGPEN pLogPen; PEXTLOGPEN pExtLogPen; INT cbRetCount; + BOOLEAN isOldPen; - if (pPenObject->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN) + isOldPen = (pPenObject->flAttrs & GDIBRUSH_IS_OLDSTYLEPEN) > 0; + if ((pPenObject->ulPenStyle & PS_STYLE_MASK) == PS_NULL) + { + /* PS_NULL can be retrieved as LOGPEN or as EXTLOGPEN */ + if (cbCount == sizeof(LOGPEN)) + { + isOldPen = TRUE; + } + else if (cbCount == sizeof(EXTLOGPEN)) + { + isOldPen = FALSE; + } + } + + if (isOldPen) { cbRetCount = sizeof(LOGPEN); if (pBuffer)