Fixed the reinitialisation if the miniport driver returns SRB_STATUS_BUSY.
Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c

Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c
--- trunk/reactos/drivers/storage/scsiport/scsiport.c	2005-09-26 19:16:43 UTC (rev 18103)
+++ trunk/reactos/drivers/storage/scsiport/scsiport.c	2005-09-26 20:00:48 UTC (rev 18104)
@@ -2888,8 +2888,15 @@
 
 		  if (Srb->SrbStatus == SRB_STATUS_BUSY)
 		    {
+                      CompleteThisRequest = FALSE;
+		      Irp->Tail.Overlay.DriverContext[3] = Srb;
+
 		      SpiRemoveActiveIrp(DeviceExtension, Irp, PrevIrp);
                       SpiFreeSrbExtension(DeviceExtension, OriginalSrb);
+
+                      Srb->OriginalRequest = LunExtension;
+                      Irp->Tail.Overlay.DriverContext[2] = 0;
+
 		      InsertHeadList(&DeviceExtension->PendingIrpListHead, (PLIST_ENTRY)&Irp->Tail.Overlay.DriverContext[0]);
 		      DeviceExtension->PendingIrpCount++;
 		      LunExtension->PendingIrpCount++;
@@ -2915,6 +2922,7 @@
 		                    SenseInfoBuffer,
 		                    sizeof(SENSE_DATA));
 	              OriginalSrb->SrbStatus |= SRB_STATUS_AUTOSENSE_VALID;
+                      OriginalSrb->SrbExtension = Srb->SrbExtension;
 		      ExFreePool(Srb);
 		      CompleteThisRequest = TRUE;
 		    }
@@ -2933,7 +2941,7 @@
 			  CompleteThisRequest = FALSE;
 			  Irp->Tail.Overlay.DriverContext[3] = Srb;
 			  SpiRemoveActiveIrp(DeviceExtension, Irp, PrevIrp);
-	                  SpiFreeSrbExtension(DeviceExtension, Srb);
+	                  SpiFreeSrbExtension(DeviceExtension, OriginalSrb);
 
                           Srb->OriginalRequest = LunExtension;
                           Irp->Tail.Overlay.DriverContext[2] = 0;