gdi32: Fix CreateCompatibleDC to reject invalid DCs.

This commit is contained in:
Alexandre Julliard 2008-04-14 12:06:24 +02:00
parent 2004d2b2f6
commit 0482c8e818
2 changed files with 1 additions and 4 deletions

View File

@ -785,6 +785,7 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
release_dc_ptr( origDC );
if (funcs) funcs = DRIVER_get_driver( funcs );
}
else if (hdc) return 0;
if (!funcs && !(funcs = DRIVER_load_driver( displayW ))) return 0;

View File

@ -248,15 +248,11 @@ static void test_CreateCompatibleDC(void)
bRet = DeleteDC(hDC);
ok(bRet == TRUE, "DeleteDC returned %u\n", bRet);
todo_wine
{
/* Try to create a DC compatible to the deleted DC. This has to fail */
hNewDC = CreateCompatibleDC(hDC);
ok(hNewDC == NULL, "CreateCompatibleDC returned %p\n", hNewDC);
}
}
START_TEST(dc)
{
test_savedc();