Commit 7e54db23 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32/tests: Fix a couple of tests failing on NT4.

parent ea39761d
......@@ -328,7 +328,8 @@ static void testLoadLibraryEx(void)
{
ok(hmodule == 0, "Expected 0, got %p\n", hmodule);
}
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
broken(GetLastError() == ERROR_INVALID_HANDLE), /* nt4 */
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
}
......
......@@ -270,6 +270,7 @@ static void test_VirtualAlloc(void)
static void test_MapViewOfFile(void)
{
static const char testfile[] = "testfile.xxx";
const char *name;
HANDLE file, mapping;
void *ptr, *ptr2;
MEMORY_BASIC_INFORMATION info;
......@@ -450,11 +451,18 @@ static void test_MapViewOfFile(void)
DeleteFileA( testfile );
SetLastError(0xdeadbeef);
file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "Local\\Foo");
name = "Local\\Foo";
file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, name );
/* nt4 doesn't have Local\\ */
if (!file && GetLastError() == ERROR_PATH_NOT_FOUND)
{
name = "Foo";
file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, name );
}
ok( file != 0, "CreateFileMapping PAGE_READWRITE error %u\n", GetLastError() );
SetLastError(0xdeadbeef);
mapping = OpenFileMapping( FILE_MAP_READ, FALSE, "Local\\Foo" );
mapping = OpenFileMapping( FILE_MAP_READ, FALSE, name );
ok( mapping != 0, "OpenFileMapping FILE_MAP_READ error %u\n", GetLastError() );
SetLastError(0xdeadbeef);
ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 );
......@@ -476,7 +484,7 @@ todo_wine ok( info.Protect == PAGE_READONLY, "%x != PAGE_READONLY\n", info.Prote
CloseHandle( mapping );
SetLastError(0xdeadbeef);
mapping = OpenFileMapping( FILE_MAP_WRITE, FALSE, "Local\\Foo" );
mapping = OpenFileMapping( FILE_MAP_WRITE, FALSE, name );
ok( mapping != 0, "OpenFileMapping FILE_MAP_WRITE error %u\n", GetLastError() );
SetLastError(0xdeadbeef);
ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 );
......
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