[PATCH] ddraw/tests: Do not crash, when CreateSurface failed

Detlef Riekenberg wine.dev at web.de
Sat Oct 13 18:57:53 CDT 2012


Needed to avoid a crash on an Intel integrated graphics.
http://test.winehq.org/data/ee59341721b90e58165a7bb12cbf2906fbd680d1/xp_dr-xp-sigi/ddraw:dsurface.html

--
By by ... Detlef
---
 dlls/ddraw/tests/dsurface.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c
index e3cd085..666bb41 100644
--- a/dlls/ddraw/tests/dsurface.c
+++ b/dlls/ddraw/tests/dsurface.c
@@ -4382,7 +4382,14 @@ static void set_surface_desc_test(void)
     ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY;
 
     hr = IDirectDraw_CreateSurface(lpDD, &ddsd, &surface, NULL);
-    ok(SUCCEEDED(hr), "CreateSurface failed, hr %#x.\n", hr);
+
+    if (hr == DDERR_INVALIDPIXELFORMAT)
+        skip("pixel format not supported\n");
+    else
+        ok(SUCCEEDED(hr), "CreateSurface failed, hr %#x.\n", hr);
+
+    if (!SUCCEEDED(hr))
+            return;
 
     hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **) &surface3);
     ok(SUCCEEDED(hr), "QueryInterface failed, hr %#x.\n", hr);
-- 
1.7.5.4




More information about the wine-patches mailing list