server: Don't change the status of an already terminated async.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-05-21 22:08:45 -05:00 committed by Alexandre Julliard
parent 9561af9a7d
commit a5b6e90d48
1 changed files with 2 additions and 7 deletions

View File

@ -154,12 +154,7 @@ void async_terminate( struct async *async, unsigned int status )
{
assert( status != STATUS_PENDING );
if (async->status != STATUS_PENDING)
{
/* already terminated, just update status */
async->status = status;
return;
}
if (async->status != STATUS_PENDING) return; /* already terminated */
async->status = status;
if (async->iosb && async->iosb->status == STATUS_PENDING) async->iosb->status = status;
@ -457,7 +452,7 @@ static int cancel_async( struct process *process, struct object *obj, struct thr
restart:
LIST_FOR_EACH_ENTRY( async, &process->asyncs, struct async, process_entry )
{
if (async->status == STATUS_CANCELLED) continue;
if (async->status != STATUS_PENDING) continue;
if ((!obj || (async->fd && get_fd_user( async->fd ) == obj)) &&
(!thread || async->thread == thread) &&
(!iosb || async->data.iosb == iosb))