[Gdiplus 14/15] Implement GdipDeleteRegion

Adam Petaccia adam at tpetaccia.com
Wed Jul 9 02:34:10 CDT 2008


---
 dlls/gdiplus/region.c       |   12 ++++++++++--
 dlls/gdiplus/tests/region.c |    2 +-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c
index 04a1598..c154352 100644
--- a/dlls/gdiplus/region.c
+++ b/dlls/gdiplus/region.c
@@ -208,8 +208,16 @@ GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region)
 
 GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
 {
-    FIXME("(%p): stub\n", region);
-    return NotImplemented;
+    if (!region)
+        return InvalidParameter;
+
+    TRACE("%p\n", region);
+
+    GdipFree(region->outline.pathdata.Points);
+    GdipFree(region->outline.pathdata.Types);
+    GdipFree(region);
+
+    return Ok;
 }
 
 GpStatus WINGDIPAPI GdipFillRegion(GpGraphics* graphics, GpBrush* brush,
diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c
index 5706b99..1953a8d 100644
--- a/dlls/gdiplus/tests/region.c
+++ b/dlls/gdiplus/tests/region.c
@@ -237,9 +237,9 @@ todo_wine
     ok(rect.Y == 7, "Expected 7 for Y, got %f\n", rect.Y);
     ok(rect.Width == 10, "Expected a width of 10, got %f\n", rect.Width);
     ok(rect.Height == 20, "Expected a height of 20, got %f\n", rect.Height);
+}
     stat = GdipDeleteRegion(region);
     expect(Ok, stat);
-}
 
     stat = GdipCreatePath(FillModeAlternate, &path);
     expect(Ok, stat);
-- 
1.5.4.3




More information about the wine-patches mailing list