Commit fb9bca41 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdi32: Fix some DC leaks in gdi32 bitmap tests.

parent 5f23b94a
......@@ -411,7 +411,7 @@ static void test_dib_bits_access( HBITMAP hdib, void *bits )
char bmibuf[sizeof(BITMAPINFO) + 256 * sizeof(RGBQUAD)];
DWORD data[256];
BITMAPINFO *pbmi = (BITMAPINFO *)bmibuf;
HDC hdc = GetDC(0);
HDC hdc;
char filename[MAX_PATH];
HANDLE file;
DWORD written;
......@@ -435,11 +435,15 @@ static void test_dib_bits_access( HBITMAP hdib, void *bits )
pbmi->bmiHeader.biPlanes = 1;
pbmi->bmiHeader.biCompression = BI_RGB;
hdc = GetDC(0);
ret = SetDIBits( hdc, hdib, 0, 16, data, pbmi, DIB_RGB_COLORS );
ok(ret == 16 ||
broken(ret == 0), /* win9x */
"SetDIBits failed: expected 16 got %d\n", ret);
ReleaseDC(0, hdc);
ok(VirtualQuery(bits, &info, sizeof(info)) == sizeof(info),
"VirtualQuery failed\n");
ok(info.BaseAddress == bits, "%p != %p\n", info.BaseAddress, bits);
......@@ -864,8 +868,8 @@ static void test_dibsections(void)
DeleteObject(hdib);
DeleteObject(hpal);
DeleteDC(hdcmem);
DeleteDC(hdcmem2);
ReleaseDC(0, hdc);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment