mirror of
https://github.com/reactos/reactos.git
synced 2024-11-25 20:43:31 +08:00
[FREELDR] Hack: Boot ReactOS even when a cdrom-drive does not report a proper geometry
We need to find a way to retrieve the LBA sector count of a drive, not only its CHS geometry.
This commit is contained in:
parent
6f5ea7cfba
commit
2ed695fc83
@ -225,7 +225,9 @@ DiskSeek(ULONG FileId, LARGE_INTEGER* Position, SEEKMODE SeekMode)
|
||||
|
||||
/* Convert in number of sectors */
|
||||
NewPosition.QuadPart /= Context->SectorSize;
|
||||
if (NewPosition.QuadPart >= Context->SectorCount)
|
||||
|
||||
/* HACK: CDROMs may have a SectorCount of 0 */
|
||||
if (Context->SectorCount != 0 && NewPosition.QuadPart >= Context->SectorCount)
|
||||
return EINVAL;
|
||||
|
||||
Context->SectorNumber = NewPosition.QuadPart;
|
||||
|
Loading…
Reference in New Issue
Block a user