[PATCH 2/2] Don't crash on Win95 and NT4

Paul Vriens Paul.Vriens.Wine at gmail.com
Fri Oct 9 14:32:27 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..dfcb6a1 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 Win95 and NT4\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, /* Win95 and NT4 */
+       "Expected DDERR_INVALIDPARAMS or DDERR_UNSUPPORTED, got %d\n", ret);
 
     /* Test with invalid callback parameter. */
     ret = pDirectDrawEnumerateW((LPDDENUMCALLBACKW)0xdeadbeef, NULL);
-- 
1.6.2.5


--------------030802080303020001090605--



More information about the wine-patches mailing list