diff --git a/dlls/gdi/clipping.c b/dlls/gdi/clipping.c index 19e0ad2e173..8ec360b839d 100644 --- a/dlls/gdi/clipping.c +++ b/dlls/gdi/clipping.c @@ -566,6 +566,8 @@ INT WINAPI GetRandomRgn(HDC hDC, HRGN hRgn, INT iCode) break; case 3: rgn = dc->hMetaClipRgn; + if(!rgn) rgn = dc->hClipRgn; + if(!rgn) rgn = dc->hMetaRgn; break; case SYSRGN: /* == 4 */ rgn = dc->hVisRgn; diff --git a/dlls/gdi/tests/clipping.c b/dlls/gdi/tests/clipping.c index 6156feecf8f..23b43f0b27b 100644 --- a/dlls/gdi/tests/clipping.c +++ b/dlls/gdi/tests/clipping.c @@ -58,11 +58,8 @@ static void test_GetRandomRgn(void) ret = GetRandomRgn(hdc, hrgn, 2); ok(ret == 0, "GetRandomRgn rets %d\n", ret); - todo_wine - { - ret = GetRandomRgn(hdc, hrgn, 3); - ok(ret != 0, "GetRandomRgn rets %d\n", ret); - } + ret = GetRandomRgn(hdc, hrgn, 3); + ok(ret != 0, "GetRandomRgn rets %d\n", ret); GetRgnBox(hrgn, &ret_rc); ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %ld,%ld - %ld,%ld\n", ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom); @@ -78,11 +75,8 @@ static void test_GetRandomRgn(void) ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %ld,%ld - %ld,%ld\n", ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom); - todo_wine - { - ret = GetRandomRgn(hdc, hrgn, 3); - ok(ret != 0, "GetRandomRgn rets %d\n", ret); - } + ret = GetRandomRgn(hdc, hrgn, 3); + ok(ret != 0, "GetRandomRgn rets %d\n", ret); GetRgnBox(hrgn, &ret_rc); ok(EqualRect(&rc, &ret_rc), "GetRandomRgn %ld,%ld - %ld,%ld\n", ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom);