fixed a couple motor start/stop bugs; fixed a seek offset
authorVizzini <vizzini@plasmic.com>
Sat, 13 Mar 2004 05:06:49 +0000 (05:06 +0000)
committerVizzini <vizzini@plasmic.com>
Sat, 13 Mar 2004 05:06:49 +0000 (05:06 +0000)
svn path=/trunk/; revision=8678

reactos/drivers/storage/floppy/floppy.c
reactos/drivers/storage/floppy/readwrite.c

index 27c34ab..5299957 100644 (file)
@@ -326,7 +326,7 @@ NTSTATUS NTAPI ResetChangeFlag(PDRIVE_INFO DriveInfo)
     }
 
   /* Seek back to 0 */
-  if(HwSeek(DriveInfo, 1) != STATUS_SUCCESS)
+  if(HwSeek(DriveInfo, 0) != STATUS_SUCCESS)
     {
       KdPrint(("floppy: ResetChangeFlag(): HwSeek failed; returning STATUS_IO_DEVICE_ERROR\n"));
       StopMotor(DriveInfo->ControllerInfo);
index 8e7e80a..d3d0b68 100644 (file)
@@ -458,10 +458,12 @@ VOID NTAPI ReadWritePassive(PDRIVE_INFO DriveInfo,
   /*
    * Check the change line, and if it's set, return
    */
+  StartMotor(DriveInfo);
   if(HwDiskChanged(DeviceObject->DeviceExtension, &DiskChanged) != STATUS_SUCCESS)
     {
       KdPrint(("floppy: ReadWritePassive(): unable to detect disk change; Completing with STATUS_UNSUCCESSFUL\n"));
       IoCompleteRequest(Irp, IO_NO_INCREMENT);
+      StopMotor(DriveInfo->ControllerInfo);
       return;
     }
       
@@ -479,12 +481,10 @@ VOID NTAPI ReadWritePassive(PDRIVE_INFO DriveInfo,
        Irp->IoStatus.Status = STATUS_NO_MEDIA_IN_DEVICE;
 
       IoCompleteRequest(Irp, IO_NO_INCREMENT);
+      StopMotor(DriveInfo->ControllerInfo);
       return;
     }
 
-  /* Start the motor and set the initial data rate */
-  StartMotor(DriveInfo);
-
   /* 
    * Figure out the media type, if we don't know it already 
    */