From: Cameron Gutman Date: Fri, 4 Jun 2010 20:36:48 +0000 (+0000) Subject: [FREELOADER] X-Git-Tag: backups/header-work@57446~11^2~60 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=682cf08ee8ee22d737e883a62ff8b9d4a74d456f;ds=sidebyside [FREELOADER] - Use the old method for identifying the drive type (based on partition number) which actually works for floppies now because I changed the DrivePartition value returned (floppy = 0, cdrom = 0xFF) in a previous commit - Fixes bug 5233 svn path=/trunk/; revision=47577 --- diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c index 97577aa020c..f99e26780d6 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c @@ -433,41 +433,22 @@ static LONG DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId) ULONGLONG SectorOffset = 0; ULONGLONG SectorCount = 0; PARTITION_TABLE_ENTRY PartitionTableEntry; - GEOMETRY Geometry; - EXTENDED_GEOMETRY ExtGeometry; CHAR FileName[1]; if (!DissectArcPath(Path, FileName, &DriveNumber, &DrivePartition)) return EINVAL; - ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY); - if (DiskGetExtendedDriveParameters(DriveNumber, &ExtGeometry, ExtGeometry.Size)) - { - SectorSize = ExtGeometry.BytesPerSector; - SectorCount = ExtGeometry.Sectors; - } - else if (MachDiskGetDriveGeometry(DriveNumber, &Geometry)) + if (DrivePartition == 0xff) { - SectorSize = Geometry.BytesPerSector; - SectorCount = Geometry.Sectors; + /* This is a CD-ROM device */ + SectorSize = 2048; } else { - DPRINTM(DPRINT_HWDETECT, "Using legacy sector size detection\n"); - - /* Fall back to legacy detection */ - if (DrivePartition == 0xff) - { - /* This is a CD-ROM device */ - SectorSize = 2048; - } - else - { - /* This is either a floppy disk device (DrivePartition == 0) or - * a hard disk device (DrivePartition != 0 && DrivePartition != 0xFF) but - * it doesn't matter which one because they both have 512 bytes per sector */ - SectorSize = 512; - } + /* This is either a floppy disk device (DrivePartition == 0) or + * a hard disk device (DrivePartition != 0 && DrivePartition != 0xFF) but + * it doesn't matter which one because they both have 512 bytes per sector */ + SectorSize = 512; } if (DrivePartition != 0xff && DrivePartition != 0)