https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a022dc8eaf2becb1659823623369abebccfc7c42

commit a022dc8eaf2becb1659823623369abebccfc7c42
Author:     James Tabor <[email protected]>
AuthorDate: Mon Sep 6 18:37:24 2021 -0500
Commit:     James Tabor <[email protected]>
CommitDate: Mon Sep 6 18:37:24 2021 -0500

    [GDI32] Fix Meta file packing recursion issues.
    
    TextOut was looping back adding additional EMR packet to the meta file.
---
 win32ss/gdi/gdi32/objects/text.c | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/win32ss/gdi/gdi32/objects/text.c b/win32ss/gdi/gdi32/objects/text.c
index e00e01e50fe..9a08ec56d16 100644
--- a/win32ss/gdi/gdi32/objects/text.c
+++ b/win32ss/gdi/gdi32/objects/text.c
@@ -475,6 +475,7 @@ ExtTextOutA(
     return ret;
 }
 
+static BOOL bBypassETOWMF = FALSE;
 
 /*
  * @implemented
@@ -493,25 +494,34 @@ ExtTextOutW(
 {
     PDC_ATTR pdcattr;
 
-    HANDLE_METADC(BOOL,
-                  ExtTextOut,
-                  FALSE,
-                  hdc,
-                  x,
-                  y,
-                  fuOptions,
-                  lprc,
-                  lpString,
-                  cwc,
-                  lpDx);
+    if ( !bBypassETOWMF )
+    {
+        HANDLE_METADC(BOOL,
+                      ExtTextOut,
+                      FALSE,
+                      hdc,
+                      x,
+                      y,
+                      fuOptions,
+                      lprc,
+                      lpString,
+                      cwc,
+                      lpDx);
+    }
 
     if ( GdiConvertAndCheckDC(hdc) == NULL ) return FALSE;
 
     if (!(fuOptions & (ETO_GLYPH_INDEX | ETO_IGNORELANGUAGE)))
     {
+        bBypassETOWMF = TRUE;
+
         if (LoadLPK(LPK_ETO))
             return LpkExtTextOut(hdc, x, y, fuOptions, lprc, lpString, cwc , 
lpDx, 0);
     }
+    else
+    {
+        bBypassETOWMF = FALSE;
+    }
 
     /* Get the DC attribute */
     pdcattr = GdiGetDcAttr(hdc);

Reply via email to