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

This commit is contained in:
Alexandre Julliard 2008-09-19 14:03:40 +02:00
parent ea39761d3a
commit 7e54db23e9
2 changed files with 13 additions and 4 deletions

View File

@ -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());
}

View File

@ -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 );