From e98684ed8b034c5ef45ab793c1612771ff44bf52 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sat, 16 Oct 2021 11:16:43 -0500 Subject: [PATCH] [GDI32] Fix rectangle flag issues. Fix CORE-17815. Remove dumb dumb code breakers. --- win32ss/gdi/gdi32/objects/text.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/win32ss/gdi/gdi32/objects/text.c b/win32ss/gdi/gdi32/objects/text.c index 799c20f5f72..2a3831aff27 100644 --- a/win32ss/gdi/gdi32/objects/text.c +++ b/win32ss/gdi/gdi32/objects/text.c @@ -494,6 +494,22 @@ ExtTextOutW( { PDC_ATTR pdcattr; + // Need both, should return a parameter error? No they don't! + if ( !lpDx && fuOptions & ETO_PDY ) + return FALSE; + + // Now sorting out rectangle. + + // Here again, need both. + if ( lprc && !(fuOptions & (ETO_CLIPPED|ETO_OPAQUE)) ) + { + lprc = NULL; // No flags, no rectangle. + } + else if (!lprc) // No rectangle, force clear flags if set and continue. + { + fuOptions &= ~(ETO_CLIPPED|ETO_OPAQUE); + } + if ( !bBypassETOWMF ) { HANDLE_METADC(BOOL,