Paul Vriens : kernel32/tests: Don't crash on WinMe.

Alexandre Julliard julliard at winehq.org
Wed Oct 7 09:46:05 CDT 2009


Module: wine
Branch: master
Commit: 6d416e6934c707a6962cd48702e49da1b675cc6f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6d416e6934c707a6962cd48702e49da1b675cc6f

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Oct  7 12:05:00 2009 +0200

kernel32/tests: Don't crash on WinMe.

---

 dlls/kernel32/tests/module.c |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c
index 374a18e..4cb30a8 100644
--- a/dlls/kernel32/tests/module.c
+++ b/dlls/kernel32/tests/module.c
@@ -228,13 +228,18 @@ static void testLoadLibraryEx(void)
     ok(hfile != INVALID_HANDLE_VALUE, "Expected a valid file handle\n");
 
     /* NULL lpFileName */
-    SetLastError(0xdeadbeef);
-    hmodule = LoadLibraryExA(NULL, NULL, 0);
-    ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
-    ok(GetLastError() == ERROR_MOD_NOT_FOUND ||
-       GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */
-       "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n",
-       GetLastError());
+    if (is_unicode_enabled)
+    {
+        SetLastError(0xdeadbeef);
+        hmodule = LoadLibraryExA(NULL, NULL, 0);
+        ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
+        ok(GetLastError() == ERROR_MOD_NOT_FOUND ||
+           GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */
+           "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n",
+           GetLastError());
+    }
+    else
+        win_skip("NULL filename crashes on WinMe\n");
 
     /* empty lpFileName */
     SetLastError(0xdeadbeef);
@@ -281,13 +286,16 @@ static void testLoadLibraryEx(void)
     }
 
     /* lpFileName does not matter */
-    SetLastError(0xdeadbeef);
-    hmodule = LoadLibraryExA(NULL, hfile, 0);
-    ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
-    ok(GetLastError() == ERROR_MOD_NOT_FOUND ||
-       GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */
-       "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n",
-       GetLastError());
+    if (is_unicode_enabled)
+    {
+        SetLastError(0xdeadbeef);
+        hmodule = LoadLibraryExA(NULL, hfile, 0);
+        ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
+        ok(GetLastError() == ERROR_MOD_NOT_FOUND ||
+           GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */
+           "Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n",
+           GetLastError());
+    }
 
     CloseHandle(hfile);
 




More information about the wine-cvs mailing list