wineusb.sys: Return STATUS_DELETE_PENDING when device is removed.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-07-01 09:51:24 +02:00 committed by Alexandre Julliard
parent 84c9206ca7
commit 0b9d1d9ffb
1 changed files with 12 additions and 0 deletions

View File

@ -726,9 +726,21 @@ static NTSTATUS WINAPI driver_internal_ioctl(DEVICE_OBJECT *device_obj, IRP *irp
ULONG code = stack->Parameters.DeviceIoControl.IoControlCode;
struct usb_device *device = device_obj->DeviceExtension;
NTSTATUS status = STATUS_NOT_IMPLEMENTED;
BOOL removed;
TRACE("device_obj %p, irp %p, code %#x.\n", device_obj, irp, code);
EnterCriticalSection(&wineusb_cs);
removed = device->removed;
LeaveCriticalSection(&wineusb_cs);
if (removed)
{
irp->IoStatus.Status = STATUS_DELETE_PENDING;
IoCompleteRequest(irp, IO_NO_INCREMENT);
return STATUS_DELETE_PENDING;
}
switch (code)
{
case IOCTL_INTERNAL_USB_SUBMIT_URB: