80#define PARTITION_ENTRY_SIZE 128
82#define EFI_HEADER_SIGNATURE 0x5452415020494645ULL
84#define EFI_HEADER_REVISION_1 0x00010000
86#define EFI_PMBR_OSTYPE_EFI 0xEE
88#define EFI_GUID_STRING_SIZE 0x27
90#define IS_VALID_DISK_INFO(Disk) \
92 (Disk->DeviceObject) && \
93 (Disk->SectorSize) && \
177 Count = *PartitionCount;
192 *PartitionCount =
Count;
217 if (!DiskInformation)
252 if (!DiskInformation->
Buffer)
259 *DiskBuffer = DiskInformation;
294 DriveLayout->
Signature = LayoutEx->Mbr.Signature;
297 for (
i = 0;
i < LayoutEx->PartitionCount;
i++)
325 Entry->PartitionType = Partition->Gpt.PartitionType;
326 Entry->UniquePartition = Partition->Gpt.PartitionId;
328 Entry->EndingLBA = (Partition->StartingOffset.QuadPart + Partition->PartitionLength.QuadPart - 1) /
SectorSize;
329 Entry->Attributes = Partition->Gpt.Attributes;
336 IN PCREATE_DISK_MBR DiskInfo)
365 MasterBootRecord->
Signature = DiskInfo->Signature;
383 IN PCREATE_DISK_GPT DiskInfo)
388 ULONG MaxPartitionCount, SectorsForPartitions;
412 MaxPartitionCount = DiskInfo->MaxPartitionCount;
418 FirstUsableLBA = SectorsForPartitions + 2;
420 LastUsableLBA = Disk->
SectorCount - SectorsForPartitions - 1;
533 "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
558 DPRINT(
"FSTUB: DRIVE_LAYOUT_INFORMATION_EX: %p\n", DriveLayout);
559 switch (DriveLayout->PartitionStyle)
562 if (DriveLayout->PartitionCount % 4 != 0)
564 DPRINT(
"Warning: Partition count isn't a 4-factor: %lu!\n", DriveLayout->PartitionCount);
567 DPRINT(
"Signature: %8.8x\n", DriveLayout->Mbr.Signature);
568 for (
i = 0;
i < DriveLayout->PartitionCount;
i++)
577 DPRINT(
"StartingUsableOffset: %I64x\n", DriveLayout->Gpt.StartingUsableOffset.QuadPart);
578 DPRINT(
"UsableLength: %I64x\n", DriveLayout->Gpt.UsableLength.QuadPart);
579 DPRINT(
"MaxPartitionCount: %lu\n", DriveLayout->Gpt.MaxPartitionCount);
580 for (
i = 0;
i < DriveLayout->PartitionCount;
i++)
587 DPRINT(
"Unsupported partition style: %lu\n", DriveLayout->PartitionStyle);
640 DPRINT(
"FSTUB: SET_PARTITION_INFORMATION_EX: %p\n", PartitionEntry);
642 switch (PartitionEntry->PartitionStyle)
645 DPRINT(
" PartitionType: %02x\n", PartitionEntry->Mbr.PartitionType);
653 DPRINT(
" Attributes: %I64x\n", PartitionEntry->Gpt.Attributes);
654 DPRINT(
" Name: %ws\n", PartitionEntry->Gpt.Name);
690 *PartitionStyle = PARTITION_STYLE_RAW;
715 if (DiskBuffer->Buffer)
790 *Geometry = *DiskGeometry;
827 ULONG i, HeaderCRC32, PreviousCRC32, SectoredPartitionEntriesSize, LonelyPartitions;
838 StartingSector = Disk->SectorCount - 1ULL;
843 StartingSector = 1ULL;
852 DPRINT(
"EFI::Failed reading header!\n");
867 DPRINT(
"EFI::Wrong signature/version/header size!\n");
881 DPRINT(
"EFI::Not matching header checksum!\n");
888 if (EFIHeader->
MyLBA != StartingSector)
890 DPRINT(
"EFI::Not matching starting sector!\n");
900 DPRINT(
"EFI::Lacking resources!\n");
907 for (
i = 0, PreviousCRC32 = 0;
i < SectoredPartitionEntriesSize;
i++)
916 DPRINT(
"EFI::Failed reading sector for partition entry!\n");
920 PreviousCRC32 =
RtlComputeCrc32(PreviousCRC32, Sector, Disk->SectorSize);
926 if (LonelyPartitions != 0)
936 DPRINT(
"EFI::Failed reading sector for partition entry!\n");
941 for (
i = 0;
i < LonelyPartitions;
i++)
954 *HeaderBuffer = EFIHeader;
959 DPRINT(
"EFI::Not matching partition table checksum!\n");
969 OUT PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
972 ULONG NumberOfEntries;
977 ULONGLONG SectorsForPartitions, PartitionEntryLBA;
981 PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx =
NULL;
982 ULONG i, PartitionCount, PartitionIndex, PartitionsPerSector;
1005 FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry) +
1014 if (!ReadBackupTable)
1021 if ((Disk->SectorCount - 1ULL) != EfiHeader->
AlternateLBA)
1028 EfiHeader->
LastUsableLBA = Disk->SectorCount - SectorsForPartitions - 1;
1030 UpdatedPartitionTable =
TRUE;
1037 DriveLayoutEx->Gpt.StartingUsableOffset.QuadPart = EfiHeader->
FirstUsableLBA * Disk->SectorSize;
1040 DriveLayoutEx->Gpt.DiskId = EfiHeader->
DiskGUID;
1050 for (
i = 0, PartitionCount = 0, PartitionIndex = PartitionsPerSector;
1051 i < NumberOfEntries;
1055 if (PartitionIndex == PartitionsPerSector)
1059 PartitionEntryLBA + (
i / PartitionsPerSector),
1083 DriveLayoutEx->PartitionEntry[PartitionCount].StartingOffset.QuadPart = PartitionEntry.
StartingLBA * Disk->SectorSize;
1084 DriveLayoutEx->PartitionEntry[PartitionCount].PartitionLength.QuadPart = (PartitionEntry.
EndingLBA -
1088 DriveLayoutEx->PartitionEntry[PartitionCount].PartitionNumber = PartitionCount + 1;
1089 DriveLayoutEx->PartitionEntry[PartitionCount].RewritePartition =
FALSE;
1091 DriveLayoutEx->PartitionEntry[PartitionCount].Gpt.PartitionType = PartitionEntry.
PartitionType;
1092 DriveLayoutEx->PartitionEntry[PartitionCount].Gpt.PartitionId = PartitionEntry.
UniquePartition;
1093 DriveLayoutEx->PartitionEntry[PartitionCount].Gpt.Attributes = PartitionEntry.
Attributes;
1094 RtlCopyMemory(DriveLayoutEx->PartitionEntry[PartitionCount].Gpt.Name,
1095 PartitionEntry.
Name,
sizeof(PartitionEntry.
Name));
1100 DriveLayoutEx->PartitionCount = PartitionCount;
1104 if (UpdatedPartitionTable)
1112 *DriveLayout = DriveLayoutEx;
1121 OUT PDRIVE_LAYOUT_INFORMATION_EX* ReturnedDriveLayout)
1126 PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx =
NULL;
1131 ASSERT(ReturnedDriveLayout);
1134 *ReturnedDriveLayout =
NULL;
1148 FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry) +
1161 DriveLayoutEx->Mbr.Signature = DriveLayout->
Signature;
1178 *ReturnedDriveLayout = DriveLayoutEx;
1245 PDRIVE_LAYOUT_INFORMATION_EX Layout =
NULL;
1295 ULONGLONG ReadPosition, WritePosition, SectorsForPartitions, PartitionIndex;
1308 PrimaryValid =
TRUE;
1322 if (PrimaryValid && BackupValid)
1331 if ((!PrimaryValid && !BackupValid) || !
FixErrors)
1343 WritePosition = Disk->SectorCount - SectorsForPartitions;
1345 ReadPosition = 2ULL;
1347 DPRINT(
"EFI::Will repair backup table from primary\n");
1352 WriteBackup =
FALSE;
1354 WritePosition = 2ULL;
1356 ReadPosition = Disk->SectorCount - SectorsForPartitions;
1358 DPRINT(
"EFI::Will repair primary table from backup\n");
1361 PartitionIndex = 0
ULL;
1364 if (SectorsForPartitions <= 0)
1367 SectorsForPartitions,
1379 for (; PartitionIndex < SectorsForPartitions; ++PartitionIndex)
1384 ReadPosition + PartitionIndex,
1394 WritePosition + PartitionIndex,
1404 SectorsForPartitions,
1472 IN ULONG PartitionsSizeSector,
1473 IN ULONG PartitionEntryNumber,
1492 if (!WriteBackupTable)
1494 FirstEntryLBA = 2ULL;
1498 FirstEntryLBA = Disk->SectorCount - PartitionsSizeSector - 1;
1512 if (
Offset == Disk->SectorSize || ForceWrite)
1529 if (PartitionEntryCRC32)
1540 IN ULONG PartitionsSizeSector,
1570 if (!WriteBackupTable)
1572 EFIHeader->
MyLBA = 1ULL;
1577 EFIHeader->
MyLBA = Disk->SectorCount - 1ULL;
1589 if (!WriteBackupTable)
1605 DPRINT(
"FSTUB: About to write the following header for %s table\n", (WriteBackupTable ?
"backup" :
"primary"));
1639 ULONG i, WrittenPartitions, SectoredPartitionEntriesSize, PartitionEntryCRC32;
1644 ASSERT(MaxPartitionCount >= 128);
1645 ASSERT(PartitionCount <= MaxPartitionCount);
1647 PartitionEntryCRC32 = 0;
1651 for (
i = 0, WrittenPartitions = 0;
i < PartitionCount;
i++)
1654 if (PartitionEntries[
i].Gpt.PartitionType.Data1 == 0 &&
1655 PartitionEntries[
i].Gpt.PartitionType.Data2 == 0 &&
1656 PartitionEntries[
i].Gpt.PartitionType.Data3 == 0 &&
1657 ((
PULONGLONG)PartitionEntries[
i].Gpt.PartitionType.Data4)[0] == 0)
1666 SectoredPartitionEntriesSize,
1671 &PartitionEntryCRC32);
1676 WrittenPartitions++;
1682 for (
i = WrittenPartitions;
i < MaxPartitionCount;
i++)
1685 SectoredPartitionEntriesSize,
1690 &PartitionEntryCRC32);
1699 SectoredPartitionEntriesSize,
1704 PartitionEntryCRC32,
1711 IN PDRIVE_LAYOUT_INFORMATION_EX LayoutEx)
1731 Disk->DiskGeometry.Geometry.SectorsPerTrack,
1732 Disk->DiskGeometry.Geometry.TracksPerCylinder,
1802 IN PCREATE_DISK Disk)
1811 PartitionStyle = ((Disk) ? Disk->PartitionStyle : PARTITION_STYLE_RAW);
1813 switch (PartitionStyle)
1819 case PARTITION_STYLE_RAW:
1844 BOOLEAN SingleDisk, IsBootDiskInfoEx;
1848 PDRIVE_LAYOUT_INFORMATION_EX DriveLayout =
NULL;
1850 ANSI_STRING ArcBootString, ArcSystemString, DeviceStringA, ArcNameStringA;
1890 for (DiskNumber = 0; DiskNumber < DiskCount; DiskNumber++)
1893 sprintf(
Buffer,
"\\Device\\Harddisk%lu\\Partition0", DiskNumber);
1919 sizeof(DiskGeometry),
1963 NextEntry = NextEntry->
Flink)
1974 if (((SingleDisk && DiskCount == 1) ||
2008 BootDiskInformation->BootDeviceSignature =
Signature;
2027 &PartitionInformation,
2028 sizeof(PartitionInformation),
2057 if (IsBootDiskInfoEx)
2079 BootDiskInformation->SystemDeviceSignature =
Signature;
2098 &PartitionInformation,
2099 sizeof(PartitionInformation),
2128 if (IsBootDiskInfoEx)
2171 ULONG HeaderCRC32,
i, CheckSum;
2178 if (BytesPerSector < 512)
2180 BytesPerSector = 512;
2250 for (
i = 0, CheckSum = 0;
i < 512;
i +=
sizeof(
UINT32))
2254 CheckSum = ~CheckSum + 1;
2274 IN PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
2302 switch (PartitionStyle)
2305 case PARTITION_STYLE_RAW:
2320 DPRINT(
"Unknown partition type\n");
2380 switch (PartitionStyle)
2435 switch (PartitionStyle)
2461 IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
2465 ULONG NumberOfEntries;
2468 ULONGLONG SectorsForPartitions, FirstUsableLBA, LastUsableLBA;
2486 switch (DriveLayout->PartitionStyle)
2517 FirstUsableLBA = SectorsForPartitions + 2;
2519 LastUsableLBA = Disk->
SectorCount - SectorsForPartitions - 1;
2527 DriveLayout->PartitionCount,
2528 DriveLayout->PartitionEntry);
2538 DriveLayout->PartitionCount,
2539 DriveLayout->PartitionEntry);
2550 DPRINT(
"Unsupported partition style: %lu\n", DriveLayout->PartitionStyle);
NTSTATUS FASTCALL IoWritePartitionTable(IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONG SectorsPerTrack, IN ULONG NumberOfHeads, IN PDRIVE_LAYOUT_INFORMATION PartitionBuffer)
NTSTATUS FASTCALL IoSetPartitionInformation(IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONG PartitionNumber, IN ULONG PartitionType)
NTSTATUS FASTCALL IoReadPartitionTable(IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN BOOLEAN ReturnRecognizedPartitions, OUT PDRIVE_LAYOUT_INFORMATION *PartitionBuffer)
_In_ PFCB _In_ LONGLONG StartingOffset
#define IOCTL_DISK_GET_DRIVE_GEOMETRY
#define NT_SUCCESS(StatCode)
static const WCHAR Signature[]
static const WCHAR Cleanup[]
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define NonPagedPoolCacheAligned
#define IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
#define IOCTL_DISK_GET_PARTITION_INFO_EX
#define EFI_GUID_STRING_SIZE
#define IS_VALID_DISK_INFO(Disk)
struct _PARTITION_TABLE_ENTRY PARTITION_TABLE_ENTRY
PCHAR NTAPI FstubDbgGuidToString(IN PGUID Guid, OUT PCHAR String)
#define EFI_HEADER_SIGNATURE
NTSTATUS NTAPI FstubWriteSector(IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONGLONG StartingSector OPTIONAL, IN PVOID Buffer)
VOID NTAPI FstubCopyEntryEFI(OUT PEFI_PARTITION_ENTRY Entry, IN PPARTITION_INFORMATION_EX Partition, ULONG SectorSize)
NTSTATUS NTAPI IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION BootDiskInformation, IN ULONG Size)
NTSTATUS NTAPI FstubCreateDiskRaw(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI FstubGetDiskGeometry(IN PDEVICE_OBJECT DeviceObject, OUT PDISK_GEOMETRY_EX Geometry)
NTSTATUS NTAPI IoCreateDisk(IN PDEVICE_OBJECT DeviceObject, IN PCREATE_DISK Disk)
NTSTATUS NTAPI FstubSetPartitionInformationEFI(IN PDISK_INFORMATION Disk, IN ULONG PartitionNumber, IN SET_PARTITION_INFORMATION_GPT *PartitionInfo)
VOID NTAPI FstubFreeDiskInformation(IN PDISK_INFORMATION DiskBuffer)
NTSTATUS NTAPI IoWritePartitionTableEx(IN PDEVICE_OBJECT DeviceObject, IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
struct _DISK_INFORMATION * PDISK_INFORMATION
struct _PARTITION_TABLE_ENTRY * PPARTITION_TABLE_ENTRY
struct _MASTER_BOOT_RECORD * PMASTER_BOOT_RECORD
NTSTATUS NTAPI FstubWriteHeaderEFI(IN PDISK_INFORMATION Disk, IN ULONG PartitionsSizeSector, IN GUID DiskGUID, IN ULONG NumberOfEntries, IN ULONGLONG FirstUsableLBA, IN ULONGLONG LastUsableLBA, IN ULONG PartitionEntryCRC32, IN BOOLEAN WriteBackupTable)
NTSTATUS NTAPI FstubReadPartitionTableMBR(IN PDISK_INFORMATION Disk, IN BOOLEAN ReturnRecognizedPartitions, OUT PDRIVE_LAYOUT_INFORMATION_EX *ReturnedDriveLayout)
#define PARTITION_ENTRY_SIZE
struct _EFI_PARTITION_HEADER EFI_PARTITION_HEADER
NTSTATUS NTAPI FstubAllocateDiskInformation(IN PDEVICE_OBJECT DeviceObject, OUT PDISK_INFORMATION *DiskBuffer, IN PDISK_GEOMETRY_EX DiskGeometry OPTIONAL)
NTSTATUS NTAPI IoSetPartitionInformationEx(IN PDEVICE_OBJECT DeviceObject, IN ULONG PartitionNumber, IN PSET_PARTITION_INFORMATION_EX PartitionInfo)
struct _EFI_PARTITION_HEADER * PEFI_PARTITION_HEADER
NTSTATUS NTAPI IoReadPartitionTableEx(IN PDEVICE_OBJECT DeviceObject, IN PDRIVE_LAYOUT_INFORMATION_EX *DriveLayout)
NTSTATUS NTAPI FstubCreateDiskMBR(IN PDEVICE_OBJECT DeviceObject, IN PCREATE_DISK_MBR DiskInfo)
VOID NTAPI FstubDbgPrintSetPartitionEx(IN PSET_PARTITION_INFORMATION_EX PartitionEntry, IN ULONG PartitionNumber)
VOID NTAPI FstubDbgPrintPartitionEx(IN PPARTITION_INFORMATION_EX PartitionEntry, IN ULONG PartitionNumber)
struct _MASTER_BOOT_RECORD MASTER_BOOT_RECORD
NTSTATUS NTAPI FstubVerifyPartitionTableEFI(IN PDISK_INFORMATION Disk, IN BOOLEAN FixErrors)
NTSTATUS NTAPI FstubReadHeaderEFI(IN PDISK_INFORMATION Disk, IN BOOLEAN ReadBackupTable, PEFI_PARTITION_HEADER *HeaderBuffer)
NTSTATUS NTAPI FstubWriteEntryEFI(IN PDISK_INFORMATION Disk, IN ULONG PartitionsSizeSector, IN ULONG PartitionEntryNumber, IN PEFI_PARTITION_ENTRY PartitionEntry, IN BOOLEAN WriteBackupTable, IN BOOLEAN ForceWrite, OUT PULONG PartitionEntryCRC32 OPTIONAL)
NTSTATUS NTAPI FstubDetectPartitionStyle(IN PDISK_INFORMATION Disk, IN PARTITION_STYLE *PartitionStyle)
NTSTATUS NTAPI IoVerifyPartitionTable(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN FixErrors)
#define EFI_PMBR_OSTYPE_EFI
struct _EFI_PARTITION_ENTRY * PEFI_PARTITION_ENTRY
VOID NTAPI FstubAdjustPartitionCount(IN ULONG SectorSize, IN OUT PULONG PartitionCount)
NTSTATUS NTAPI FstubWritePartitionTableEFI(IN PDISK_INFORMATION Disk, IN GUID DiskGUID, IN ULONG MaxPartitionCount, IN ULONGLONG FirstUsableLBA, IN ULONGLONG LastUsableLBA, IN BOOLEAN WriteBackupTable, IN ULONG PartitionCount, IN PPARTITION_INFORMATION_EX PartitionEntries OPTIONAL)
struct _EFI_PARTITION_ENTRY EFI_PARTITION_ENTRY
PDRIVE_LAYOUT_INFORMATION NTAPI FstubConvertExtendedToLayout(IN PDRIVE_LAYOUT_INFORMATION_EX LayoutEx)
struct _DISK_INFORMATION DISK_INFORMATION
NTSTATUS NTAPI FstubWritePartitionTableMBR(IN PDISK_INFORMATION Disk, IN PDRIVE_LAYOUT_INFORMATION_EX LayoutEx)
NTSTATUS NTAPI IoReadDiskSignature(IN PDEVICE_OBJECT DeviceObject, IN ULONG BytesPerSector, OUT PDISK_SIGNATURE Signature)
#define EFI_HEADER_REVISION_1
NTSTATUS NTAPI FstubWriteBootSectorEFI(IN PDISK_INFORMATION Disk)
VOID NTAPI FstubDbgPrintDriveLayoutEx(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
NTSTATUS NTAPI FstubCreateDiskEFI(IN PDEVICE_OBJECT DeviceObject, IN PCREATE_DISK_GPT DiskInfo)
NTSTATUS NTAPI FstubReadSector(IN PDEVICE_OBJECT DeviceObject, IN ULONG SectorSize, IN ULONGLONG StartingSector OPTIONAL, OUT PVOID Buffer)
NTSTATUS NTAPI FstubReadPartitionTableEFI(IN PDISK_INFORMATION Disk, IN BOOLEAN ReadBackupTable, OUT PDRIVE_LAYOUT_INFORMATION_EX *DriveLayout)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
PLOADER_PARAMETER_BLOCK IopLoaderBlock
PCONFIGURATION_INFORMATION NTAPI IoGetConfigurationInformation(VOID)
#define ExFreePoolWithTag(_P, _T)
enum _PARTITION_STYLE PARTITION_STYLE
#define sprintf(buf, format,...)
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define FILE_READ_ATTRIBUTES
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI BOOLEAN NTAPI RtlEqualString(PSTRING String1, PSTRING String2, BOOLEAN CaseInSensitive)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
_In_ ULONG _In_ ULONG Offset
struct _PARTITION_DESCRIPTOR * PPARTITION_DESCRIPTOR
#define PARTITION_TABLE_OFFSET
#define BOOT_SIGNATURE_OFFSET
#define DISK_SIGNATURE_OFFSET
#define NUM_PARTITION_TABLE_ENTRIES
BOOLEAN NTAPI IopVerifyDiskSignature(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout, IN PARC_DISK_SIGNATURE ArcDiskSignature, OUT PULONG Signature)
NTSTATUS NTAPI IoGetDeviceObjectPointer(IN PUNICODE_STRING ObjectName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
#define STATUS_NOT_SUPPORTED
#define BOOT_RECORD_SIGNATURE
#define STATUS_DEVICE_NOT_READY
PULONG MinorVersion OPTIONAL
base of all file and directory entries
struct _LIST_ENTRY * Flink
PARC_DISK_INFORMATION ArcDiskInformation
UCHAR MasterBootRecordCodeAndData[0x1b8]
USHORT MasterBootRecordMagic
PARTITION_TABLE_ENTRY PartitionTable[4]
ULONG SectorCountBeforePartition
ULONG PartitionSectorCount
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_DISK_CORRUPT_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
_In_ ULONG _In_ BOOLEAN ReturnRecognizedPartitions
_In_ ULONG _In_ struct _SET_PARTITION_INFORMATION_EX * PartitionInfo
_In_ ULONG _In_ ULONG PartitionNumber
struct _BOOTDISK_INFORMATION_EX * PBOOTDISK_INFORMATION_EX
#define SL_OVERRIDE_VERIFY_VOLUME
struct _BOOTDISK_INFORMATION_EX BOOTDISK_INFORMATION_EX
#define ObDereferenceObject