From: Stefan Dösinger Subject: [PATCH 2/5] ddraw/tests: Overlays are broken on Windows 10. Message-Id: <1465163818-18652-2-git-send-email-stefandoesinger@gmx.at> Date: Sun, 5 Jun 2016 22:56:55 +0100 In-Reply-To: <1465163818-18652-1-git-send-email-stefandoesinger@gmx.at> References: <1465163818-18652-1-git-send-email-stefandoesinger@gmx.at> Signed-off-by: Stefan Dösinger --- dlls/ddraw/tests/ddraw1.c | 20 ++++++++++++++++---- dlls/ddraw/tests/ddraw2.c | 21 +++++++++++++++++---- dlls/ddraw/tests/ddraw4.c | 15 ++++++++++++--- dlls/ddraw/tests/ddraw7.c | 15 ++++++++++++--- 4 files changed, 57 insertions(+), 14 deletions(-) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index bfb8ec5..5c0501e 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -8421,7 +8421,10 @@ static void test_offscreen_overlay(void) /* On Windows 7, and probably Vista, UpdateOverlay() will return * DDERR_OUTOFCAPS if the dwm is active. Calling GetDC() on the primary - * surface prevents this by disabling the dwm. */ + * surface prevents this by disabling the dwm. + * + * This no longer works on Windows 10, and presumably 8. Compositing + * cannot be disabled. */ hr = IDirectDrawSurface_GetDC(primary, &dc); ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); hr = IDirectDrawSurface_ReleaseDC(primary, dc); @@ -8451,7 +8454,7 @@ static void test_offscreen_overlay(void) ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, offscreen, NULL, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS), "Failed to update overlay, hr %#x.\n", hr); /* Try to overlay the primary with a non-overlay surface. */ hr = IDirectDrawSurface_UpdateOverlay(offscreen, NULL, primary, NULL, DDOVER_SHOW, NULL); @@ -8500,7 +8503,10 @@ static void test_overlay_rect(void) /* On Windows 7, and probably Vista, UpdateOverlay() will return * DDERR_OUTOFCAPS if the dwm is active. Calling GetDC() on the primary - * surface prevents this by disabling the dwm. */ + * surface prevents this by disabling the dwm. + * + * This no longer works on Windows 10, and presumably 8. Compositing + * cannot be disabled. */ hr = IDirectDrawSurface_GetDC(primary, &dc); ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); hr = IDirectDrawSurface_ReleaseDC(primary, dc); @@ -8510,7 +8516,12 @@ static void test_overlay_rect(void) * used. This is not true in Windows Vista and earlier, but changed in * Windows 7. */ hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, &rect, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS), "Failed to update overlay, hr %#x.\n", hr); + if (FAILED(hr)) + { + skip("Overlays do not work, skipping overlay test.\n"); + goto release; + } hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_HIDE, NULL); ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_SHOW, NULL); @@ -8553,6 +8564,7 @@ static void test_overlay_rect(void) ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y); +release: IDirectDrawSurface_Release(primary); IDirectDrawSurface_Release(overlay); done: diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 9cca986..a3acf25 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -9536,7 +9536,10 @@ static void test_offscreen_overlay(void) /* On Windows 7, and probably Vista, UpdateOverlay() will return * DDERR_OUTOFCAPS if the dwm is active. Calling GetDC() on the primary - * surface prevents this by disabling the dwm. */ + * surface prevents this by disabling the dwm. + * + * This no longer works on Windows 10, and presumably 8. Compositing + * cannot be disabled. */ hr = IDirectDrawSurface_GetDC(primary, &dc); ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); hr = IDirectDrawSurface_ReleaseDC(primary, dc); @@ -9566,7 +9569,8 @@ static void test_offscreen_overlay(void) ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, offscreen, NULL, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + /* Overlays are broken on Windows 10, can't disable DWM. */ + ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS), "Failed to update overlay, hr %#x.\n", hr); /* Try to overlay the primary with a non-overlay surface. */ hr = IDirectDrawSurface_UpdateOverlay(offscreen, NULL, primary, NULL, DDOVER_SHOW, NULL); @@ -9615,7 +9619,10 @@ static void test_overlay_rect(void) /* On Windows 7, and probably Vista, UpdateOverlay() will return * DDERR_OUTOFCAPS if the dwm is active. Calling GetDC() on the primary - * surface prevents this by disabling the dwm. */ + * surface prevents this by disabling the dwm. + * + * This no longer works on Windows 10, and presumably 8. Compositing + * cannot be disabled. */ hr = IDirectDrawSurface_GetDC(primary, &dc); ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); hr = IDirectDrawSurface_ReleaseDC(primary, dc); @@ -9625,7 +9632,12 @@ static void test_overlay_rect(void) * used. This is not true in Windows Vista and earlier, but changed in * Windows 7. */ hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, &rect, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS), "Failed to update overlay, hr %#x.\n", hr); + if (FAILED(hr)) + { + skip("Overlays do not work, skipping overlay test.\n"); + goto release; + } hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_HIDE, NULL); ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); hr = IDirectDrawSurface_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_SHOW, NULL); @@ -9668,6 +9680,7 @@ static void test_overlay_rect(void) ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y); +release: IDirectDrawSurface_Release(primary); IDirectDrawSurface_Release(overlay); done: diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 4ee5de2..037c439 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -10711,7 +10711,10 @@ static void test_offscreen_overlay(void) /* On Windows 7, and probably Vista, UpdateOverlay() will return * DDERR_OUTOFCAPS if the dwm is active. Calling GetDC() on the primary - * surface prevents this by disabling the dwm. */ + * surface prevents this by disabling the dwm. + * + * This no longer works on Windows 10, and presumably 8. Compositing + * cannot be disabled. */ hr = IDirectDrawSurface4_GetDC(primary, &dc); ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); hr = IDirectDrawSurface4_ReleaseDC(primary, dc); @@ -10741,7 +10744,7 @@ static void test_offscreen_overlay(void) ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); hr = IDirectDrawSurface4_UpdateOverlay(overlay, NULL, offscreen, NULL, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS), "Failed to update overlay, hr %#x.\n", hr); /* Try to overlay the primary with a non-overlay surface. */ hr = IDirectDrawSurface4_UpdateOverlay(offscreen, NULL, primary, NULL, DDOVER_SHOW, NULL); @@ -10800,7 +10803,12 @@ static void test_overlay_rect(void) * used. This is not true in Windows Vista and earlier, but changed in * Windows 7. */ hr = IDirectDrawSurface4_UpdateOverlay(overlay, NULL, primary, &rect, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS), "Failed to update overlay, hr %#x.\n", hr); + if (FAILED(hr)) + { + skip("Overlays do not work, skipping overlay test.\n"); + goto release; + } hr = IDirectDrawSurface4_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_HIDE, NULL); ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); hr = IDirectDrawSurface4_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_SHOW, NULL); @@ -10843,6 +10851,7 @@ static void test_overlay_rect(void) ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y); +release: IDirectDrawSurface4_Release(primary); IDirectDrawSurface4_Release(overlay); done: diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index aa7f9f8..975d8b9 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -11036,7 +11036,10 @@ static void test_offscreen_overlay(void) /* On Windows 7, and probably Vista, UpdateOverlay() will return * DDERR_OUTOFCAPS if the dwm is active. Calling GetDC() on the primary - * surface prevents this by disabling the dwm. */ + * surface prevents this by disabling the dwm. + * + * This no longer works on Windows 10, and presumably 8. Compositing + * cannot be disabled. */ hr = IDirectDrawSurface7_GetDC(primary, &dc); ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); hr = IDirectDrawSurface7_ReleaseDC(primary, dc); @@ -11066,7 +11069,7 @@ static void test_offscreen_overlay(void) ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr); hr = IDirectDrawSurface7_UpdateOverlay(overlay, NULL, offscreen, NULL, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS), "Failed to update overlay, hr %#x.\n", hr); /* Try to overlay the primary with a non-overlay surface. */ hr = IDirectDrawSurface7_UpdateOverlay(offscreen, NULL, primary, NULL, DDOVER_SHOW, NULL); @@ -11125,7 +11128,12 @@ static void test_overlay_rect(void) * used. This is not true in Windows Vista and earlier, but changed in * Windows 7. */ hr = IDirectDrawSurface7_UpdateOverlay(overlay, NULL, primary, &rect, DDOVER_SHOW, NULL); - ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); + ok(SUCCEEDED(hr) || broken(hr == DDERR_OUTOFCAPS), "Failed to update overlay, hr %#x.\n", hr); + if (FAILED(hr)) + { + skip("Overlays do not work, skipping overlay test.\n"); + goto release; + } hr = IDirectDrawSurface7_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_HIDE, NULL); ok(SUCCEEDED(hr), "Failed to update overlay, hr %#x.\n", hr); hr = IDirectDrawSurface7_UpdateOverlay(overlay, NULL, primary, NULL, DDOVER_SHOW, NULL); @@ -11168,6 +11176,7 @@ static void test_overlay_rect(void) ok(!pos_x, "Got unexpected pos_x %d.\n", pos_x); ok(!pos_y, "Got unexpected pos_y %d.\n", pos_y); +release: IDirectDrawSurface7_Release(primary); IDirectDrawSurface7_Release(overlay); done: -- 2.7.3