Skip to content

Commit 4671aaa

Browse files
committed
[WIN32U_APITEST] Try to fix NtGdiExtSelectClipRgn test
1 parent 6529244 commit 4671aaa

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

modules/rostests/apitests/win32u/ntgdi/NtGdiExtSelectClipRgn.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ START_TEST(NtGdiExtSelectClipRgn)
1111
{
1212
HRGN hRgnDest, hRgn1, hRgn2;
1313
HDC hdc;
14+
HBITMAP hbm;
1415
// test what params are accepted for what operations
1516
// 0? invalid? are params maybe ignored in some cases?
1617
// LastError
@@ -20,7 +21,9 @@ START_TEST(NtGdiExtSelectClipRgn)
2021
hRgn1 = CreateRectRgn(1,1,4,4);
2122
hRgn2 = CreateRectRgn(2,2,6,3);
2223

23-
hdc = GetDC(NULL);
24+
hdc = CreateCompatibleDC(NULL);
25+
hbm = CreateCompatibleBitmap(hdc, 10, 10);
26+
SelectObject(hdc, hbm);
2427

2528
/* RGN_AND = 1, RGN_OR = 2, RGN_XOR = 3, RGN_DIFF = 4, RGN_COPY = 5 */
2629

@@ -54,4 +57,7 @@ START_TEST(NtGdiExtSelectClipRgn)
5457
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_AND), ERROR);
5558
ok_long(GetLastError(), 0xDEADFACE);
5659
ok_int(NtGdiExtSelectClipRgn(hdc, NULL, RGN_COPY), SIMPLEREGION);
60+
61+
DeleteDC(hdc);
62+
DeleteObject(hbm);
5763
}

0 commit comments

Comments
 (0)