[ros-diffs] [cgutman] 47577: [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

cgutman at svn.reactos.org cgutman at svn.reactos.org
Fri Jun 4 22:36:49 CEST 2010


Author: cgutman
Date: Fri Jun  4 22:36:48 2010
New Revision: 47577

URL: http://svn.reactos.org/svn/reactos?rev=47577&view=rev
Log:
[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

Modified:
    trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c

Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c?rev=47577&r1=47576&r2=47577&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Fri Jun  4 22:36:48 2010
@@ -433,41 +433,22 @@
     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))
-    {
-        SectorSize = Geometry.BytesPerSector;
-        SectorCount = Geometry.Sectors;
+    if (DrivePartition == 0xff)
+    {
+        /* 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)




More information about the Ros-diffs mailing list