From b244ec1114f96876ccc101d4563b38215af0b9fc Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 5 Mar 2012 14:42:05 +0000 Subject: [PATCH] [USBSTOR] - Deny removal to fix a race with the legacy disk class driver svn path=/trunk/; revision=56033 --- reactos/drivers/usb/usbstor/fdo.c | 4 ++++ reactos/drivers/usb/usbstor/pdo.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/reactos/drivers/usb/usbstor/fdo.c b/reactos/drivers/usb/usbstor/fdo.c index 8785a59388b..dbbea3c9953 100644 --- a/reactos/drivers/usb/usbstor/fdo.c +++ b/reactos/drivers/usb/usbstor/fdo.c @@ -374,11 +374,15 @@ USBSTOR_FdoHandlePnp( case IRP_MN_QUERY_STOP_DEVICE: case IRP_MN_QUERY_REMOVE_DEVICE: { +#if 0 // // we can if nothing is pending // if (DeviceExtension->IrpPendingCount != 0 || DeviceExtension->ActiveSrb != NULL) +#else + if (TRUE) +#endif { /* We have pending requests */ DPRINT1("Failing removal/stop request due to pending requests present\n"); diff --git a/reactos/drivers/usb/usbstor/pdo.c b/reactos/drivers/usb/usbstor/pdo.c index 4b8d0325beb..92fa17b656f 100644 --- a/reactos/drivers/usb/usbstor/pdo.c +++ b/reactos/drivers/usb/usbstor/pdo.c @@ -905,10 +905,14 @@ USBSTOR_PdoHandlePnp( case IRP_MN_QUERY_REMOVE_DEVICE: case IRP_MN_QUERY_STOP_DEVICE: { +#if 0 // // if we're not claimed it's ok // if (DeviceExtension->Claimed) +#else + if (TRUE) +#endif { Status = STATUS_UNSUCCESSFUL; DPRINT1("[USBSTOR] Request %x fails because device is still claimed\n", IoStack->MinorFunction);