Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- v2: Use GetDeviceCaps(hdc, TECHNOLOGY) to check for deleted DCs.
dlls/gdi32/tests/dc.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/gdi32/tests/dc.c b/dlls/gdi32/tests/dc.c index 2d9ef1dd88..49ee708688 100644 --- a/dlls/gdi32/tests/dc.c +++ b/dlls/gdi32/tests/dc.c @@ -733,8 +733,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); ret = DeleteDC(hdc); ok(ret, "DeleteDC failed\n"); - ret = GetObjectType(hdc); - ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + ret = GetDeviceCaps(hdc, TECHNOLOGY); + ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
hdc = GetWindowDC(hwnd); ok(hdc != 0, "GetDC failed\n"); @@ -742,8 +742,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); ret = DeleteDC(hdc); ok(ret, "DeleteDC failed\n"); - ret = GetObjectType(hdc); - ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + ret = GetDeviceCaps(hdc, TECHNOLOGY); + ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
DestroyWindow(hwnd);
@@ -757,8 +757,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); ret = DeleteDC(hdc); ok(ret, "DeleteDC failed\n"); - ret = GetObjectType(hdc); - ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + ret = GetDeviceCaps(hdc, TECHNOLOGY); + ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
hdc = GetWindowDC(hwnd); ok(hdc != 0, "GetDC failed\n"); @@ -766,8 +766,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); ret = DeleteDC(hdc); ok(ret, "DeleteDC failed\n"); - ret = GetObjectType(hdc); - ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + ret = GetDeviceCaps(hdc, TECHNOLOGY); + ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
/* CS_CLASSDC */ memset(&cls, 0, sizeof(cls)); @@ -804,8 +804,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); ret = DeleteDC(hdc); ok(ret, "DeleteDC failed\n"); - ret = GetObjectType(hdc); - ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + ret = GetDeviceCaps(hdc, TECHNOLOGY); + ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
DestroyWindow(hwnd);
@@ -815,8 +815,8 @@ static void test_DeleteDC(void) ret = UnregisterClassA("Wine class DC", GetModuleHandleA(NULL)); ok(ret, "UnregisterClassA failed\n");
- ret = GetObjectType(hdc_test); - ok(!ret, "GetObjectType should fail for a deleted DC\n"); + ret = GetDeviceCaps(hdc_test, TECHNOLOGY); + ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
/* CS_OWNDC */ memset(&cls, 0, sizeof(cls)); @@ -851,8 +851,8 @@ static void test_DeleteDC(void) ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); ret = DeleteDC(hdc); ok(ret, "DeleteDC failed\n"); - ret = GetObjectType(hdc); - ok(!ret || broken(ret) /* win9x */, "GetObjectType should fail for a deleted DC\n"); + ret = GetDeviceCaps(hdc, TECHNOLOGY); + ok(!ret, "GetDeviceCaps should fail for a deleted DC\n");
DestroyWindow(hwnd);