[PATCH 2/5] ddraw/tests: Overlays are broken on Windows 10.

Stefan Dösinger stefandoesinger at gmx.at
Sun Jun 5 13:45:13 CDT 2016


Signed-off-by: Stefan Dösinger <stefandoesinger at gmx.at>
---
 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 96bc479..954123d 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -8399,7 +8399,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);
@@ -8429,7 +8432,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);
@@ -8478,7 +8481,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);
@@ -8488,7 +8494,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);
@@ -8531,6 +8542,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 ab66159..f0cb241 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -9514,7 +9514,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);
@@ -9544,7 +9547,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);
@@ -9593,7 +9597,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);
@@ -9603,7 +9610,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);
@@ -9646,6 +9658,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 4c98568..0877437 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -10688,7 +10688,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);
@@ -10718,7 +10721,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);
@@ -10777,7 +10780,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);
@@ -10820,6 +10828,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 afa424c..3c7a736 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -11014,7 +11014,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);
@@ -11044,7 +11047,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);
@@ -11103,7 +11106,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);
@@ -11146,6 +11154,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




More information about the wine-patches mailing list