Commit b7a8eefb authored by Alexandre Julliard's avatar Alexandre Julliard

Authors: Francois Gouget <fgouget@free.fr>, With help from Enio Schutt Jr <enio.s.jr@operamail.com>

Skip the overlapped I/O tests on files on Win9x.
parent 1998beae
......@@ -609,6 +609,7 @@ void test_offset_in_overlapped_structure(void)
HANDLE hFile;
OVERLAPPED ov;
DWORD done;
BOOL rc;
BYTE buf[256], pattern[] = "TeSt";
UINT i;
char temp_path[MAX_PATH], temp_fname[MAX_PATH];
......@@ -628,7 +629,10 @@ void test_offset_in_overlapped_structure(void)
memset(&ov, 0, sizeof(ov));
ov.Offset = PATTERN_OFFSET;
ov.OffsetHigh = 0;
ok(WriteFile(hFile, pattern, sizeof(pattern), &done, &ov), "WriteFile error %ld", GetLastError());
rc=WriteFile(hFile, pattern, sizeof(pattern), &done, &ov);
/* Win 9x does not support the overlapped I/O on files */
if (rc || GetLastError()!=ERROR_INVALID_PARAMETER) {
ok(rc, "WriteFile error %ld", GetLastError());
ok(done == sizeof(pattern), "expected number of bytes written %lu", done);
trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT));
ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (PATTERN_OFFSET + sizeof(pattern)),
......@@ -641,6 +645,7 @@ void test_offset_in_overlapped_structure(void)
/*trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT));*/
ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (sizeof(buf) * 2 + sizeof(pattern)),
"expected file offset %d", sizeof(buf) * 2 + sizeof(pattern));
}
CloseHandle(hFile);
......@@ -653,12 +658,16 @@ void test_offset_in_overlapped_structure(void)
memset(&ov, 0, sizeof(ov));
ov.Offset = PATTERN_OFFSET;
ov.OffsetHigh = 0;
ok(ReadFile(hFile, buf, sizeof(pattern), &done, &ov), "ReadFile error %ld", GetLastError());
rc=ReadFile(hFile, buf, sizeof(pattern), &done, &ov);
/* Win 9x does not support the overlapped I/O on files */
if (rc || GetLastError()!=ERROR_INVALID_PARAMETER) {
ok(rc, "ReadFile error %ld", GetLastError());
ok(done == sizeof(pattern), "expected number of bytes read %lu", done);
trace("Current offset = %04lx\n", SetFilePointer(hFile, 0, NULL, FILE_CURRENT));
ok(SetFilePointer(hFile, 0, NULL, FILE_CURRENT) == (PATTERN_OFFSET + sizeof(pattern)),
"expected file offset %d", PATTERN_OFFSET + sizeof(pattern));
ok(!memcmp(buf, pattern, sizeof(pattern)), "pattern match failed");
}
CloseHandle(hFile);
......
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