Commit 84c9206c authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

wineusb.sys: Handle IRP_MN_SURPRISE_REMOVAL and set removed flag.

parent b38db8a6
......@@ -145,7 +145,6 @@ static void remove_usb_device(libusb_device *libusb_device)
if (device->libusb_device == libusb_device)
{
list_remove(&device->entry);
device->removed = TRUE;
break;
}
}
......@@ -402,26 +401,24 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp)
}
case IRP_MN_START_DEVICE:
case IRP_MN_SURPRISE_REMOVAL:
ret = STATUS_SUCCESS;
break;
case IRP_MN_REMOVE_DEVICE:
case IRP_MN_SURPRISE_REMOVAL:
EnterCriticalSection(&wineusb_cs);
remove_pending_irps(device);
device->removed = TRUE;
LeaveCriticalSection(&wineusb_cs);
ret = STATUS_SUCCESS;
break;
if (device->removed)
{
libusb_unref_device(device->libusb_device);
libusb_close(device->handle);
case IRP_MN_REMOVE_DEVICE:
remove_pending_irps(device);
irp->IoStatus.Status = STATUS_SUCCESS;
IoCompleteRequest(irp, IO_NO_INCREMENT);
IoDeleteDevice(device->device_obj);
return STATUS_SUCCESS;
}
libusb_unref_device(device->libusb_device);
libusb_close(device->handle);
IoDeleteDevice(device->device_obj);
ret = STATUS_SUCCESS;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment