From 74d62bccabfbe3639264d9be34420fe7ba8ddc93 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 24 Nov 2008 14:12:39 -0600 Subject: [PATCH] gdiplus: Implement GdipGetRegionHRgn for infinite regions. --- dlls/gdiplus/region.c | 19 ++++++++++++++++--- dlls/gdiplus/tests/region.c | 8 ++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 5d8098b8631..ac7a20b1b59 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -768,18 +768,31 @@ GpStatus WINGDIPAPI GdipGetRegionDataSize(GpRegion *region, UINT *needed) return Ok; } +static GpStatus get_region_hrgn(struct region_element *element, GpGraphics *graphics, HRGN *hrgn) +{ + switch (element->type) + { + case RegionDataInfiniteRect: + *hrgn = NULL; + return Ok; + default: + FIXME("GdipGetRegionHRgn unimplemented for region type=%x\n", element->type); + *hrgn = NULL; + return NotImplemented; + } +} + /***************************************************************************** * GdipGetRegionHRgn [GDIPLUS.@] */ GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *region, GpGraphics *graphics, HRGN *hrgn) { - FIXME("(%p, %p, %p): stub\n", region, graphics, hrgn); + TRACE("(%p, %p, %p)\n", region, graphics, hrgn); if (!region || !hrgn) return InvalidParameter; - *hrgn = NULL; - return NotImplemented; + return get_region_hrgn(®ion->node, graphics, hrgn); } GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *region, GpGraphics *graphics, BOOL *res) diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 2bf4416861e..90dfc243e84 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -762,14 +762,14 @@ static void test_gethrgn(void) status = GdipGetRegionHRgn(region, graphics, NULL); ok(status == InvalidParameter, "status %08x\n", status); - hrgn = NULL; status = GdipGetRegionHRgn(region, NULL, &hrgn); - todo_wine ok(status == Ok, "status %08x\n", status); + ok(status == Ok, "status %08x\n", status); + ok(hrgn == NULL, "hrgn=%p\n", hrgn); DeleteObject(hrgn); - hrgn = NULL; status = GdipGetRegionHRgn(region, graphics, &hrgn); - todo_wine ok(status == Ok, "status %08x\n", status); + ok(status == Ok, "status %08x\n", status); + ok(hrgn == NULL, "hrgn=%p\n", hrgn); DeleteObject(hrgn); status = GdipDeleteRegion(region); -- 2.11.4.GIT