From dc01e41975df37fc2ed845457702cc269eab39fa Mon Sep 17 00:00:00 2001 From: cracyc Date: Sun, 18 Apr 2021 08:57:40 -0500 Subject: [PATCH] use null_pen stock object for ps_null pen --- gdi/gdi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdi/gdi.c b/gdi/gdi.c index 8c6d9a70efb..b538fc66422 100644 --- a/gdi/gdi.c +++ b/gdi/gdi.c @@ -1888,6 +1888,9 @@ HPEN16 WINAPI CreatePen16( INT16 style, INT16 width, COLORREF color ) { LOGPEN logpen; + if (style == PS_NULL) + return GetStockObject16(NULL_PEN); + logpen.lopnStyle = style; logpen.lopnWidth.x = width; logpen.lopnWidth.y = 0; @@ -1903,6 +1906,9 @@ HPEN16 WINAPI CreatePenIndirect16( const LOGPEN16 * pen ) { LOGPEN logpen; + if (pen->lopnStyle == PS_NULL) + return GetStockObject16(NULL_PEN); + if (pen->lopnStyle > PS_INSIDEFRAME) return 0; logpen.lopnStyle = pen->lopnStyle; logpen.lopnWidth.x = pen->lopnWidth.x;