- Mark the irp pending before adding it to the queue

- Fix a few comments
 - Return a better status when a drive isn't present
 - Complete the read/write irp with IO_DISK_INCREMENT instead of IO_NO_INCREMENT

svn path=/trunk/; revision=37261
This commit is contained in:
Cameron Gutman 2008-11-09 15:21:59 +00:00
parent 1fc7265fa2
commit bc6140e5eb
3 changed files with 11 additions and 7 deletions

View file

@ -175,5 +175,6 @@ VOID NTAPI CsqInsertIrp(PIO_CSQ UnusedCsq,
TRACE_(FLOPPY, "CSQ: Inserting IRP 0x%p\n", Irp);
InsertTailList(&IrpQueue, &Irp->Tail.Overlay.ListEntry);
KeReleaseSemaphore(&QueueSemaphore, 0, 1, FALSE);
IoMarkIrpPending(Irp);
}

View file

@ -686,16 +686,16 @@ static NTSTATUS NTAPI InitController(PCONTROLLER_INFO ControllerInfo)
return STATUS_IO_DEVICE_ERROR;
}
/* Check if floppy drive exists */
/* Check if floppy drive exists */
if(HwSenseInterruptStatus(ControllerInfo) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "Floppy drive not detected! Returning STATUS_IO_DEVICE_ERROR\n");
return STATUS_IO_DEVICE_ERROR;
}
{
WARN_(FLOPPY, "Floppy drive not detected!\n");
return STATUS_NO_SUCH_DEVICE;
}
INFO_(FLOPPY, "InitController: resetting the controller after floppy detection\n");
/* Reset the controller */
/* Reset the controller again after drive detection */
if(HwReset(ControllerInfo) != STATUS_SUCCESS)
{
WARN_(FLOPPY, "InitController: unable to reset controller\n");
@ -984,6 +984,9 @@ static BOOLEAN NTAPI AddControllers(PDRIVER_OBJECT DriverObject)
/* 3i: Now that we're done, set the Initialized flag so we know to free this in Unload */
gControllerInfo[i].DriveInfo[j].Initialized = TRUE;
/* 3j: Clear the DO_DEVICE_INITIALIZING flag */
gControllerInfo[i].DriveInfo[j].DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
}
}

View file

@ -758,7 +758,7 @@ VOID NTAPI ReadWritePassive(PDRIVE_INFO DriveInfo,
INFO_(FLOPPY, "ReadWritePassive(): success; Completing with STATUS_SUCCESS\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = Length;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
IoCompleteRequest(Irp, IO_DISK_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
}