Fixed a length calculation bug introduced with transfer-splitting code

--> big file transfers work now

svn path=/trunk/; revision=8638
This commit is contained in:
Vizzini 2004-03-11 07:01:58 +00:00
parent 8438bc1293
commit 8e37499a90

View file

@ -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));