mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 19:14:48 +00:00
[FREELDR]
PcDiskGetDriveGeometry: Try to retrieve the extended disk geometry first. svn path=/trunk/; revision=54505
This commit is contained in:
parent
320ca8654d
commit
02a1138b90
1 changed files with 13 additions and 0 deletions
|
@ -302,12 +302,25 @@ BOOLEAN PcDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULON
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
PcDiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY Geometry)
|
PcDiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY Geometry)
|
||||||
{
|
{
|
||||||
|
EXTENDED_GEOMETRY ExtGeometry;
|
||||||
REGS RegsIn;
|
REGS RegsIn;
|
||||||
REGS RegsOut;
|
REGS RegsOut;
|
||||||
ULONG Cylinders;
|
ULONG Cylinders;
|
||||||
|
|
||||||
TRACE("DiskGetDriveGeometry()\n");
|
TRACE("DiskGetDriveGeometry()\n");
|
||||||
|
|
||||||
|
/* Try to get the extended geometry first */
|
||||||
|
ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY);
|
||||||
|
if (DiskGetExtendedDriveParameters(DriveNumber, &ExtGeometry, ExtGeometry.Size))
|
||||||
|
{
|
||||||
|
Geometry->Cylinders = ExtGeometry.Cylinders;
|
||||||
|
Geometry->Heads = ExtGeometry.Heads;
|
||||||
|
Geometry->Sectors = ExtGeometry.SectorsPerTrack;
|
||||||
|
Geometry->BytesPerSector = ExtGeometry.BytesPerSector;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* BIOS Int 13h, function 08h - Get drive parameters
|
/* BIOS Int 13h, function 08h - Get drive parameters
|
||||||
* AH = 08h
|
* AH = 08h
|
||||||
* DL = drive (bit 7 set for hard disk)
|
* DL = drive (bit 7 set for hard disk)
|
||||||
|
|
Loading…
Reference in a new issue