/* 3k: Clear the DO_DEVICE_INITIALIZING flag */
gControllerInfo[i].DriveInfo[j].DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
+
+ /* 3l: Attempt to get drive info - if a floppy is already present */
+ StartMotor(&gControllerInfo[i].DriveInfo[j]);
+ RWDetermineMediaType(&gControllerInfo[i].DriveInfo[j], TRUE);
+ StopMotor(gControllerInfo[i].DriveInfo[j].ControllerInfo);
}
}
}
-static NTSTATUS NTAPI
-RWDetermineMediaType(PDRIVE_INFO DriveInfo)
+NTSTATUS NTAPI
+RWDetermineMediaType(PDRIVE_INFO DriveInfo, BOOLEAN OneShot)
/*
* FUNCTION: Determine the media type of the disk in the drive and fill in the geometry
* ARGUMENTS:
/*
* This algorithm assumes that a 1.44MB floppy is in the drive. If it's not,
- * it works backwards until the read works. Note that only 1.44 has been tested
- * at all.
+ * it works backwards until the read works unless OneShot try is asked.
+ * Note that only 1.44 has been tested at all.
*/
do
if(HwReadIdResult(DriveInfo->ControllerInfo, NULL, NULL) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "RWDetermineMediaType(): ReadIdResult failed; continuing\n");
- continue;
+ if (OneShot)
+ break;
+ else
+ continue;
}
/* Found the media; populate the geometry now */
*/
if(DriveInfo->DiskGeometry.MediaType == Unknown)
{
- if(RWDetermineMediaType(DriveInfo) != STATUS_SUCCESS)
+ if(RWDetermineMediaType(DriveInfo, FALSE) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "ReadWritePassive(): unable to determine media type; completing with STATUS_UNSUCCESSFUL\n");
IoCompleteRequest(Irp, IO_NO_INCREMENT);