ntdll/tests: Use NtWriteFile instead of WriteFile in order to detect broken overlapped IO implementation.
This commit is contained in:
parent
b45ec4607b
commit
8ec8d70ada
|
@ -2107,38 +2107,29 @@ todo_wine
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information);
|
ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information);
|
||||||
|
|
||||||
S(U(ovl)).Offset = 0;
|
iob.Status = -1;
|
||||||
S(U(ovl)).OffsetHigh = 0;
|
iob.Information = -1;
|
||||||
ovl.Internal = -1;
|
offset.QuadPart = 0;
|
||||||
ovl.InternalHigh = -1;
|
status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), &offset, NULL);
|
||||||
ovl.hEvent = 0;
|
|
||||||
bytes = 0xdeadbeef;
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
ret = WriteFile(hfile, contents, sizeof(contents), &bytes, &ovl);
|
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(!ret || broken(ret) /* see below */, "WriteFile should fail\n");
|
ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* see below */, "expected STATUS_PENDING, got %#x\n", status);
|
||||||
todo_wine
|
ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status);
|
||||||
ok(GetLastError() == ERROR_IO_PENDING || broken(GetLastError() == 0xdeadbeef), "expected ERROR_IO_PENDING, got %d\n", GetLastError());
|
ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information);
|
||||||
/* even fully updated XP passes this test, but it looks like some VMs
|
/* even fully updated XP passes this test, but it looks like some VMs
|
||||||
* in a testbot get never updated, so overlapped IO is broken. Instead
|
* in a testbot get never updated, so overlapped IO is broken. Instead
|
||||||
* of fighting with broken tests and adding a bunch of broken() statements
|
* of fighting with broken tests and adding a bunch of broken() statements
|
||||||
* it's better to skip further tests completely.
|
* it's better to skip further tests completely.
|
||||||
*/
|
*/
|
||||||
if (GetLastError() != ERROR_IO_PENDING)
|
if (status != STATUS_PENDING)
|
||||||
{
|
{
|
||||||
todo_wine
|
todo_wine
|
||||||
win_skip("broken overlapped IO implementation, update your OS\n");
|
win_skip("broken overlapped IO implementation, update your OS\n");
|
||||||
CloseHandle(hfile);
|
CloseHandle(hfile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ok(bytes == 0, "bytes %u\n", bytes);
|
|
||||||
ok(ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal);
|
|
||||||
ok(ovl.InternalHigh == sizeof(contents), "expected sizeof(contents), got %lu\n", ovl.InternalHigh);
|
|
||||||
|
|
||||||
bytes = 0xdeadbeef;
|
ret = WaitForSingleObject(hfile, 3000);
|
||||||
ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE);
|
ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret);
|
||||||
ok(ret, "GetOverlappedResult error %d\n", GetLastError());
|
|
||||||
ok(bytes == sizeof(contents), "bytes %u\n", bytes);
|
|
||||||
|
|
||||||
bytes = 0xdeadbeef;
|
bytes = 0xdeadbeef;
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
|
|
Loading…
Reference in New Issue