From: Elizabeth Figura <zfigura(a)codeweavers.com> That is, don't fill the IOSB or signal completion (unless the async was explicitly marked as pending, with set_async_pending(). This is for convenience. --- server/async.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/server/async.c b/server/async.c index 80129ac0ac3..3c9b9588c6e 100644 --- a/server/async.c +++ b/server/async.c @@ -368,16 +368,6 @@ obj_handle_t async_handoff( struct async *async, data_size_t *result, int force_ async->initial_status = get_error(); - if (!async->pending && NT_ERROR( get_error() )) - { - async->iosb->status = get_error(); - async_call_completion_callback( async ); - - close_handle( async->thread->process, async->wait_handle ); - async->wait_handle = 0; - return 0; - } - if (get_error() != STATUS_PENDING) { /* status and data are already set and returned */ @@ -393,6 +383,16 @@ obj_handle_t async_handoff( struct async *async, data_size_t *result, int force_ } } + if (!async->pending && NT_ERROR( async->iosb->status )) + { + async_call_completion_callback( async ); + + close_handle( async->thread->process, async->wait_handle ); + async->wait_handle = 0; + set_error( async->iosb->status ); + return 0; + } + if (async->iosb->status != STATUS_PENDING) { if (result) *result = async->iosb->result; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/6045