mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-30 05:08:30 +00:00
ntdll: Factor filling the IOSB into set_async_direct_result().
This commit is contained in:
parent
62df7633e5
commit
5493ff11fa
|
@ -1202,15 +1202,13 @@ static NTSTATUS wait_on( HANDLE handle, int fd, HANDLE event, PIO_APC_ROUTINE ap
|
|||
if (events)
|
||||
{
|
||||
status = STATUS_SUCCESS;
|
||||
io->Status = STATUS_SUCCESS;
|
||||
io->Information = sizeof(events);
|
||||
*out_buffer = events;
|
||||
set_async_direct_result( &wait_handle, STATUS_SUCCESS, sizeof(events), FALSE );
|
||||
set_async_direct_result( &wait_handle, io, STATUS_SUCCESS, sizeof(events), FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
status = STATUS_PENDING;
|
||||
set_async_direct_result( &wait_handle, STATUS_PENDING, 0, TRUE );
|
||||
set_async_direct_result( &wait_handle, io, STATUS_PENDING, 0, TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -875,12 +875,7 @@ static NTSTATUS sock_recv( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
|
|||
status = try_recv( fd, async, &information );
|
||||
if (status == STATUS_DEVICE_NOT_READY && (force_async || !nonblocking))
|
||||
status = STATUS_PENDING;
|
||||
if (!NT_ERROR(status) && status != STATUS_PENDING)
|
||||
{
|
||||
io->Status = status;
|
||||
io->Information = information;
|
||||
}
|
||||
set_async_direct_result( &wait_handle, status, information, FALSE );
|
||||
set_async_direct_result( &wait_handle, io, status, information, FALSE );
|
||||
}
|
||||
|
||||
if (status != STATUS_PENDING)
|
||||
|
@ -1125,8 +1120,6 @@ static NTSTATUS sock_send( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
|
|||
|
||||
if (status == STATUS_ALERTED)
|
||||
{
|
||||
ULONG_PTR information;
|
||||
|
||||
status = try_send( fd, async );
|
||||
if (status == STATUS_DEVICE_NOT_READY && (force_async || !nonblocking))
|
||||
status = STATUS_PENDING;
|
||||
|
@ -1138,14 +1131,7 @@ static NTSTATUS sock_send( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, voi
|
|||
if (status == STATUS_DEVICE_NOT_READY && async->sent_len)
|
||||
status = STATUS_SUCCESS;
|
||||
|
||||
information = async->sent_len;
|
||||
if (!NT_ERROR(status) && status != STATUS_PENDING)
|
||||
{
|
||||
io->Status = status;
|
||||
io->Information = information;
|
||||
}
|
||||
|
||||
set_async_direct_result( &wait_handle, status, information, FALSE );
|
||||
set_async_direct_result( &wait_handle, io, status, async->sent_len, FALSE );
|
||||
}
|
||||
|
||||
if (status != STATUS_PENDING)
|
||||
|
@ -1401,13 +1387,7 @@ static NTSTATUS sock_transmit( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc,
|
|||
status = STATUS_PENDING;
|
||||
|
||||
information = async->head_cursor + async->file_cursor + async->tail_cursor;
|
||||
if (!NT_ERROR(status) && status != STATUS_PENDING)
|
||||
{
|
||||
io->Status = status;
|
||||
io->Information = information;
|
||||
}
|
||||
|
||||
set_async_direct_result( &wait_handle, status, information, TRUE );
|
||||
set_async_direct_result( &wait_handle, io, status, information, TRUE );
|
||||
}
|
||||
|
||||
if (status != STATUS_PENDING)
|
||||
|
|
|
@ -2669,13 +2669,20 @@ NTSTATUS WINAPI NtWaitForAlertByThreadId( const void *address, const LARGE_INTEG
|
|||
|
||||
/* Notify direct completion of async and close the wait handle if it is no longer needed.
|
||||
*/
|
||||
void set_async_direct_result( HANDLE *async_handle, NTSTATUS status, ULONG_PTR information, BOOL mark_pending )
|
||||
void set_async_direct_result( HANDLE *async_handle, IO_STATUS_BLOCK *io,
|
||||
NTSTATUS status, ULONG_PTR information, BOOL mark_pending )
|
||||
{
|
||||
unsigned int ret;
|
||||
|
||||
/* if we got STATUS_ALERTED, we must have a valid async handle */
|
||||
assert( *async_handle );
|
||||
|
||||
if (!NT_ERROR(status) && status != STATUS_PENDING)
|
||||
{
|
||||
io->Status = status;
|
||||
io->Information = information;
|
||||
}
|
||||
|
||||
SERVER_START_REQ( set_async_direct_result )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( *async_handle );
|
||||
|
|
|
@ -344,7 +344,8 @@ extern void init_files(void);
|
|||
extern void init_cpu_info(void);
|
||||
extern void file_complete_async( HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc, void *apc_user,
|
||||
IO_STATUS_BLOCK *io, NTSTATUS status, ULONG_PTR information );
|
||||
extern void set_async_direct_result( HANDLE *async_handle, NTSTATUS status, ULONG_PTR information, BOOL mark_pending );
|
||||
extern void set_async_direct_result( HANDLE *async_handle, IO_STATUS_BLOCK *io,
|
||||
NTSTATUS status, ULONG_PTR information, BOOL mark_pending );
|
||||
|
||||
extern NTSTATUS unixcall_wine_dbg_write( void *args );
|
||||
extern NTSTATUS unixcall_wine_server_call( void *args );
|
||||
|
|
Loading…
Reference in a new issue