[USBSTOR]
authorCameron Gutman <aicommander@gmail.com>
Tue, 24 Apr 2012 14:47:15 +0000 (14:47 +0000)
committerCameron Gutman <aicommander@gmail.com>
Tue, 24 Apr 2012 14:47:15 +0000 (14:47 +0000)
-  Add forgotten storage of the LUN in the PDO extension which not only broke units beyond LUN 0 but also caused a BSOD due to reporting duplicate devices to the PnP manager
- Thanks to tower for reporting

svn path=/trunk/; revision=56406

reactos/drivers/usb/usbstor/fdo.c
reactos/drivers/usb/usbstor/pdo.c
reactos/drivers/usb/usbstor/usbstor.h

index dbbea3c..0751842 100644 (file)
@@ -264,7 +264,7 @@ USBSTOR_FdoHandleStartDevice(
         //
         // create pdo
         //
-        Status = USBSTOR_CreatePDO(DeviceObject, &DeviceExtension->ChildPDO[Index]);
+        Status = USBSTOR_CreatePDO(DeviceObject, Index, &DeviceExtension->ChildPDO[Index]);
 
         //
         // check for failure
index 92fa17b..9e293df 100644 (file)
@@ -1256,6 +1256,7 @@ USBSTOR_SendFormatCapacityIrp(
 NTSTATUS
 USBSTOR_CreatePDO(
     IN PDEVICE_OBJECT DeviceObject,
+    IN UCHAR LUN,
     OUT PDEVICE_OBJECT *ChildDeviceObject)
 {
     PDEVICE_OBJECT PDO;
@@ -1293,6 +1294,7 @@ USBSTOR_CreatePDO(
     PDODeviceExtension->LowerDeviceObject = DeviceObject;
     PDODeviceExtension->PDODeviceObject = ChildDeviceObject;
     PDODeviceExtension->Self = PDO;
+    PDODeviceExtension->LUN = LUN;
 
     //
     // set device flags
index 5804124..29ef1ce 100644 (file)
@@ -364,6 +364,7 @@ USBSTOR_PdoHandlePnp(
 NTSTATUS
 USBSTOR_CreatePDO(
     IN PDEVICE_OBJECT DeviceObject,
+    IN UCHAR LUN,
     OUT PDEVICE_OBJECT *ChildDeviceObject);
 
 //---------------------------------------------------------------------