Commit f8dc38f9 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

kernelbase: Call NtCancelSynchronousIoFile in CancelSynchronousIo.

parent 0a02b6a8
...@@ -4247,14 +4247,12 @@ static void test_CancelSynchronousIo(void) ...@@ -4247,14 +4247,12 @@ static void test_CancelSynchronousIo(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = pCancelSynchronousIo((HANDLE)0xdeadbeef); res = pCancelSynchronousIo((HANDLE)0xdeadbeef);
ok(!res, "CancelSynchronousIo succeeded unexpectedly\n"); ok(!res, "CancelSynchronousIo succeeded unexpectedly\n");
todo_wine
ok(GetLastError() == ERROR_INVALID_HANDLE, ok(GetLastError() == ERROR_INVALID_HANDLE,
"In CancelSynchronousIo failure, expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError()); "In CancelSynchronousIo failure, expected ERROR_INVALID_HANDLE, got %ld\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = pCancelSynchronousIo(GetCurrentThread()); res = pCancelSynchronousIo(GetCurrentThread());
ok(!res, "CancelSynchronousIo succeeded unexpectedly\n"); ok(!res, "CancelSynchronousIo succeeded unexpectedly\n");
todo_wine
ok(GetLastError() == ERROR_NOT_FOUND, ok(GetLastError() == ERROR_NOT_FOUND,
"In CancelSynchronousIo failure, expected ERROR_NOT_FOUND, got %ld\n", GetLastError()); "In CancelSynchronousIo failure, expected ERROR_NOT_FOUND, got %ld\n", GetLastError());
...@@ -4269,14 +4267,9 @@ static void test_CancelSynchronousIo(void) ...@@ -4269,14 +4267,9 @@ static void test_CancelSynchronousIo(void)
ok(wait == WAIT_TIMEOUT, "WaitForSingleObject returned %lu (error %lu)\n", wait, GetLastError()); ok(wait == WAIT_TIMEOUT, "WaitForSingleObject returned %lu (error %lu)\n", wait, GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = pCancelSynchronousIo(thread); res = pCancelSynchronousIo(thread);
todo_wine
{
ok(res, "CancelSynchronousIo failed with error %ld\n", GetLastError()); ok(res, "CancelSynchronousIo failed with error %ld\n", GetLastError());
ok(GetLastError() == 0xdeadbeef, ok(GetLastError() == 0xdeadbeef,
"In CancelSynchronousIo failure, expected 0xdeadbeef got %ld\n", GetLastError()); "In CancelSynchronousIo failure, expected 0xdeadbeef got %ld\n", GetLastError());
}
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
CancelIoEx(pipe, NULL);
wait = WaitForSingleObject(thread, 1000); wait = WaitForSingleObject(thread, 1000);
ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", wait); ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", wait);
CloseHandle(thread); CloseHandle(thread);
...@@ -4294,7 +4287,6 @@ static void test_CancelSynchronousIo(void) ...@@ -4294,7 +4287,6 @@ static void test_CancelSynchronousIo(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
res = pCancelSynchronousIo(thread); res = pCancelSynchronousIo(thread);
ok(!res, "CancelSynchronousIo succeeded unexpectedly\n"); ok(!res, "CancelSynchronousIo succeeded unexpectedly\n");
todo_wine
ok(GetLastError() == ERROR_NOT_FOUND, ok(GetLastError() == ERROR_NOT_FOUND,
"In CancelSynchronousIo failure, expected ERROR_NOT_FOUND, got %ld\n", GetLastError()); "In CancelSynchronousIo failure, expected ERROR_NOT_FOUND, got %ld\n", GetLastError());
file = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); file = CreateFileA(PIPENAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0);
......
...@@ -2900,9 +2900,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH CancelIoEx( HANDLE handle, LPOVERLAPPED overlapped ...@@ -2900,9 +2900,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH CancelIoEx( HANDLE handle, LPOVERLAPPED overlapped
*/ */
BOOL WINAPI DECLSPEC_HOTPATCH CancelSynchronousIo( HANDLE thread ) BOOL WINAPI DECLSPEC_HOTPATCH CancelSynchronousIo( HANDLE thread )
{ {
FIXME( "(%p): stub\n", thread ); IO_STATUS_BLOCK io;
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
return FALSE; return set_ntstatus( NtCancelSynchronousIoFile( thread, NULL, &io ));
} }
......
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