[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
This commit is contained in:
Cameron Gutman 2010-06-04 20:36:48 +00:00
parent fc022a8506
commit 682cf08ee8

View file

@ -433,29 +433,11 @@ 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))
{
SectorSize = Geometry.BytesPerSector;
SectorCount = Geometry.Sectors;
}
else
{
DPRINTM(DPRINT_HWDETECT, "Using legacy sector size detection\n");
/* Fall back to legacy detection */
if (DrivePartition == 0xff)
{
/* This is a CD-ROM device */
@ -468,7 +450,6 @@ static LONG DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
* it doesn't matter which one because they both have 512 bytes per sector */
SectorSize = 512;
}
}
if (DrivePartition != 0xff && DrivePartition != 0)
{