mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
Correct bug in cache which could cause us to lose the last block of a file.
This is wierd and insidious, and probably was the cause of n00bs not being able to boot on occasion. svn path=/trunk/; revision=23990
This commit is contained in:
parent
68c6a664cf
commit
812b97ae66
1 changed files with 1 additions and 1 deletions
2
reactos/boot/freeldr/freeldr/cache/cache.c
vendored
2
reactos/boot/freeldr/freeldr/cache/cache.c
vendored
|
@ -138,7 +138,7 @@ BOOLEAN CacheReadDiskSectors(ULONG DiskNumber, ULONG StartSector, ULONG SectorCo
|
|||
SectorOffsetInStartBlock = StartSector % CacheManagerDrive.BlockSize;
|
||||
CopyLengthInStartBlock = (SectorCount > (CacheManagerDrive.BlockSize - SectorOffsetInStartBlock)) ? (CacheManagerDrive.BlockSize - SectorOffsetInStartBlock) : SectorCount;
|
||||
EndBlock = (StartSector + (SectorCount - 1)) / CacheManagerDrive.BlockSize;
|
||||
SectorOffsetInEndBlock = (StartSector + SectorCount) % CacheManagerDrive.BlockSize;
|
||||
SectorOffsetInEndBlock = 1 + (StartSector + (SectorCount - 1)) % CacheManagerDrive.BlockSize;
|
||||
BlockCount = (EndBlock - StartBlock) + 1;
|
||||
DbgPrint((DPRINT_CACHE, "StartBlock: %d SectorOffsetInStartBlock: %d CopyLengthInStartBlock: %d EndBlock: %d SectorOffsetInEndBlock: %d BlockCount: %d\n", StartBlock, SectorOffsetInStartBlock, CopyLengthInStartBlock, EndBlock, SectorOffsetInEndBlock, BlockCount));
|
||||
|
||||
|
|
Loading…
Reference in a new issue