winebus.sys: Read irp->IoStatus.Status before leaving the CS.

Or we may have a race condition where a pending IRP may be completed
after we left the CS but before we read its status.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-08-13 09:46:12 +02:00 committed by Alexandre Julliard
parent faaad36429
commit 28f797ec8b
1 changed files with 1 additions and 1 deletions

View File

@ -982,9 +982,9 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
break;
}
status = irp->IoStatus.Status;
LeaveCriticalSection(&ext->cs);
status = irp->IoStatus.Status;
if (status != STATUS_PENDING) IoCompleteRequest(irp, IO_NO_INCREMENT);
return status;
}