[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:
Eric Kohl 2019-09-19 23:24:43 +02:00
parent 6f5ea7cfba
commit 2ed695fc83

View file

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