Commit ba42efdb authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Pass async parameter to add_fd_completion server call.

parent e2f46a60
...@@ -4577,8 +4577,8 @@ static void test_WriteFileGather(void) ...@@ -4577,8 +4577,8 @@ static void test_WriteFileGather(void)
ok(GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed, error %u.\n", GetLastError()); ok(GetLastError() == ERROR_IO_PENDING, "ReadFileScatter failed, error %u.\n", GetLastError());
br = GetQueuedCompletionStatus(hiocp2, &size, &key, &povl, 1000); br = GetQueuedCompletionStatus(hiocp2, &size, &key, &povl, 1000);
todo_wine ok(br, "GetQueuedCompletionStatus failed, err %u.\n", GetLastError()); ok(br, "GetQueuedCompletionStatus failed, err %u.\n", GetLastError());
todo_wine ok(povl == &ovl, "Wrong ovl %p.\n", povl); ok(povl == &ovl, "Wrong ovl %p.\n", povl);
br = GetOverlappedResult(hfile, &ovl, &tx, TRUE); br = GetOverlappedResult(hfile, &ovl, &tx, TRUE);
ok(br, "GetOverlappedResult failed, err %u.\n", GetLastError()); ok(br, "GetOverlappedResult failed, err %u.\n", GetLastError());
......
...@@ -831,7 +831,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent, ...@@ -831,7 +831,7 @@ NTSTATUS WINAPI NtReadFile(HANDLE hFile, HANDLE hEvent,
int result, unix_handle, needs_close; int result, unix_handle, needs_close;
unsigned int options; unsigned int options;
struct io_timeouts timeouts; struct io_timeouts timeouts;
NTSTATUS status; NTSTATUS status, ret_status;
ULONG total = 0; ULONG total = 0;
enum server_fd_type type; enum server_fd_type type;
ULONG_PTR cvalue = apc ? 0 : (ULONG_PTR)apc_user; ULONG_PTR cvalue = apc ? 0 : (ULONG_PTR)apc_user;
...@@ -1013,10 +1013,11 @@ err: ...@@ -1013,10 +1013,11 @@ err:
if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL ); if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL );
} }
if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total ); ret_status = async_read && (options & FILE_NO_INTERMEDIATE_BUFFERING) && status == STATUS_SUCCESS
if (async_read && (options & FILE_NO_INTERMEDIATE_BUFFERING) && status == STATUS_SUCCESS) ? STATUS_PENDING : status;
return STATUS_PENDING;
return status; if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total, ret_status == STATUS_PENDING );
return ret_status;
} }
...@@ -1089,7 +1090,7 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap ...@@ -1089,7 +1090,7 @@ NTSTATUS WINAPI NtReadFileScatter( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
if (event) NtSetEvent( event, NULL ); if (event) NtSetEvent( event, NULL );
if (apc) NtQueueApcThread( GetCurrentThread(), (PNTAPCFUNC)apc, if (apc) NtQueueApcThread( GetCurrentThread(), (PNTAPCFUNC)apc,
(ULONG_PTR)apc_user, (ULONG_PTR)io_status, 0 ); (ULONG_PTR)apc_user, (ULONG_PTR)io_status, 0 );
if (send_completion) NTDLL_AddCompletion( file, cvalue, status, total ); if (send_completion) NTDLL_AddCompletion( file, cvalue, status, total, TRUE );
return STATUS_PENDING; return STATUS_PENDING;
...@@ -1408,7 +1409,7 @@ err: ...@@ -1408,7 +1409,7 @@ err:
if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL ); if (status != STATUS_PENDING && hEvent) NtResetEvent( hEvent, NULL );
} }
if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total ); if (send_completion) NTDLL_AddCompletion( hFile, cvalue, status, total, FALSE );
return status; return status;
} }
...@@ -1500,7 +1501,7 @@ NTSTATUS WINAPI NtWriteFileGather( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap ...@@ -1500,7 +1501,7 @@ NTSTATUS WINAPI NtWriteFileGather( HANDLE file, HANDLE event, PIO_APC_ROUTINE ap
if (status != STATUS_PENDING && event) NtResetEvent( event, NULL ); if (status != STATUS_PENDING && event) NtResetEvent( event, NULL );
} }
if (send_completion) NTDLL_AddCompletion( file, cvalue, status, total ); if (send_completion) NTDLL_AddCompletion( file, cvalue, status, total, FALSE );
return status; return status;
} }
......
...@@ -194,7 +194,7 @@ extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN; ...@@ -194,7 +194,7 @@ extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN;
/* completion */ /* completion */
extern NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue, extern NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue,
NTSTATUS CompletionStatus, ULONG Information ) DECLSPEC_HIDDEN; NTSTATUS CompletionStatus, ULONG Information, BOOL async) DECLSPEC_HIDDEN;
/* code pages */ /* code pages */
extern int ntdll_umbstowcs(DWORD flags, const char* src, int srclen, WCHAR* dst, int dstlen) DECLSPEC_HIDDEN; extern int ntdll_umbstowcs(DWORD flags, const char* src, int srclen, WCHAR* dst, int dstlen) DECLSPEC_HIDDEN;
......
...@@ -1529,7 +1529,7 @@ NTSTATUS WINAPI NtQueryIoCompletion( HANDLE CompletionPort, IO_COMPLETION_INFORM ...@@ -1529,7 +1529,7 @@ NTSTATUS WINAPI NtQueryIoCompletion( HANDLE CompletionPort, IO_COMPLETION_INFORM
} }
NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue, NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue,
NTSTATUS CompletionStatus, ULONG Information ) NTSTATUS CompletionStatus, ULONG Information, BOOL async )
{ {
NTSTATUS status; NTSTATUS status;
...@@ -1539,6 +1539,7 @@ NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue, ...@@ -1539,6 +1539,7 @@ NTSTATUS NTDLL_AddCompletion( HANDLE hFile, ULONG_PTR CompletionValue,
req->cvalue = CompletionValue; req->cvalue = CompletionValue;
req->status = CompletionStatus; req->status = CompletionStatus;
req->information = Information; req->information = Information;
req->async = async;
status = wine_server_call( req ); status = wine_server_call( req );
} }
SERVER_END_REQ; SERVER_END_REQ;
......
...@@ -3579,7 +3579,7 @@ static void test_file_completion_information(void) ...@@ -3579,7 +3579,7 @@ static void test_file_completion_information(void)
ret = GetOverlappedResult(h, &ov, &num_bytes, TRUE); ret = GetOverlappedResult(h, &ov, &num_bytes, TRUE);
ok(ret, "GetOverlappedResult failed, error %u.\n", GetLastError()); ok(ret, "GetOverlappedResult failed, error %u.\n", GetLastError());
ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000); ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000);
todo_wine ok(ret, "GetQueuedCompletionStatus failed, error %u.\n", GetLastError()); ok(ret, "GetQueuedCompletionStatus failed, error %u.\n", GetLastError());
CloseHandle(ov.hEvent); CloseHandle(ov.hEvent);
CloseHandle(port); CloseHandle(port);
......
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