Commit in reactos/drivers/storage/scsiport on MAIN
scsiport.c+18-191.54 -> 1.55
- Initialized the srb on each call to SpiSendInquiry.

reactos/drivers/storage/scsiport
scsiport.c 1.54 -> 1.55
diff -u -r1.54 -r1.55
--- scsiport.c	16 Apr 2004 13:39:46 -0000	1.54
+++ scsiport.c	23 Apr 2004 14:29:07 -0000	1.55
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: scsiport.c,v 1.54 2004/04/16 13:39:46 ekohl Exp $
+/* $Id: scsiport.c,v 1.55 2004/04/23 14:29:07 hbirr Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -1840,36 +1840,35 @@
   ULONG Bus;
   ULONG Target;
   ULONG Lun;
+  PVOID DataBuffer;
   NTSTATUS Status;
 
   DPRINT ("SpiScanAdapter() called\n");
 
-  RtlZeroMemory(&Srb,
-		sizeof(SCSI_REQUEST_BLOCK));
-  Srb.SrbFlags = SRB_FLAGS_DATA_IN;
-  Srb.DataBuffer = ExAllocatePool(NonPagedPool, 256);
-  Srb.Function = SRB_FUNCTION_EXECUTE_SCSI;
-  Srb.DataTransferLength = 255; //256;
-  Srb.CdbLength = 6;
-
-  Cdb = (PCDB) &Srb.Cdb;
-
-  Cdb->CDB6INQUIRY.OperationCode = SCSIOP_INQUIRY;
-  Cdb->CDB6INQUIRY.AllocationLength = 255;
+  DataBuffer = ExAllocatePool(NonPagedPool, 256);
 
   for (Bus = 0; Bus < DeviceExtension->PortConfig->NumberOfBuses; Bus++)
     {
-      Srb.PathId = Bus;
-
       for (Target = 0; Target < DeviceExtension->PortConfig->MaximumNumberOfTargets; Target++)
 	{
-	  Srb.TargetId = Target;
-
 	  for (Lun = 0; Lun < SCSI_MAXIMUM_LOGICAL_UNITS; Lun++)
 	    {
+              RtlZeroMemory(&Srb,
+		            sizeof(SCSI_REQUEST_BLOCK));
+              Srb.SrbFlags = SRB_FLAGS_DATA_IN;
+              Srb.DataBuffer = DataBuffer;
+              Srb.Function = SRB_FUNCTION_EXECUTE_SCSI;
+              Srb.DataTransferLength = 255; //256;
+              Srb.CdbLength = 6;
 	      Srb.Lun = Lun;
+	      Srb.PathId = Bus;
+      	      Srb.TargetId = Target;
 	      Srb.SrbStatus = SRB_STATUS_SUCCESS;
 
+              Cdb = (PCDB) &Srb.Cdb;
+
+              Cdb->CDB6INQUIRY.OperationCode = SCSIOP_INQUIRY;
+              Cdb->CDB6INQUIRY.AllocationLength = 255;
 	      Cdb->CDB6INQUIRY.LogicalUnitNumber = Lun;
 
 	      RtlZeroMemory(Srb.DataBuffer, 256);
@@ -1881,7 +1880,7 @@
 	      if (LunExtension == NULL)
 		{
 		  DPRINT("Failed to allocate the LUN extension!\n");
-		  ExFreePool(Srb.DataBuffer);
+		  ExFreePool(DataBuffer);
 		  return;
 		}
 
@@ -1909,7 +1908,7 @@
 	}
     }
 
-  ExFreePool(Srb.DataBuffer);
+  ExFreePool(DataBuffer);
 
   DPRINT ("SpiScanAdapter() done\n");
 }
CVSspam 0.2.8