[PATCH 3/3] Don't crash on older ddraw

Paul Vriens Paul.Vriens.Wine at gmail.com
Sat Oct 10 03:06:32 CDT 2009


---
 dlls/ddraw/tests/ddrawmodes.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/ddraw/tests/ddrawmodes.c b/dlls/ddraw/tests/ddrawmodes.c
index 7ea4d53..bd8bec7 100644
--- a/dlls/ddraw/tests/ddrawmodes.c
+++ b/dlls/ddraw/tests/ddrawmodes.c
@@ -149,9 +149,14 @@ static void test_DirectDrawEnumerateA(void)
     ret = pDirectDrawEnumerateA((LPDDENUMCALLBACKA)0xdeadbeef, NULL);
     ok(ret == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %d\n", ret);
 
-    /* Test with callback that crashes. */
-    ret = pDirectDrawEnumerateA(crash_callbackA, NULL);
-    ok(ret == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %d\n", ret);
+    if (pDirectDrawEnumerateExA)
+    {
+        /* Test with callback that crashes. */
+        ret = pDirectDrawEnumerateA(crash_callbackA, NULL);
+        ok(ret == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %d\n", ret);
+    }
+    else
+        win_skip("Test would crash on older ddraw\n");
 
     /* Test with valid callback parameter and NULL context parameter. */
     trace("Calling DirectDrawEnumerateA with test_nullcontext_callbackA callback and NULL context.\n");
@@ -185,7 +190,9 @@ static void test_DirectDrawEnumerateW(void)
 
     /* Test with NULL callback parameter. */
     ret = pDirectDrawEnumerateW(NULL, NULL);
-    ok(ret == DDERR_INVALIDPARAMS, "Expected DDERR_INVALIDPARAMS, got %d\n", ret);
+    ok(ret == DDERR_INVALIDPARAMS ||
+       ret == DDERR_UNSUPPORTED, /* Older ddraw */
+       "Expected DDERR_INVALIDPARAMS or DDERR_UNSUPPORTED, got %d\n", ret);
 
     /* Test with invalid callback parameter. */
     ret = pDirectDrawEnumerateW((LPDDENUMCALLBACKW)0xdeadbeef, NULL);
-- 
1.6.2.5


--------------090706050207040206010203--



More information about the wine-patches mailing list