X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fboot%2Ffreeldr%2Ffreeldr%2Farch%2Fi386%2Fhardware.c;h=007ed197320c2c3acda3d7f4259a203542b48385;hp=6022e782b74d54bba2a0c3b95923b66198255721;hb=035a83011ebd8664671f7183d72f9022cca9e81e;hpb=2d7ba2275a0ef27e4d1d3a4d6a1e945b9f232788 diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c index 6022e782b74..007ed197320 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c @@ -467,7 +467,7 @@ static LONG DiskRead(ULONG FileId, VOID* Buffer, ULONG N, ULONG* Count) { DISKCONTEXT* Context = FsGetDeviceSpecific(FileId); UCHAR* Ptr = (UCHAR*)Buffer; - ULONG i, Length, Sectors; + ULONG i, Length; BOOLEAN ret; *Count = 0; @@ -475,13 +475,12 @@ static LONG DiskRead(ULONG FileId, VOID* Buffer, ULONG N, ULONG* Count) while (N > 0) { Length = N; - if (Length > DISKREADBUFFER_SIZE) - Length = DISKREADBUFFER_SIZE; - Sectors = (Length + Context->SectorSize - 1) / Context->SectorSize; + if (Length > Context->SectorSize) + Length = Context->SectorSize; ret = MachDiskReadLogicalSectors( Context->DriveNumber, Context->SectorNumber + Context->SectorOffset + i, - Sectors, + 1, (PVOID)DISKREADBUFFER); if (!ret) return EIO; @@ -489,7 +488,7 @@ static LONG DiskRead(ULONG FileId, VOID* Buffer, ULONG N, ULONG* Count) Ptr += Length; *Count += Length; N -= Length; - i += Sectors; + i++; } return ESUCCESS;