Alexandre Julliard : gdi32: Fix the contents of the region data in metafiles.

Alexandre Julliard julliard at winehq.org
Mon Jun 18 15:00:23 CDT 2012


Module: wine
Branch: master
Commit: b61925e1eaa729705236ba7044e6af59b19fe456
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b61925e1eaa729705236ba7044e6af59b19fe456

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jun 18 10:54:20 2012 +0200

gdi32: Fix the contents of the region data in metafiles.

---

 dlls/gdi32/mfdrv/graphics.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/gdi32/mfdrv/graphics.c b/dlls/gdi32/mfdrv/graphics.c
index 665926b..439fca5 100644
--- a/dlls/gdi32/mfdrv/graphics.c
+++ b/dlls/gdi32/mfdrv/graphics.c
@@ -309,13 +309,21 @@ static INT16 MFDRV_CreateRegion(PHYSDEV dev, HRGN hrgn)
 	    *Param++ = pCurRect->right;
 	}
     }
-    len = Param - (WORD *)mr;
+
+    if (StartBand)
+    {
+        *StartBand = Param - StartBand - 3;
+        *Param++ = *StartBand;
+        if(*StartBand > MaxBands)
+            MaxBands = *StartBand;
+        Bands++;
+    }
 
     mr->rdParm[0] = 0;
     mr->rdParm[1] = 6;
     mr->rdParm[2] = 0x1234;
     mr->rdParm[3] = 0;
-    mr->rdParm[4] = len * 2;
+    mr->rdParm[4] = (Param - mr->rdParm) * sizeof(WORD);
     mr->rdParm[5] = Bands;
     mr->rdParm[6] = MaxBands;
     mr->rdParm[7] = rgndata->rdh.rcBound.left;
@@ -323,7 +331,7 @@ static INT16 MFDRV_CreateRegion(PHYSDEV dev, HRGN hrgn)
     mr->rdParm[9] = rgndata->rdh.rcBound.right;
     mr->rdParm[10] = rgndata->rdh.rcBound.bottom;
     mr->rdFunction = META_CREATEREGION;
-    mr->rdSize = len / 2;
+    mr->rdSize = Param - (WORD *)mr;
     ret = MFDRV_WriteRecord( dev, mr, mr->rdSize * 2 );
     HeapFree( GetProcessHeap(), 0, mr );
     HeapFree( GetProcessHeap(), 0, rgndata );




More information about the wine-cvs mailing list