[gdi32] Correction to mfdrv support for ExtSelectClipRgn

Jean-Philippe_Theriault at cimmetry.com Jean-Philippe_Theriault at cimmetry.com
Thu Apr 20 16:05:04 CDT 2006

In the current implementation, each time we call MFDRV_ExtSelectClipRgn we
create a new
region and add it to the handles table. We select it, then write a delete
record. But the handle
is never removed from the handles table, so that the handle of all objects
created afterwards
will be shifted by one. This causes problem when rendering the metafile
afterwards using
EnumMetaProc, which assumes the handle is freed after deleting the object.

MFDRV_DeleteObject does all the necessary bookkeeping, and should be used
instead of

Index: dlls/gdi/mfdrv/graphics.c
RCS file: /home/wine/wine/dlls/gdi/mfdrv/graphics.c,v
retrieving revision 1.11
diff -u -p -r1.11 graphics.c
--- dlls/gdi/mfdrv/graphics.c 24 Mar 2005 21:01:38 -0000    1.11
+++ dlls/gdi/mfdrv/graphics.c 20 Apr 2006 20:54:21 -0000
@@ -420,7 +420,7 @@ INT MFDRV_ExtSelectClipRgn( PHYSDEV dev,
     iRgn = MFDRV_CreateRegion( dev, hrgn );
     if(iRgn == -1) return ERROR;
     ret = MFDRV_MetaParam1( dev, META_SELECTCLIPREGION, iRgn ) ?
-    MFDRV_MetaParam1( dev, META_DELETEOBJECT, iRgn );
+    MFDRV_DeleteObject(dev, iRgn);
     return ret;

More information about the wine-patches mailing list