Commit 187f50aa authored by Austin English's avatar Austin English Committed by Alexandre Julliard

kernel32/tests: Remove win9x hacks.

parent 907f94e1
...@@ -111,16 +111,6 @@ static void test_null_source(void) ...@@ -111,16 +111,6 @@ static void test_null_source(void)
len, GLE); len, GLE);
} }
/* lstrcmpW is not supported on Win9x! */
static int mylstrcmpW(const WCHAR* str1, const WCHAR* str2)
{
while (*str1 && *str1==*str2) {
str1++;
str2++;
}
return *str1-*str2;
}
static void test_negative_source_length(void) static void test_negative_source_length(void)
{ {
int len; int len;
...@@ -139,7 +129,7 @@ static void test_negative_source_length(void) ...@@ -139,7 +129,7 @@ static void test_negative_source_length(void)
SetLastError( 0xdeadbeef ); SetLastError( 0xdeadbeef );
memset(bufW,'x',sizeof(bufW)); memset(bufW,'x',sizeof(bufW));
len = MultiByteToWideChar(CP_ACP, 0, "foobar", -2002, bufW, 10); len = MultiByteToWideChar(CP_ACP, 0, "foobar", -2002, bufW, 10);
ok(len == 7 && !mylstrcmpW(bufW, foobarW) && GetLastError() == 0xdeadbeef, ok(len == 7 && !lstrcmpW(bufW, foobarW) && GetLastError() == 0xdeadbeef,
"MultiByteToWideChar(-2002): len=%d error=%u\n", len, GetLastError()); "MultiByteToWideChar(-2002): len=%d error=%u\n", len, GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
......
...@@ -63,11 +63,6 @@ static void test_GetDriveTypeW(void) ...@@ -63,11 +63,6 @@ static void test_GetDriveTypeW(void)
for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++) for (drive[0] = 'A'; drive[0] <= 'Z'; drive[0]++)
{ {
type = GetDriveTypeW(drive); type = GetDriveTypeW(drive);
if (type == DRIVE_UNKNOWN && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("GetDriveTypeW is not available on Win9x\n");
return;
}
ok(type > DRIVE_UNKNOWN && type <= DRIVE_RAMDISK, ok(type > DRIVE_UNKNOWN && type <= DRIVE_RAMDISK,
"not a valid drive %c: type %u\n", drive[0], type); "not a valid drive %c: type %u\n", drive[0], type);
......
...@@ -476,9 +476,7 @@ static void test_message_from_string(void) ...@@ -476,9 +476,7 @@ static void test_message_from_string(void)
memcpy(out, init_buf, sizeof(init_buf)); memcpy(out, init_buf, sizeof(init_buf));
r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "", 0, r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "", 0,
0, out, sizeof(out)/sizeof(CHAR), NULL); 0, out, sizeof(out)/sizeof(CHAR), NULL);
ok(!memcmp(out, init_buf, sizeof(init_buf)) || ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the buffer to be untouched\n");
broken(!strcmp("", out)), /* Win9x */
"Expected the buffer to be untouched\n");
ok(r==0, "succeeded: r=%d\n", r); ok(r==0, "succeeded: r=%d\n", r);
ok(GetLastError()==0xdeadbeef, ok(GetLastError()==0xdeadbeef,
"last error %u\n", GetLastError()); "last error %u\n", GetLastError());
...@@ -510,29 +508,17 @@ static void test_message_from_string(void) ...@@ -510,29 +508,17 @@ static void test_message_from_string(void)
memcpy(out, init_buf, sizeof(init_buf)); memcpy(out, init_buf, sizeof(init_buf));
r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "%1", 0, r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING, "%1", 0,
0, out, sizeof(out)/sizeof(CHAR), NULL); 0, out, sizeof(out)/sizeof(CHAR), NULL);
ok(!memcmp(out, init_buf, sizeof(init_buf)) || ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the buffer to be untouched\n");
broken(!strcmp("%1", out)), /* Win9x */ ok(r==0, "succeeded: r=%d\n", r);
"Expected the buffer to be untouched\n"); ok(GetLastError()==ERROR_INVALID_PARAMETER, "last error %u\n", GetLastError());
ok(r==0 ||
broken(r==2), /* Win9x */
"succeeded: r=%d\n", r);
ok(GetLastError()==ERROR_INVALID_PARAMETER ||
broken(GetLastError()==0xdeadbeef), /* Win9x */
"last error %u\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
memcpy(out, init_buf, sizeof(init_buf)); memcpy(out, init_buf, sizeof(init_buf));
r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, "%1", 0, r = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ARGUMENT_ARRAY, "%1", 0,
0, out, sizeof(out)/sizeof(CHAR), NULL); 0, out, sizeof(out)/sizeof(CHAR), NULL);
ok(!memcmp(out, init_buf, sizeof(init_buf)) || ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the buffer to be untouched\n");
broken(!strcmp("%1", out)), /* Win9x */ ok(r==0, "succeeded: r=%d\n", r);
"Expected the buffer to be untouched\n"); ok(GetLastError()==ERROR_INVALID_PARAMETER, "last error %u\n", GetLastError());
ok(r==0 ||
broken(r==2), /* Win9x */
"succeeded: r=%d\n", r);
ok(GetLastError()==ERROR_INVALID_PARAMETER ||
broken(GetLastError()==0xdeadbeef), /* Win9x */
"last error %u\n", GetLastError());
/* using the format feature */ /* using the format feature */
r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!s!", 0, r = doit(FORMAT_MESSAGE_FROM_STRING, "%1!s!", 0,
...@@ -766,12 +752,8 @@ static void test_message_from_string(void) ...@@ -766,12 +752,8 @@ static void test_message_from_string(void)
/* line feed */ /* line feed */
r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\n", 0, r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\n", 0,
0, out, sizeof(out)/sizeof(CHAR)); 0, out, sizeof(out)/sizeof(CHAR));
ok(!strcmp("hi ", out) || ok(!strcmp("hi ", out), "failed out=[%s]\n",out);
broken(!strcmp("hi\r\n", out)), /* Win9x */ ok(r==3, "failed: r=%d\n",r);
"failed out=[%s]\n",out);
ok(r==3 ||
broken(r==4), /* Win9x */
"failed: r=%d\n",r);
/* carriage return line feed */ /* carriage return line feed */
r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\r\n", 0, r = doit(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\r\n", 0,
...@@ -821,9 +803,7 @@ static void test_message_ignore_inserts(void) ...@@ -821,9 +803,7 @@ static void test_message_ignore_inserts(void)
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%0test", 0, 0, out, ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%0test", 0, 0, out,
sizeof(out)/sizeof(CHAR), NULL); sizeof(out)/sizeof(CHAR), NULL);
ok(ret == 0, "Expected FormatMessageA to return 0, got %d\n", ret); ok(ret == 0, "Expected FormatMessageA to return 0, got %d\n", ret);
ok(!memcmp(out, init_buf, sizeof(init_buf)) || ok(!memcmp(out, init_buf, sizeof(init_buf)), "Expected the output buffer to be untouched\n");
broken(!strcmp("", out)), /* Win9x */
"Expected the output buffer to be untouched\n");
ok(GetLastError() == 0xdeadbeef, "Expected GetLastError() to return 0xdeadbeef, got %u\n", GetLastError()); ok(GetLastError() == 0xdeadbeef, "Expected GetLastError() to return 0xdeadbeef, got %u\n", GetLastError());
/* Insert sequences are ignored. */ /* Insert sequences are ignored. */
...@@ -835,12 +815,8 @@ static void test_message_ignore_inserts(void) ...@@ -835,12 +815,8 @@ static void test_message_ignore_inserts(void)
/* Only the "%n", "%r", and "%t" escape sequences are processed. */ /* Only the "%n", "%r", and "%t" escape sequences are processed. */
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%%% %.%!", 0, 0, out, ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%%% %.%!", 0, 0, out,
sizeof(out)/sizeof(CHAR), NULL); sizeof(out)/sizeof(CHAR), NULL);
ok(ret == 8 || ok(ret == 8, "Expected FormatMessageA to return 8, got %d\n", ret);
broken(ret == 7) /* Win9x */, ok(!strcmp("%%% %.%!", out), "Expected output string \"%%%%%% %%.%%!\", got %s\n", out);
"Expected FormatMessageA to return 8, got %d\n", ret);
ok(!strcmp("%%% %.%!", out) ||
broken(!strcmp("%%% %.!", out)) /* Win9x */,
"Expected output string \"%%%%%% %%.%%!\", got %s\n", out);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%n%r%t", 0, 0, out, ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS, "%n%r%t", 0, 0, out,
sizeof(out)/sizeof(CHAR), NULL); sizeof(out)/sizeof(CHAR), NULL);
...@@ -872,12 +848,8 @@ static void test_message_ignore_inserts(void) ...@@ -872,12 +848,8 @@ static void test_message_ignore_inserts(void)
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\n", 0, 0, out, FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\n", 0, 0, out,
sizeof(out)/sizeof(CHAR), NULL); sizeof(out)/sizeof(CHAR), NULL);
ok(!strcmp("hi ", out) || ok(!strcmp("hi ", out), "Expected output string \"hi \", got %s\n", out);
broken(!strcmp("hi\r\n", out)), /* Win9x */ ok(ret == 3, "Expected FormatMessageA to return 3, got %d\n", ret);
"Expected output string \"hi \", got %s\n", out);
ok(ret == 3 ||
broken(ret == 4), /* Win9x */
"Expected FormatMessageA to return 3, got %d\n", ret);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS | ret = FormatMessageA(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\r\n", 0, 0, out, FORMAT_MESSAGE_MAX_WIDTH_MASK, "hi\r\n", 0, 0, out,
...@@ -1105,17 +1077,13 @@ static void test_message_null_buffer(void) ...@@ -1105,17 +1077,13 @@ static void test_message_null_buffer(void)
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 0, NULL); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 0, NULL);
error = GetLastError(); error = GetLastError();
ok(!ret, "FormatMessageA returned %u\n", ret); ok(!ret, "FormatMessageA returned %u\n", ret);
ok(error == ERROR_INSUFFICIENT_BUFFER || ok(error == ERROR_INSUFFICIENT_BUFFER, "last error %u\n", error);
error == ERROR_INVALID_PARAMETER, /* win9x */
"last error %u\n", error);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 1, NULL); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, NULL, 1, NULL);
error = GetLastError(); error = GetLastError();
ok(!ret, "FormatMessageA returned %u\n", ret); ok(!ret, "FormatMessageA returned %u\n", ret);
ok(error == ERROR_INSUFFICIENT_BUFFER || ok(error == ERROR_INSUFFICIENT_BUFFER, "last error %u\n", error);
error == ERROR_INVALID_PARAMETER, /* win9x */
"last error %u\n", error);
if (0) /* crashes on Windows */ if (0) /* crashes on Windows */
{ {
...@@ -1127,25 +1095,19 @@ static void test_message_null_buffer(void) ...@@ -1127,25 +1095,19 @@ static void test_message_null_buffer(void)
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 0, NULL); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 0, NULL);
error = GetLastError(); error = GetLastError();
ok(!ret, "FormatMessageA returned %u\n", ret); ok(!ret, "FormatMessageA returned %u\n", ret);
ok(error == ERROR_NOT_ENOUGH_MEMORY || ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %u\n", error);
error == ERROR_INVALID_PARAMETER, /* win9x */
"last error %u\n", error);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 1, NULL); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 1, NULL);
error = GetLastError(); error = GetLastError();
ok(!ret, "FormatMessageA returned %u\n", ret); ok(!ret, "FormatMessageA returned %u\n", ret);
ok(error == ERROR_NOT_ENOUGH_MEMORY || ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %u\n", error);
error == ERROR_INVALID_PARAMETER, /* win9x */
"last error %u\n", error);
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 256, NULL); ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, 0, 0, NULL, 256, NULL);
error = GetLastError(); error = GetLastError();
ok(!ret, "FormatMessageA returned %u\n", ret); ok(!ret, "FormatMessageA returned %u\n", ret);
ok(error == ERROR_NOT_ENOUGH_MEMORY || ok(error == ERROR_NOT_ENOUGH_MEMORY, "last error %u\n", error);
error == ERROR_INVALID_PARAMETER, /* win9x */
"last error %u\n", error);
} }
static void test_message_null_buffer_wide(void) static void test_message_null_buffer_wide(void)
...@@ -1391,16 +1353,12 @@ static void test_message_from_hmodule(void) ...@@ -1391,16 +1353,12 @@ static void test_message_from_hmodule(void)
/* Test a message string with an insertion without passing any variadic arguments. */ /* Test a message string with an insertion without passing any variadic arguments. */
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 193 /* ERROR_BAD_EXE_FORMAT */, ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 193 /* ERROR_BAD_EXE_FORMAT */,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL); MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL);
ok(ret == 0 || ok(ret == 0, "FormatMessageA returned non-zero\n");
broken(ret != 0), /* Win9x */
"FormatMessageA returned non-zero\n");
ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE | ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE |
FORMAT_MESSAGE_ARGUMENT_ARRAY, h, 193 /* ERROR_BAD_EXE_FORMAT */, FORMAT_MESSAGE_ARGUMENT_ARRAY, h, 193 /* ERROR_BAD_EXE_FORMAT */,
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL); MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL);
ok(ret == 0 || ok(ret == 0, "FormatMessageA returned non-zero\n");
broken(ret != 0), /* Win9x */
"FormatMessageA returned non-zero\n");
/*Test nonexistent messageID with varying language ID's Note: FormatMessageW behaves the same*/ /*Test nonexistent messageID with varying language ID's Note: FormatMessageW behaves the same*/
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
...@@ -1469,9 +1427,7 @@ static void test_message_invalid_flags(void) ...@@ -1469,9 +1427,7 @@ static void test_message_invalid_flags(void)
ptr = (char *)0xdeadbeef; ptr = (char *)0xdeadbeef;
ret = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER, "test", 0, 0, (char *)&ptr, 0, NULL); ret = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER, "test", 0, 0, (char *)&ptr, 0, NULL);
ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret); ok(ret == 0, "Expected FormatMessageA to return 0, got %u\n", ret);
ok(ptr == NULL || ok(ptr == NULL, "Expected output pointer to be initialized to NULL, got %p\n", ptr);
broken(ptr == (char *)0xdeadbeef), /* Win9x */
"Expected output pointer to be initialized to NULL, got %p\n", ptr);
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError()); GetLastError());
......
...@@ -482,13 +482,6 @@ static void test_Loader(void) ...@@ -482,13 +482,6 @@ static void test_Loader(void)
BOOL error_match; BOOL error_match;
int error_index; int error_index;
if (GetLastError() == ERROR_GEN_FAILURE) /* Win9x, broken behaviour */
{
trace("skipping the loader test on Win9x\n");
DeleteFile(dll_name);
return;
}
error_match = FALSE; error_match = FALSE;
for (error_index = 0; for (error_index = 0;
! error_match && error_index < sizeof(td[i].errors) / sizeof(DWORD); ! error_match && error_index < sizeof(td[i].errors) / sizeof(DWORD);
......
...@@ -55,13 +55,8 @@ static int mailslot_test(void) ...@@ -55,13 +55,8 @@ static int mailslot_test(void)
/* open a mailslot with a null name */ /* open a mailslot with a null name */
hSlot = CreateMailslot( NULL, 0, 0, NULL ); hSlot = CreateMailslot( NULL, 0, 0, NULL );
ok( hSlot == INVALID_HANDLE_VALUE || broken(hSlot != INVALID_HANDLE_VALUE), /* win9x */ ok( hSlot == INVALID_HANDLE_VALUE, "Created mailslot with invalid name\n");
"Created mailslot with invalid name\n"); ok( GetLastError() == ERROR_PATH_NOT_FOUND, "error should be ERROR_PATH_NOT_FOUND\n");
if (hSlot == INVALID_HANDLE_VALUE)
ok( GetLastError() == ERROR_PATH_NOT_FOUND,
"error should be ERROR_PATH_NOT_FOUND\n");
else /* succeeds on win9x */
CloseHandle( hSlot );
/* valid open, but with wacky parameters ... then check them */ /* valid open, but with wacky parameters ... then check them */
hSlot = CreateMailslot( szmspath, -1, -1, NULL ); hSlot = CreateMailslot( szmspath, -1, -1, NULL );
...@@ -85,7 +80,7 @@ static int mailslot_test(void) ...@@ -85,7 +80,7 @@ static int mailslot_test(void)
count = 0; count = 0;
memset(buffer, 0, sizeof buffer); memset(buffer, 0, sizeof buffer);
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret || broken(ret), /* win9x */ "slot read\n"); ok( !ret, "slot read\n");
if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
else ok( count == 0, "wrong count %u\n", count ); else ok( count == 0, "wrong count %u\n", count );
ok( !WriteFile( hSlot, buffer, sizeof buffer, &count, NULL), ok( !WriteFile( hSlot, buffer, sizeof buffer, &count, NULL),
...@@ -102,8 +97,6 @@ static int mailslot_test(void) ...@@ -102,8 +97,6 @@ static int mailslot_test(void)
/* now open the client with the correct sharing mode */ /* now open the client with the correct sharing mode */
hWriter = CreateFile(szmspath, GENERIC_READ|GENERIC_WRITE, hWriter = CreateFile(szmspath, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hWriter == INVALID_HANDLE_VALUE) /* win9x doesn't like GENERIC_READ */
hWriter = CreateFile(szmspath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %u\n", GetLastError()); ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %u\n", GetLastError());
/* /*
...@@ -111,7 +104,7 @@ static int mailslot_test(void) ...@@ -111,7 +104,7 @@ static int mailslot_test(void)
* whether we can read or write the mailslot * whether we can read or write the mailslot
*/ */
ret = ReadFile( hSlot, buffer, sizeof buffer/2, &count, NULL); ret = ReadFile( hSlot, buffer, sizeof buffer/2, &count, NULL);
ok( !ret || broken(ret), /* win9x */ "slot read\n"); ok( !ret, "slot read\n");
if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
else ok( count == 0, "wrong count %u\n", count ); else ok( count == 0, "wrong count %u\n", count );
ok( !WriteFile( hSlot, buffer, sizeof buffer/2, &count, NULL), ok( !WriteFile( hSlot, buffer, sizeof buffer/2, &count, NULL),
...@@ -143,7 +136,7 @@ static int mailslot_test(void) ...@@ -143,7 +136,7 @@ static int mailslot_test(void)
/* but not again */ /* but not again */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret || broken(ret), /* win9x */ "slot read\n"); ok( !ret, "slot read\n");
if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
else ok( count == 0, "wrong count %u\n", count ); else ok( count == 0, "wrong count %u\n", count );
...@@ -205,7 +198,7 @@ static int mailslot_test(void) ...@@ -205,7 +198,7 @@ static int mailslot_test(void)
/* check there's still no data */ /* check there's still no data */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret || broken(ret), /* win9x */ "slot read\n"); ok( !ret, "slot read\n");
if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
else ok( count == 0, "wrong count %u\n", count ); else ok( count == 0, "wrong count %u\n", count );
...@@ -242,8 +235,7 @@ static int mailslot_test(void) ...@@ -242,8 +235,7 @@ static int mailslot_test(void)
"getmailslotinfo failed\n"); "getmailslotinfo failed\n");
ok( dwNext == 1, "dwNext incorrect\n"); ok( dwNext == 1, "dwNext incorrect\n");
todo_wine todo_wine
ok( dwMsgCount == 3 || broken(dwMsgCount == 2), /* win9x */ ok( dwMsgCount == 3, "dwMsgCount incorrect %u\n", dwMsgCount);
"dwMsgCount incorrect %u\n", dwMsgCount);
buffer[0]=buffer[1]=0; buffer[0]=buffer[1]=0;
...@@ -262,8 +254,7 @@ static int mailslot_test(void) ...@@ -262,8 +254,7 @@ static int mailslot_test(void)
"getmailslotinfo failed\n"); "getmailslotinfo failed\n");
ok( dwNext == 2, "dwNext incorrect\n"); ok( dwNext == 2, "dwNext incorrect\n");
todo_wine { todo_wine {
ok( dwMsgCount == 2 || broken(dwMsgCount == 1), /* win9x */ ok( dwMsgCount == 2, "dwMsgCount incorrect %u\n", dwMsgCount);
"dwMsgCount incorrect %u\n", dwMsgCount);
} }
/* read the second message */ /* read the second message */
...@@ -276,10 +267,9 @@ static int mailslot_test(void) ...@@ -276,10 +267,9 @@ static int mailslot_test(void)
dwNext = dwMsgCount = 0; dwNext = dwMsgCount = 0;
ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ), ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ),
"getmailslotinfo failed\n"); "getmailslotinfo failed\n");
ok( dwNext == 0 || broken(dwNext == ~0u), /* win9x */ "dwNext incorrect %u\n", dwNext); ok( dwNext == 0, "dwNext incorrect %u\n", dwNext);
todo_wine { todo_wine {
ok( dwMsgCount == 1 || broken(dwMsgCount == 0), /* win9x */ ok( dwMsgCount == 1, "dwMsgCount incorrect %u\n", dwMsgCount);
"dwMsgCount incorrect %u\n", dwMsgCount);
} }
/* read the 3rd (zero length) message */ /* read the 3rd (zero length) message */
...@@ -301,7 +291,7 @@ static int mailslot_test(void) ...@@ -301,7 +291,7 @@ static int mailslot_test(void)
/* check that reads fail */ /* check that reads fail */
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
ok( !ret || broken(ret), /* win9x */ "3rd slot read succeeded\n"); ok( !ret, "3rd slot read succeeded\n");
if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
else ok( count == 0, "wrong count %u\n", count ); else ok( count == 0, "wrong count %u\n", count );
...@@ -317,8 +307,7 @@ static int mailslot_test(void) ...@@ -317,8 +307,7 @@ static int mailslot_test(void)
memset(buffer, 0, sizeof buffer); memset(buffer, 0, sizeof buffer);
dwTimeout = GetTickCount(); dwTimeout = GetTickCount();
ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n"); ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n");
ok( GetLastError() == ERROR_SEM_TIMEOUT || broken(GetLastError() == ERROR_ACCESS_DENIED), /* win9x */ ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() );
"wrong error %u\n", GetLastError() );
dwTimeout = GetTickCount() - dwTimeout; dwTimeout = GetTickCount() - dwTimeout;
ok( dwTimeout >= 990, "timeout too short %u\n", dwTimeout ); ok( dwTimeout >= 990, "timeout too short %u\n", dwTimeout );
ok( CloseHandle( hSlot ), "closing the mailslot\n"); ok( CloseHandle( hSlot ), "closing the mailslot\n");
......
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