17#define MaxDriveNumber 0xFF
37 TRACE(
"Dumping partition table for drive 0x%x:\n", DriveNumber);
38 TRACE(
"Boot record logical start sector = %d\n", LogicalSectorNumber);
43 TRACE(
"-------------------------------------------\n");
45 TRACE(
"BootIndicator: 0x%x\n", BootRecord->PartitionTable[
Index].BootIndicator);
46 TRACE(
"StartHead: 0x%x\n", BootRecord->PartitionTable[
Index].StartHead);
47 TRACE(
"StartSector (Plus 2 cylinder bits): 0x%x\n", BootRecord->PartitionTable[
Index].StartSector);
48 TRACE(
"StartCylinder: 0x%x\n", BootRecord->PartitionTable[
Index].StartCylinder);
49 TRACE(
"SystemIndicator: 0x%x\n", BootRecord->PartitionTable[
Index].SystemIndicator);
50 TRACE(
"EndHead: 0x%x\n", BootRecord->PartitionTable[
Index].EndHead);
51 TRACE(
"EndSector (Plus 2 cylinder bits): 0x%x\n", BootRecord->PartitionTable[
Index].EndSector);
52 TRACE(
"EndCylinder: 0x%x\n", BootRecord->PartitionTable[
Index].EndCylinder);
53 TRACE(
"SectorCountBeforePartition: 0x%x\n", BootRecord->PartitionTable[
Index].SectorCountBeforePartition);
54 TRACE(
"PartitionSectorCount: 0x%x\n", BootRecord->PartitionTable[
Index].PartitionSectorCount);
58 return (BootRecord->MasterBootRecordMagic == 0xaa55);
97 if (PartitionCount == 1 && GPTProtect)
112 TRACE(
"Drive 0x%X partition type Xbox-BRFR\n", DriveNumber);
118 TRACE(
"Drive 0x%X partition type unknown\n", DriveNumber);
141 PartitionEntry, BootPartition);
145 FIXME(
"DiskGetBootPartitionEntry() unimplemented for GPT\n");
148 case PARTITION_STYLE_RAW:
150 FIXME(
"DiskGetBootPartitionEntry() unimplemented for RAW\n");
153 case PARTITION_STYLE_BRFR:
157 PartitionEntry = &TempPartitionEntry;
170 ERR(
"Drive 0x%X partition type = %d, should not happen!\n", DriveNumber,
DiskPartitionType[DriveNumber]);
193 ERR(
"Drive 0x%X: Invalid sector size %lu\n", DriveNumber,
SectorSize);
214 case PARTITION_STYLE_RAW:
216 FIXME(
"DiskGetPartitionEntry() unimplemented for RAW\n");
219 case PARTITION_STYLE_BRFR:
228 ERR(
"Drive 0x%X partition type = %d, should not happen!\n", DriveNumber,
DiskPartitionType[DriveNumber]);
VOID DiskDetectPartitionType(_In_ UCHAR DriveNumber)
BOOLEAN DiskGetBootPartitionEntry(_In_ UCHAR DriveNumber, _Out_opt_ PPARTITION_INFORMATION PartitionEntry, _Out_ PULONG BootPartition)
BOOLEAN DiskReadBootRecord(IN UCHAR DriveNumber, IN ULONGLONG LogicalSectorNumber, OUT PMASTER_BOOT_RECORD BootRecord)
BOOLEAN DiskGetPartitionEntry(_In_ UCHAR DriveNumber, _In_opt_ ULONG SectorSize, _In_ ULONG PartitionNumber, _Out_ PPARTITION_INFORMATION PartitionEntry)
static PARTITION_STYLE DiskPartitionType[MaxDriveNumber+1]
#define DBG_DEFAULT_CHANNEL(ch)
#define MachDiskGetDriveGeometry(Drive, Geom)
#define MachDiskReadLogicalSectors(Drive, Start, Count, Buf)
enum _PARTITION_STYLE PARTITION_STYLE
static BOOLEAN DiskIsBrfr(_In_ UCHAR DriveNumber)
#define FATX_DATA_PARTITION
BOOLEAN DiskGetBrfrPartitionEntry(_In_ UCHAR DriveNumber, _In_ ULONG SectorSize, _In_ ULONG PartitionNumber, _Out_ PPARTITION_INFORMATION PartitionEntry)
BOOLEAN DiskGetGptPartitionEntry(_In_ UCHAR DriveNumber, _In_ ULONG SectorSize, _In_ ULONG PartitionNumber, _Out_ PPARTITION_INFORMATION PartitionEntry)
BOOLEAN DiskGetMbrPartitionEntry(_In_ UCHAR DriveNumber, _In_ ULONG SectorSize, _In_ ULONG PartitionNumber, _Out_ PPARTITION_INFORMATION PartitionEntry)
BOOLEAN DiskGetActivePartitionEntry(_In_ UCHAR DriveNumber, _In_ ULONG SectorSize, _Out_opt_ PPARTITION_INFORMATION PartitionEntry, _Out_ PULONG ActivePartition)
#define PARTITION_ENTRY_UNUSED
PARTITION_TABLE_ENTRY PartitionTable[4]
ULONG BytesPerSector
Number of bytes per sector.
#define RtlCopyMemory(Destination, Source, Length)
BOOLEAN DiskReadGptHeader(_In_ UCHAR DriveNumber, _Out_ PGPT_TABLE_HEADER GptHeader)
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ ULONG _In_ ULONG PartitionNumber