Index: win32ss/gdi/ntgdi/pen.c =================================================================== --- win32ss/gdi/ntgdi/pen.c (revision 75919) +++ win32ss/gdi/ntgdi/pen.c (working copy) @@ -93,6 +93,32 @@ static ULONG aulStyleDashDotDot[] = { 3, 1, 1, 1, 1, 1 }; ULONG i; + /* check styles */ + switch (dwPenStyle & PS_ENDCAP_MASK) + { + case PS_ENDCAP_ROUND: case PS_ENDCAP_SQUARE: case PS_ENDCAP_FLAT: + break; + default: + EngSetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + switch (dwPenStyle & PS_JOIN_MASK) + { + case PS_JOIN_ROUND: case PS_JOIN_BEVEL: case PS_JOIN_MITER: + break; + default: + EngSetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + switch (dwPenStyle & PS_TYPE_MASK) + { + case PS_COSMETIC: case PS_GEOMETRIC: + break; + default: + EngSetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + dwWidth = abs(dwWidth); if ( (dwPenStyle & PS_STYLE_MASK) == PS_NULL)