mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[FREELDR] Move around & static-ify some disk/partition functions.
This commit is contained in:
parent
32fb2e7b5f
commit
41ad62ea69
|
@ -49,9 +49,98 @@ static struct
|
||||||
{ 0x002EE400, 0x00177000, PARTITION_FAT_16 } /* Cache3, Z: */
|
{ 0x002EE400, 0x00177000, PARTITION_FAT_16 } /* Cache3, Z: */
|
||||||
};
|
};
|
||||||
|
|
||||||
BOOLEAN DiskGetActivePartitionEntry(UCHAR DriveNumber,
|
static BOOLEAN
|
||||||
PPARTITION_TABLE_ENTRY PartitionTableEntry,
|
DiskReadBootRecord(
|
||||||
ULONG *ActivePartition)
|
IN UCHAR DriveNumber,
|
||||||
|
IN ULONGLONG LogicalSectorNumber,
|
||||||
|
OUT PMASTER_BOOT_RECORD BootRecord)
|
||||||
|
{
|
||||||
|
ULONG Index;
|
||||||
|
|
||||||
|
/* Read master boot record */
|
||||||
|
if (!MachDiskReadLogicalSectors(DriveNumber, LogicalSectorNumber, 1, DiskReadBuffer))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
RtlCopyMemory(BootRecord, DiskReadBuffer, sizeof(MASTER_BOOT_RECORD));
|
||||||
|
|
||||||
|
TRACE("Dumping partition table for drive 0x%x:\n", DriveNumber);
|
||||||
|
TRACE("Boot record logical start sector = %d\n", LogicalSectorNumber);
|
||||||
|
TRACE("sizeof(MASTER_BOOT_RECORD) = 0x%x.\n", sizeof(MASTER_BOOT_RECORD));
|
||||||
|
|
||||||
|
for (Index = 0; Index < 4; Index++)
|
||||||
|
{
|
||||||
|
TRACE("-------------------------------------------\n");
|
||||||
|
TRACE("Partition %d\n", (Index + 1));
|
||||||
|
TRACE("BootIndicator: 0x%x\n", BootRecord->PartitionTable[Index].BootIndicator);
|
||||||
|
TRACE("StartHead: 0x%x\n", BootRecord->PartitionTable[Index].StartHead);
|
||||||
|
TRACE("StartSector (Plus 2 cylinder bits): 0x%x\n", BootRecord->PartitionTable[Index].StartSector);
|
||||||
|
TRACE("StartCylinder: 0x%x\n", BootRecord->PartitionTable[Index].StartCylinder);
|
||||||
|
TRACE("SystemIndicator: 0x%x\n", BootRecord->PartitionTable[Index].SystemIndicator);
|
||||||
|
TRACE("EndHead: 0x%x\n", BootRecord->PartitionTable[Index].EndHead);
|
||||||
|
TRACE("EndSector (Plus 2 cylinder bits): 0x%x\n", BootRecord->PartitionTable[Index].EndSector);
|
||||||
|
TRACE("EndCylinder: 0x%x\n", BootRecord->PartitionTable[Index].EndCylinder);
|
||||||
|
TRACE("SectorCountBeforePartition: 0x%x\n", BootRecord->PartitionTable[Index].SectorCountBeforePartition);
|
||||||
|
TRACE("PartitionSectorCount: 0x%x\n", BootRecord->PartitionTable[Index].PartitionSectorCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check the partition table magic value */
|
||||||
|
if (BootRecord->MasterBootRecordMagic != 0xaa55)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOLEAN
|
||||||
|
DiskGetFirstPartitionEntry(
|
||||||
|
IN PMASTER_BOOT_RECORD MasterBootRecord,
|
||||||
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
||||||
|
{
|
||||||
|
ULONG Index;
|
||||||
|
|
||||||
|
for (Index = 0; Index < 4; Index++)
|
||||||
|
{
|
||||||
|
/* Check the system indicator. If it's not an extended or unused partition then we're done. */
|
||||||
|
if ((MasterBootRecord->PartitionTable[Index].SystemIndicator != PARTITION_ENTRY_UNUSED) &&
|
||||||
|
(MasterBootRecord->PartitionTable[Index].SystemIndicator != PARTITION_EXTENDED) &&
|
||||||
|
(MasterBootRecord->PartitionTable[Index].SystemIndicator != PARTITION_XINT13_EXTENDED))
|
||||||
|
{
|
||||||
|
RtlCopyMemory(PartitionTableEntry, &MasterBootRecord->PartitionTable[Index], sizeof(PARTITION_TABLE_ENTRY));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOLEAN
|
||||||
|
DiskGetFirstExtendedPartitionEntry(
|
||||||
|
IN PMASTER_BOOT_RECORD MasterBootRecord,
|
||||||
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
||||||
|
{
|
||||||
|
ULONG Index;
|
||||||
|
|
||||||
|
for (Index = 0; Index < 4; Index++)
|
||||||
|
{
|
||||||
|
/* Check the system indicator. If it an extended partition then we're done. */
|
||||||
|
if ((MasterBootRecord->PartitionTable[Index].SystemIndicator == PARTITION_EXTENDED) ||
|
||||||
|
(MasterBootRecord->PartitionTable[Index].SystemIndicator == PARTITION_XINT13_EXTENDED))
|
||||||
|
{
|
||||||
|
RtlCopyMemory(PartitionTableEntry, &MasterBootRecord->PartitionTable[Index], sizeof(PARTITION_TABLE_ENTRY));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static BOOLEAN
|
||||||
|
DiskGetActivePartitionEntry(
|
||||||
|
IN UCHAR DriveNumber,
|
||||||
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry,
|
||||||
|
OUT PULONG ActivePartition)
|
||||||
{
|
{
|
||||||
ULONG BootablePartitionCount = 0;
|
ULONG BootablePartitionCount = 0;
|
||||||
ULONG CurrentPartitionNumber;
|
ULONG CurrentPartitionNumber;
|
||||||
|
@ -61,14 +150,14 @@ BOOLEAN DiskGetActivePartitionEntry(UCHAR DriveNumber,
|
||||||
|
|
||||||
*ActivePartition = 0;
|
*ActivePartition = 0;
|
||||||
|
|
||||||
// Read master boot record
|
/* Read master boot record */
|
||||||
if (!DiskReadBootRecord(DriveNumber, 0, &MasterBootRecord))
|
if (!DiskReadBootRecord(DriveNumber, 0, &MasterBootRecord))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentPartitionNumber = 0;
|
CurrentPartitionNumber = 0;
|
||||||
for (Index=0; Index<4; Index++)
|
for (Index = 0; Index < 4; Index++)
|
||||||
{
|
{
|
||||||
ThisPartitionTableEntry = &MasterBootRecord.PartitionTable[Index];
|
ThisPartitionTableEntry = &MasterBootRecord.PartitionTable[Index];
|
||||||
|
|
||||||
|
@ -78,13 +167,13 @@ BOOLEAN DiskGetActivePartitionEntry(UCHAR DriveNumber,
|
||||||
{
|
{
|
||||||
CurrentPartitionNumber++;
|
CurrentPartitionNumber++;
|
||||||
|
|
||||||
// Test if this is the bootable partition
|
/* Test if this is the bootable partition */
|
||||||
if (ThisPartitionTableEntry->BootIndicator == 0x80)
|
if (ThisPartitionTableEntry->BootIndicator == 0x80)
|
||||||
{
|
{
|
||||||
BootablePartitionCount++;
|
BootablePartitionCount++;
|
||||||
*ActivePartition = CurrentPartitionNumber;
|
*ActivePartition = CurrentPartitionNumber;
|
||||||
|
|
||||||
// Copy the partition table entry
|
/* Copy the partition table entry */
|
||||||
RtlCopyMemory(PartitionTableEntry,
|
RtlCopyMemory(PartitionTableEntry,
|
||||||
ThisPartitionTableEntry,
|
ThisPartitionTableEntry,
|
||||||
sizeof(PARTITION_TABLE_ENTRY));
|
sizeof(PARTITION_TABLE_ENTRY));
|
||||||
|
@ -92,7 +181,7 @@ BOOLEAN DiskGetActivePartitionEntry(UCHAR DriveNumber,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure there was only one bootable partition
|
/* Make sure there was only one bootable partition */
|
||||||
if (BootablePartitionCount == 0)
|
if (BootablePartitionCount == 0)
|
||||||
{
|
{
|
||||||
ERR("No bootable (active) partitions found.\n");
|
ERR("No bootable (active) partitions found.\n");
|
||||||
|
@ -107,7 +196,11 @@ BOOLEAN DiskGetActivePartitionEntry(UCHAR DriveNumber,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN DiskGetMbrPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
static BOOLEAN
|
||||||
|
DiskGetMbrPartitionEntry(
|
||||||
|
IN UCHAR DriveNumber,
|
||||||
|
IN ULONG PartitionNumber,
|
||||||
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
||||||
{
|
{
|
||||||
MASTER_BOOT_RECORD MasterBootRecord;
|
MASTER_BOOT_RECORD MasterBootRecord;
|
||||||
PARTITION_TABLE_ENTRY ExtendedPartitionTableEntry;
|
PARTITION_TABLE_ENTRY ExtendedPartitionTableEntry;
|
||||||
|
@ -117,14 +210,14 @@ BOOLEAN DiskGetMbrPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPART
|
||||||
ULONG CurrentPartitionNumber;
|
ULONG CurrentPartitionNumber;
|
||||||
PPARTITION_TABLE_ENTRY ThisPartitionTableEntry;
|
PPARTITION_TABLE_ENTRY ThisPartitionTableEntry;
|
||||||
|
|
||||||
// Read master boot record
|
/* Read master boot record */
|
||||||
if (!DiskReadBootRecord(DriveNumber, 0, &MasterBootRecord))
|
if (!DiskReadBootRecord(DriveNumber, 0, &MasterBootRecord))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentPartitionNumber = 0;
|
CurrentPartitionNumber = 0;
|
||||||
for (Index=0; Index<4; Index++)
|
for (Index = 0; Index < 4; Index++)
|
||||||
{
|
{
|
||||||
ThisPartitionTableEntry = &MasterBootRecord.PartitionTable[Index];
|
ThisPartitionTableEntry = &MasterBootRecord.PartitionTable[Index];
|
||||||
|
|
||||||
|
@ -142,136 +235,63 @@ BOOLEAN DiskGetMbrPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPART
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// They want an extended partition entry so we will need
|
/*
|
||||||
// to loop through all the extended partitions on the disk
|
* They want an extended partition entry so we will need
|
||||||
// and return the one they want.
|
* to loop through all the extended partitions on the disk
|
||||||
|
* and return the one they want.
|
||||||
|
*/
|
||||||
ExtendedPartitionNumber = PartitionNumber - CurrentPartitionNumber - 1;
|
ExtendedPartitionNumber = PartitionNumber - CurrentPartitionNumber - 1;
|
||||||
|
|
||||||
// Set the initial relative starting sector to 0
|
/*
|
||||||
// This is because extended partition starting
|
* Set the initial relative starting sector to 0.
|
||||||
// sectors a numbered relative to their parent
|
* This is because extended partition starting
|
||||||
|
* sectors a numbered relative to their parent.
|
||||||
|
*/
|
||||||
ExtendedPartitionOffset = 0;
|
ExtendedPartitionOffset = 0;
|
||||||
|
|
||||||
for (Index=0; Index<=ExtendedPartitionNumber; Index++)
|
for (Index = 0; Index <= ExtendedPartitionNumber; Index++)
|
||||||
{
|
{
|
||||||
// Get the extended partition table entry
|
/* Get the extended partition table entry */
|
||||||
if (!DiskGetFirstExtendedPartitionEntry(&MasterBootRecord, &ExtendedPartitionTableEntry))
|
if (!DiskGetFirstExtendedPartitionEntry(&MasterBootRecord, &ExtendedPartitionTableEntry))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adjust the relative starting sector of the partition
|
/* Adjust the relative starting sector of the partition */
|
||||||
ExtendedPartitionTableEntry.SectorCountBeforePartition += ExtendedPartitionOffset;
|
ExtendedPartitionTableEntry.SectorCountBeforePartition += ExtendedPartitionOffset;
|
||||||
if (ExtendedPartitionOffset == 0)
|
if (ExtendedPartitionOffset == 0)
|
||||||
{
|
{
|
||||||
// Set the start of the parrent extended partition
|
/* Set the start of the parrent extended partition */
|
||||||
ExtendedPartitionOffset = ExtendedPartitionTableEntry.SectorCountBeforePartition;
|
ExtendedPartitionOffset = ExtendedPartitionTableEntry.SectorCountBeforePartition;
|
||||||
}
|
}
|
||||||
// Read the partition boot record
|
/* Read the partition boot record */
|
||||||
if (!DiskReadBootRecord(DriveNumber, ExtendedPartitionTableEntry.SectorCountBeforePartition, &MasterBootRecord))
|
if (!DiskReadBootRecord(DriveNumber, ExtendedPartitionTableEntry.SectorCountBeforePartition, &MasterBootRecord))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the first real partition table entry
|
/* Get the first real partition table entry */
|
||||||
if (!DiskGetFirstPartitionEntry(&MasterBootRecord, PartitionTableEntry))
|
if (!DiskGetFirstPartitionEntry(&MasterBootRecord, PartitionTableEntry))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now correct the start sector of the partition
|
/* Now correct the start sector of the partition */
|
||||||
PartitionTableEntry->SectorCountBeforePartition += ExtendedPartitionTableEntry.SectorCountBeforePartition;
|
PartitionTableEntry->SectorCountBeforePartition += ExtendedPartitionTableEntry.SectorCountBeforePartition;
|
||||||
}
|
}
|
||||||
|
|
||||||
// When we get here we should have the correct entry
|
/*
|
||||||
// already stored in PartitionTableEntry
|
* When we get here we should have the correct entry already
|
||||||
// so just return TRUE
|
* stored in PartitionTableEntry, so just return TRUE.
|
||||||
|
*/
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN DiskGetFirstPartitionEntry(PMASTER_BOOT_RECORD MasterBootRecord, PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
static BOOLEAN
|
||||||
{
|
DiskGetBrfrPartitionEntry(
|
||||||
ULONG Index;
|
IN UCHAR DriveNumber,
|
||||||
|
IN ULONG PartitionNumber,
|
||||||
for (Index=0; Index<4; Index++)
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
||||||
{
|
|
||||||
// Check the system indicator
|
|
||||||
// If it's not an extended or unused partition
|
|
||||||
// then we're done
|
|
||||||
if ((MasterBootRecord->PartitionTable[Index].SystemIndicator != PARTITION_ENTRY_UNUSED) &&
|
|
||||||
(MasterBootRecord->PartitionTable[Index].SystemIndicator != PARTITION_EXTENDED) &&
|
|
||||||
(MasterBootRecord->PartitionTable[Index].SystemIndicator != PARTITION_XINT13_EXTENDED))
|
|
||||||
{
|
|
||||||
RtlCopyMemory(PartitionTableEntry, &MasterBootRecord->PartitionTable[Index], sizeof(PARTITION_TABLE_ENTRY));
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN DiskGetFirstExtendedPartitionEntry(PMASTER_BOOT_RECORD MasterBootRecord, PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
|
||||||
{
|
|
||||||
ULONG Index;
|
|
||||||
|
|
||||||
for (Index=0; Index<4; Index++)
|
|
||||||
{
|
|
||||||
// Check the system indicator
|
|
||||||
// If it an extended partition then we're done
|
|
||||||
if ((MasterBootRecord->PartitionTable[Index].SystemIndicator == PARTITION_EXTENDED) ||
|
|
||||||
(MasterBootRecord->PartitionTable[Index].SystemIndicator == PARTITION_XINT13_EXTENDED))
|
|
||||||
{
|
|
||||||
RtlCopyMemory(PartitionTableEntry, &MasterBootRecord->PartitionTable[Index], sizeof(PARTITION_TABLE_ENTRY));
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN DiskReadBootRecord(UCHAR DriveNumber, ULONGLONG LogicalSectorNumber, PMASTER_BOOT_RECORD BootRecord)
|
|
||||||
{
|
|
||||||
ULONG Index;
|
|
||||||
|
|
||||||
// Read master boot record
|
|
||||||
if (!MachDiskReadLogicalSectors(DriveNumber, LogicalSectorNumber, 1, DiskReadBuffer))
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
RtlCopyMemory(BootRecord, DiskReadBuffer, sizeof(MASTER_BOOT_RECORD));
|
|
||||||
|
|
||||||
TRACE("Dumping partition table for drive 0x%x:\n", DriveNumber);
|
|
||||||
TRACE("Boot record logical start sector = %d\n", LogicalSectorNumber);
|
|
||||||
TRACE("sizeof(MASTER_BOOT_RECORD) = 0x%x.\n", sizeof(MASTER_BOOT_RECORD));
|
|
||||||
|
|
||||||
for (Index=0; Index<4; Index++)
|
|
||||||
{
|
|
||||||
TRACE("-------------------------------------------\n");
|
|
||||||
TRACE("Partition %d\n", (Index + 1));
|
|
||||||
TRACE("BootIndicator: 0x%x\n", BootRecord->PartitionTable[Index].BootIndicator);
|
|
||||||
TRACE("StartHead: 0x%x\n", BootRecord->PartitionTable[Index].StartHead);
|
|
||||||
TRACE("StartSector (Plus 2 cylinder bits): 0x%x\n", BootRecord->PartitionTable[Index].StartSector);
|
|
||||||
TRACE("StartCylinder: 0x%x\n", BootRecord->PartitionTable[Index].StartCylinder);
|
|
||||||
TRACE("SystemIndicator: 0x%x\n", BootRecord->PartitionTable[Index].SystemIndicator);
|
|
||||||
TRACE("EndHead: 0x%x\n", BootRecord->PartitionTable[Index].EndHead);
|
|
||||||
TRACE("EndSector (Plus 2 cylinder bits): 0x%x\n", BootRecord->PartitionTable[Index].EndSector);
|
|
||||||
TRACE("EndCylinder: 0x%x\n", BootRecord->PartitionTable[Index].EndCylinder);
|
|
||||||
TRACE("SectorCountBeforePartition: 0x%x\n", BootRecord->PartitionTable[Index].SectorCountBeforePartition);
|
|
||||||
TRACE("PartitionSectorCount: 0x%x\n", BootRecord->PartitionTable[Index].PartitionSectorCount);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the partition table magic value
|
|
||||||
if (BootRecord->MasterBootRecordMagic != 0xaa55)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
DiskGetBrfrPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Get partition entry of an Xbox-standard BRFR partitioned disk.
|
* Get partition entry of an Xbox-standard BRFR partitioned disk.
|
||||||
|
@ -296,7 +316,9 @@ DiskGetBrfrPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_T
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID DiskDetectPartitionType(UCHAR DriveNumber)
|
VOID
|
||||||
|
DiskDetectPartitionType(
|
||||||
|
IN UCHAR DriveNumber)
|
||||||
{
|
{
|
||||||
MASTER_BOOT_RECORD MasterBootRecord;
|
MASTER_BOOT_RECORD MasterBootRecord;
|
||||||
ULONG Index;
|
ULONG Index;
|
||||||
|
@ -347,9 +369,11 @@ VOID DiskDetectPartitionType(UCHAR DriveNumber)
|
||||||
TRACE("Drive 0x%X partition type unknown\n", DriveNumber);
|
TRACE("Drive 0x%X partition type unknown\n", DriveNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN DiskGetBootPartitionEntry(UCHAR DriveNumber,
|
BOOLEAN
|
||||||
PPARTITION_TABLE_ENTRY PartitionTableEntry,
|
DiskGetBootPartitionEntry(
|
||||||
ULONG *BootPartition)
|
IN UCHAR DriveNumber,
|
||||||
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry,
|
||||||
|
OUT PULONG BootPartition)
|
||||||
{
|
{
|
||||||
switch (DiskPartitionType[DriveNumber])
|
switch (DiskPartitionType[DriveNumber])
|
||||||
{
|
{
|
||||||
|
@ -385,7 +409,11 @@ BOOLEAN DiskGetBootPartitionEntry(UCHAR DriveNumber,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN DiskGetPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
BOOLEAN
|
||||||
|
DiskGetPartitionEntry(
|
||||||
|
IN UCHAR DriveNumber,
|
||||||
|
IN ULONG PartitionNumber,
|
||||||
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry)
|
||||||
{
|
{
|
||||||
switch (DiskPartitionType[DriveNumber])
|
switch (DiskPartitionType[DriveNumber])
|
||||||
{
|
{
|
||||||
|
|
|
@ -145,12 +145,21 @@ extern SIZE_T DiskReadBufferSize;
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
VOID DiskDetectPartitionType(UCHAR DriveNumber);
|
VOID
|
||||||
BOOLEAN DiskGetBootPartitionEntry(UCHAR DriveNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry, ULONG *BootPartition);
|
DiskDetectPartitionType(
|
||||||
BOOLEAN DiskGetPartitionEntry(UCHAR DriveNumber, ULONG PartitionNumber, PPARTITION_TABLE_ENTRY PartitionTableEntry);
|
IN UCHAR DriveNumber);
|
||||||
BOOLEAN DiskGetFirstPartitionEntry(PMASTER_BOOT_RECORD MasterBootRecord, PPARTITION_TABLE_ENTRY PartitionTableEntry);
|
|
||||||
BOOLEAN DiskGetFirstExtendedPartitionEntry(PMASTER_BOOT_RECORD MasterBootRecord, PPARTITION_TABLE_ENTRY PartitionTableEntry);
|
BOOLEAN
|
||||||
BOOLEAN DiskReadBootRecord(UCHAR DriveNumber, ULONGLONG LogicalSectorNumber, PMASTER_BOOT_RECORD BootRecord);
|
DiskGetBootPartitionEntry(
|
||||||
|
IN UCHAR DriveNumber,
|
||||||
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry,
|
||||||
|
OUT PULONG BootPartition);
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
DiskGetPartitionEntry(
|
||||||
|
IN UCHAR DriveNumber,
|
||||||
|
IN ULONG PartitionNumber,
|
||||||
|
OUT PPARTITION_TABLE_ENTRY PartitionTableEntry);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SCSI support (disk/scsiport.c)
|
* SCSI support (disk/scsiport.c)
|
||||||
|
|
Loading…
Reference in a new issue