Commit c3a58cc7 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

kernel32/tests: Fix a few tests on win9x.

parent a061f642
...@@ -223,7 +223,7 @@ static void testLoadLibraryEx(void) ...@@ -223,7 +223,7 @@ static void testLoadLibraryEx(void)
HANDLE hfile; HANDLE hfile;
hfile = CreateFileA("testfile.dll", GENERIC_READ | GENERIC_WRITE, hfile = CreateFileA("testfile.dll", GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
ok(hfile != INVALID_HANDLE_VALUE, "Expected a valid file handle\n"); ok(hfile != INVALID_HANDLE_VALUE, "Expected a valid file handle\n");
...@@ -231,24 +231,28 @@ static void testLoadLibraryEx(void) ...@@ -231,24 +231,28 @@ static void testLoadLibraryEx(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hmodule = LoadLibraryExA(NULL, NULL, 0); hmodule = LoadLibraryExA(NULL, NULL, 0);
ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
ok(GetLastError() == ERROR_MOD_NOT_FOUND, ok(GetLastError() == ERROR_MOD_NOT_FOUND ||
"Expected ERROR_MOD_NOT_FOUND, got %d\n", GetLastError()); GetLastError() == ERROR_INVALID_PARAMETER, /* win9x */
"Expected ERROR_MOD_NOT_FOUND or ERROR_INVALID_PARAMETER, got %d\n",
GetLastError());
/* empty lpFileName */ /* empty lpFileName */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hmodule = LoadLibraryExA("", NULL, 0); hmodule = LoadLibraryExA("", NULL, 0);
ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
ok(GetLastError() == ERROR_MOD_NOT_FOUND, ok(GetLastError() == ERROR_MOD_NOT_FOUND ||
"Expected ERROR_MOD_NOT_FOUND, got %d\n", GetLastError()); GetLastError() == ERROR_DLL_NOT_FOUND, /* win9x */
"Expected ERROR_MOD_NOT_FOUND or ERROR_DLL_NOT_FOUND, got %d\n",
GetLastError());
/* hFile is non-NULL */ /* hFile is non-NULL */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
hmodule = LoadLibraryExA("testfile.dll", hfile, 0); hmodule = LoadLibraryExA("testfile.dll", hfile, 0);
ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
ok(GetLastError() == ERROR_SHARING_VIOLATION || ok(GetLastError() == ERROR_SHARING_VIOLATION ||
GetLastError() == ERROR_INVALID_PARAMETER, /* win2k3 */ GetLastError() == ERROR_INVALID_PARAMETER || /* win2k3 */
"Expected ERROR_SHARING_VIOLATION or ERROR_INVALID_PARAMETER, got %d\n", GetLastError() == ERROR_FILE_NOT_FOUND, /* win9x */
GetLastError()); "Unexpected last error, got %d\n", GetLastError());
/* try to open a file that is locked */ /* try to open a file that is locked */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -256,8 +260,10 @@ static void testLoadLibraryEx(void) ...@@ -256,8 +260,10 @@ static void testLoadLibraryEx(void)
ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
todo_wine todo_wine
{ {
ok(GetLastError() == ERROR_SHARING_VIOLATION, ok(GetLastError() == ERROR_SHARING_VIOLATION ||
"Expected ERROR_SHARING_VIOLATION, got %d\n", GetLastError()); GetLastError() == ERROR_FILE_NOT_FOUND, /* win9x */
"Expected ERROR_SHARING_VIOLATION or ERROR_FILE_NOT_FOUND, got %d\n",
GetLastError());
} }
/* lpFileName does not matter */ /* lpFileName does not matter */
...@@ -277,8 +283,10 @@ static void testLoadLibraryEx(void) ...@@ -277,8 +283,10 @@ static void testLoadLibraryEx(void)
ok(hmodule == 0, "Expected 0, got %p\n", hmodule); ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
todo_wine todo_wine
{ {
ok(GetLastError() == ERROR_FILE_INVALID, ok(GetLastError() == ERROR_FILE_INVALID ||
"Expected ERROR_FILE_INVALID, got %d\n", GetLastError()); GetLastError() == ERROR_BAD_FORMAT, /* win9x */
"Expected ERROR_FILE_INVALID or ERROR_BAD_FORMAT, got %d\n",
GetLastError());
} }
DeleteFileA("testfile.dll"); DeleteFileA("testfile.dll");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment