mirror of
https://github.com/reactos/reactos.git
synced 2024-09-16 07:39:32 +00:00
[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:
parent
fc022a8506
commit
682cf08ee8
|
@ -433,41 +433,22 @@ static LONG DiskOpen(CHAR* Path, OPENMODE OpenMode, ULONG* FileId)
|
||||||
ULONGLONG SectorOffset = 0;
|
ULONGLONG SectorOffset = 0;
|
||||||
ULONGLONG SectorCount = 0;
|
ULONGLONG SectorCount = 0;
|
||||||
PARTITION_TABLE_ENTRY PartitionTableEntry;
|
PARTITION_TABLE_ENTRY PartitionTableEntry;
|
||||||
GEOMETRY Geometry;
|
|
||||||
EXTENDED_GEOMETRY ExtGeometry;
|
|
||||||
CHAR FileName[1];
|
CHAR FileName[1];
|
||||||
|
|
||||||
if (!DissectArcPath(Path, FileName, &DriveNumber, &DrivePartition))
|
if (!DissectArcPath(Path, FileName, &DriveNumber, &DrivePartition))
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY);
|
if (DrivePartition == 0xff)
|
||||||
if (DiskGetExtendedDriveParameters(DriveNumber, &ExtGeometry, ExtGeometry.Size))
|
|
||||||
{
|
{
|
||||||
SectorSize = ExtGeometry.BytesPerSector;
|
/* This is a CD-ROM device */
|
||||||
SectorCount = ExtGeometry.Sectors;
|
SectorSize = 2048;
|
||||||
}
|
|
||||||
else if (MachDiskGetDriveGeometry(DriveNumber, &Geometry))
|
|
||||||
{
|
|
||||||
SectorSize = Geometry.BytesPerSector;
|
|
||||||
SectorCount = Geometry.Sectors;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DPRINTM(DPRINT_HWDETECT, "Using legacy sector size detection\n");
|
/* This is either a floppy disk device (DrivePartition == 0) or
|
||||||
|
* a hard disk device (DrivePartition != 0 && DrivePartition != 0xFF) but
|
||||||
/* Fall back to legacy detection */
|
* it doesn't matter which one because they both have 512 bytes per sector */
|
||||||
if (DrivePartition == 0xff)
|
SectorSize = 512;
|
||||||
{
|
|
||||||
/* 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DrivePartition != 0xff && DrivePartition != 0)
|
if (DrivePartition != 0xff && DrivePartition != 0)
|
||||||
|
|
Loading…
Reference in a new issue