From 8e37499a908f9bda5163ad016f11365dd6c25c29 Mon Sep 17 00:00:00 2001 From: Vizzini Date: Thu, 11 Mar 2004 07:01:58 +0000 Subject: [PATCH] Fixed a length calculation bug introduced with transfer-splitting code --> big file transfers work now svn path=/trunk/; revision=8638 --- reactos/drivers/storage/floppy/readwrite.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/storage/floppy/readwrite.c b/reactos/drivers/storage/floppy/readwrite.c index bc5a851dd4b..13efa2afa06 100644 --- a/reactos/drivers/storage/floppy/readwrite.c +++ b/reactos/drivers/storage/floppy/readwrite.c @@ -660,10 +660,15 @@ VOID NTAPI ReadWritePassive(PDRIVE_INFO DriveInfo, KdPrint(("floppy: ReadWritePassive(): computing number of sectors to transfer (StartSector 0x%x): ", StartSector)); /* 1-based sector number */ - if( (DriveInfo->DiskGeometry.SectorsPerTrack - StartSector + 1) < Length / DriveInfo->DiskGeometry.BytesPerSector) + if( (DriveInfo->DiskGeometry.SectorsPerTrack - StartSector + 1) < + (Length - TransferByteOffset) / DriveInfo->DiskGeometry.BytesPerSector) + { CurrentTransferSectors = (UCHAR)DriveInfo->DiskGeometry.SectorsPerTrack - StartSector + 1; + } else - CurrentTransferSectors = (UCHAR)(Length / DriveInfo->DiskGeometry.BytesPerSector); + { + CurrentTransferSectors = (UCHAR)((Length - TransferByteOffset) / DriveInfo->DiskGeometry.BytesPerSector); + } KdPrint(("0x%x\n", CurrentTransferSectors));