From: Matteo Bruni mbruni@codeweavers.com
--- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index 1c80bcd3898..7078e122e4f 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -490,6 +490,7 @@ static void test_overlapped(void) HANDLE file, port, thread, thread2, thread_current; OVERLAPPED overlapped, overlapped2, o3, *o; struct cancel_thread_ctx ctx; + IO_STATUS_BLOCK cancel_sb; DWORD cancel_cnt, size; ULONG_PTR key; BOOL res; @@ -573,8 +574,10 @@ static void test_overlapped(void) ctx.file = file; ctx.ex = FALSE; thread = CreateThread(NULL, 0, test_cancel_complete_thread, &ctx, 0, NULL); - res = CancelIo(file); - ok(res, "CancelIo failed: %lu\n", GetLastError()); + res = NtCancelIoFile(file, &cancel_sb); + ok(!res, "Unexpected result %u\n", res); + ok(!cancel_sb.Status, "Unexpected Status %lx\n", cancel_sb.Status); + ok(!cancel_sb.Information, "Unexpected Information %Iu\n", cancel_sb.Information); returned = TRUE; WaitForSingleObject(thread, INFINITE); CloseHandle(thread); @@ -609,16 +612,22 @@ static void test_overlapped(void) ctx.file = file; ctx.ex = TRUE; thread = CreateThread(NULL, 0, test_cancel_complete_thread, &ctx, 0, NULL); - res = CancelIoEx(file, NULL); - ok(res, "CancelIoEx failed: %lu\n", GetLastError()); - res = CancelIoEx(file, NULL); - ok(res, "CancelIoEx failed: %lu\n", GetLastError()); + res = NtCancelIoFileEx(file, NULL, &cancel_sb); + ok(!res, "Unexpected result %u\n", res); + ok(!cancel_sb.Status, "Unexpected Status %lx\n", cancel_sb.Status); + ok(!cancel_sb.Information, "Unexpected Information %Iu\n", cancel_sb.Information); + res = NtCancelIoFileEx(file, NULL, &cancel_sb); + ok(!res, "Unexpected result %u\n", res); + ok(!cancel_sb.Status, "Unexpected Status %lx\n", cancel_sb.Status); + ok(!cancel_sb.Information, "Unexpected Information %Iu\n", cancel_sb.Information); returned = TRUE; WaitForSingleObject(thread, INFINITE); CloseHandle(thread);
- res = CancelIoEx(file, NULL); - ok(!res && GetLastError() == ERROR_NOT_FOUND, "CancelIoEx failed: %lu\n", GetLastError()); + res = NtCancelIoFileEx(file, NULL, &cancel_sb); + ok(res, "Unexpected result %u\n", res); + ok(cancel_sb.Status == STATUS_NOT_FOUND, "Unexpected Status %lx\n", cancel_sb.Status); + ok(!cancel_sb.Information, "Unexpected Information %Iu\n", cancel_sb.Information);
cancel_cnt = 0xdeadbeef; res = DeviceIoControl(file, IOCTL_WINETEST_GET_CANCEL_COUNT, NULL, 0, &cancel_cnt, sizeof(cancel_cnt), NULL, &o3);