projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6f5ea7c
)
[FREELDR] Hack: Boot ReactOS even when a cdrom-drive does not report a proper geometry
author
Eric Kohl
<eric.kohl@reactos.org>
Thu, 19 Sep 2019 21:24:43 +0000
(23:24 +0200)
committer
Eric Kohl
<eric.kohl@reactos.org>
Thu, 19 Sep 2019 21:27:11 +0000
(23:27 +0200)
We need to find a way to retrieve the LBA sector count of a drive, not only its CHS geometry.
boot/freeldr/freeldr/arch/i386/hwdisk.c
patch
|
blob
|
history
diff --git
a/boot/freeldr/freeldr/arch/i386/hwdisk.c
b/boot/freeldr/freeldr/arch/i386/hwdisk.c
index
d67494d
..
1717bdb
100644
(file)
--- a/
boot/freeldr/freeldr/arch/i386/hwdisk.c
+++ b/
boot/freeldr/freeldr/arch/i386/hwdisk.c
@@
-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;