Index: drivers/storage/floppy/readwrite.c =================================================================== --- drivers/storage/floppy/readwrite.c (revision 30572) +++ drivers/storage/floppy/readwrite.c (working copy) @@ -365,8 +365,8 @@ DPRINT("floppy: RWComputeCHS: Called with offset 0x%x\n", DiskByteOffset); - /* First calculate the 1-based "absolute sector" based on the byte offset */ - ASSERT(!(DiskByteOffset % DriveInfo->DiskGeometry.BytesPerSector)); /* FIXME: Only handle full sector transfers atm */ + if(DiskByteOffset % DriveInfo->DiskGeometry.BytesPerSector) /* FIXME: Only handle full sector transfers atm */ + DPRINT("FIXME: Partial sector requests are not supported\n"); /* AbsoluteSector is zero-based to make the math a little easier */ AbsoluteSector = DiskByteOffset / DriveInfo->DiskGeometry.BytesPerSector; /* Num full sectors */ @@ -759,7 +759,7 @@ DPRINT("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); } Index: drivers/storage/floppy/floppy.c =================================================================== --- drivers/storage/floppy/floppy.c (revision 30572) +++ drivers/storage/floppy/floppy.c (working copy) @@ -687,16 +687,16 @@ return STATUS_IO_DEVICE_ERROR; } -/* Check if floppy drive exists */ + /* Check if floppy drive exists */ if(HwSenseInterruptStatus(ControllerInfo) != STATUS_SUCCESS) - { - DPRINT("floppy: Floppy drive not detected! Returning STATUS_IO_DEVICE_ERROR\n"); - return STATUS_IO_DEVICE_ERROR; - } + { + DPRINT("floppy: Floppy drive not detected; bailing\n"); + return STATUS_DEVICE_DOES_NOT_EXIST; + } -DPRINT("floppy: InitController: resetting the controller after floppy detection\n"); + DPRINT("floppy: InitController: resetting the controller after floppy detection\n"); - /* Reset the controller */ + /* Reset the controller again after floppy detection */ if(HwReset(ControllerInfo) != STATUS_SUCCESS) { DPRINT("floppy: InitController: unable to reset controller\n"); @@ -985,6 +985,9 @@ /* 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: We're done */ + gControllerInfo[i].DriveInfo[j].DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; } } Index: drivers/storage/floppy/ioctl.c =================================================================== --- drivers/storage/floppy/ioctl.c (revision 30572) +++ drivers/storage/floppy/ioctl.c (working copy) @@ -244,6 +244,7 @@ /* This still works right even if DriveInfo->DiskGeometry->MediaType = Unknown */ memcpy(OutputBuffer, &DriveInfo->DiskGeometry, sizeof(DISK_GEOMETRY)); + Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = sizeof(DISK_GEOMETRY); break; } @@ -251,11 +252,13 @@ case IOCTL_DISK_FORMAT_TRACKS: case IOCTL_DISK_FORMAT_TRACKS_EX: DPRINT("floppy: Format called; not supported yet\n"); + Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; + Irp->IoStatus.Information = 0; break; case IOCTL_DISK_GET_PARTITION_INFO: - DPRINT("floppy: IOCTL_DISK_GET_PARTITION_INFO Called; not supported\n"); - Irp->IoStatus.Status = STATUS_NOT_SUPPORTED; + DPRINT("floppy: IOCTL_DISK_GET_PARTITION_INFO Called; We don't have partitions on a floppy\n"); + Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; Irp->IoStatus.Information = 0; break; Index: drivers/storage/floppy/csqrtns.c =================================================================== --- drivers/storage/floppy/csqrtns.c (revision 30572) +++ drivers/storage/floppy/csqrtns.c (working copy) @@ -176,5 +176,6 @@ DPRINT("CSQ: Inserting IRP 0x%p\n", Irp); InsertTailList(&IrpQueue, &Irp->Tail.Overlay.ListEntry); KeReleaseSemaphore(&QueueSemaphore, 0, 1, FALSE); + IoMarkIrpPending(Irp); }