86#define PARTITION_ENTRY_SIZE 128
88#define EFI_HEADER_SIGNATURE 0x5452415020494645ULL
90#define EFI_HEADER_REVISION_1 0x00010000
92#define EFI_PMBR_OSTYPE_EFI 0xEE
94#define EFI_GUID_STRING_SIZE 0x27
96#define IS_VALID_DISK_INFO(Disk) \
98 (Disk->DeviceObject) && \
99 (Disk->SectorSize) && \
183 Count = *PartitionCount;
198 *PartitionCount =
Count;
223 if (!DiskInformation)
258 if (!DiskInformation->
Buffer)
265 *DiskBuffer = DiskInformation;
300 DriveLayout->
Signature = LayoutEx->Mbr.Signature;
303 for (
i = 0;
i < LayoutEx->PartitionCount;
i++)
331 Entry->PartitionType = Partition->Gpt.PartitionType;
332 Entry->UniquePartition = Partition->Gpt.PartitionId;
334 Entry->EndingLBA = (Partition->StartingOffset.QuadPart + Partition->PartitionLength.QuadPart - 1) /
SectorSize;
335 Entry->Attributes = Partition->Gpt.Attributes;
342 IN PCREATE_DISK_MBR DiskInfo)
371 MasterBootRecord->
Signature = DiskInfo->Signature;
389 IN PCREATE_DISK_GPT DiskInfo)
394 ULONG MaxPartitionCount, SectorsForPartitions;
418 MaxPartitionCount = DiskInfo->MaxPartitionCount;
424 FirstUsableLBA = SectorsForPartitions + 2;
426 LastUsableLBA = Disk->
SectorCount - SectorsForPartitions - 1;
539 "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
564 DPRINT(
"FSTUB: DRIVE_LAYOUT_INFORMATION_EX: %p\n", DriveLayout);
565 switch (DriveLayout->PartitionStyle)
568 if (DriveLayout->PartitionCount % 4 != 0)
570 DPRINT(
"Warning: Partition count isn't a 4-factor: %lu!\n", DriveLayout->PartitionCount);
573 DPRINT(
"Signature: %8.8x\n", DriveLayout->Mbr.Signature);
574 for (
i = 0;
i < DriveLayout->PartitionCount;
i++)
583 DPRINT(
"StartingUsableOffset: %I64x\n", DriveLayout->Gpt.StartingUsableOffset.QuadPart);
584 DPRINT(
"UsableLength: %I64x\n", DriveLayout->Gpt.UsableLength.QuadPart);
585 DPRINT(
"MaxPartitionCount: %lu\n", DriveLayout->Gpt.MaxPartitionCount);
586 for (
i = 0;
i < DriveLayout->PartitionCount;
i++)
593 DPRINT(
"Unsupported partition style: %lu\n", DriveLayout->PartitionStyle);
646 DPRINT(
"FSTUB: SET_PARTITION_INFORMATION_EX: %p\n", PartitionEntry);
648 switch (PartitionEntry->PartitionStyle)
651 DPRINT(
" PartitionType: %02x\n", PartitionEntry->Mbr.PartitionType);
659 DPRINT(
" Attributes: %I64x\n", PartitionEntry->Gpt.Attributes);
660 DPRINT(
" Name: %ws\n", PartitionEntry->Gpt.Name);
696 *PartitionStyle = PARTITION_STYLE_RAW;
721 if (DiskBuffer->Buffer)
796 *Geometry = *DiskGeometry;
833 ULONG i, HeaderCRC32, PreviousCRC32, SectoredPartitionEntriesSize, LonelyPartitions;
844 StartingSector = Disk->SectorCount - 1ULL;
849 StartingSector = 1ULL;
858 DPRINT(
"EFI::Failed reading header!\n");
873 DPRINT(
"EFI::Wrong signature/version/header size!\n");
887 DPRINT(
"EFI::Not matching header checksum!\n");
894 if (EFIHeader->
MyLBA != StartingSector)
896 DPRINT(
"EFI::Not matching starting sector!\n");
906 DPRINT(
"EFI::Lacking resources!\n");
913 for (
i = 0, PreviousCRC32 = 0;
i < SectoredPartitionEntriesSize;
i++)
922 DPRINT(
"EFI::Failed reading sector for partition entry!\n");
926 PreviousCRC32 =
RtlComputeCrc32(PreviousCRC32, Sector, Disk->SectorSize);
932 if (LonelyPartitions != 0)
942 DPRINT(
"EFI::Failed reading sector for partition entry!\n");
947 for (
i = 0;
i < LonelyPartitions;
i++)
960 *HeaderBuffer = EFIHeader;
965 DPRINT(
"EFI::Not matching partition table checksum!\n");
975 OUT PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
978 ULONG NumberOfEntries;
983 ULONGLONG SectorsForPartitions, PartitionEntryLBA;
987 PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx =
NULL;
988 ULONG i, PartitionCount, PartitionIndex, PartitionsPerSector;
1011 FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry) +
1020 if (!ReadBackupTable)
1027 if ((Disk->SectorCount - 1ULL) != EfiHeader->
AlternateLBA)
1034 EfiHeader->
LastUsableLBA = Disk->SectorCount - SectorsForPartitions - 1;
1036 UpdatedPartitionTable =
TRUE;
1043 DriveLayoutEx->Gpt.StartingUsableOffset.QuadPart = EfiHeader->
FirstUsableLBA * Disk->SectorSize;
1046 DriveLayoutEx->Gpt.DiskId = EfiHeader->
DiskGUID;
1056 for (
i = 0, PartitionCount = 0, PartitionIndex = PartitionsPerSector;
1057 i < NumberOfEntries;
1061 if (PartitionIndex == PartitionsPerSector)
1065 PartitionEntryLBA + (
i / PartitionsPerSector),
1089 DriveLayoutEx->PartitionEntry[PartitionCount].StartingOffset.QuadPart = PartitionEntry.
StartingLBA * Disk->SectorSize;
1090 DriveLayoutEx->PartitionEntry[PartitionCount].PartitionLength.QuadPart = (PartitionEntry.
EndingLBA -
1094 DriveLayoutEx->PartitionEntry[PartitionCount].PartitionNumber = PartitionCount + 1;
1095 DriveLayoutEx->PartitionEntry[PartitionCount].RewritePartition =
FALSE;
1097 DriveLayoutEx->PartitionEntry[PartitionCount].Gpt.PartitionType = PartitionEntry.
PartitionType;
1098 DriveLayoutEx->PartitionEntry[PartitionCount].Gpt.PartitionId = PartitionEntry.
UniquePartition;
1099 DriveLayoutEx->PartitionEntry[PartitionCount].Gpt.Attributes = PartitionEntry.
Attributes;
1100 RtlCopyMemory(DriveLayoutEx->PartitionEntry[PartitionCount].Gpt.Name,
1101 PartitionEntry.
Name,
sizeof(PartitionEntry.
Name));
1106 DriveLayoutEx->PartitionCount = PartitionCount;
1110 if (UpdatedPartitionTable)
1118 *DriveLayout = DriveLayoutEx;
1127 OUT PDRIVE_LAYOUT_INFORMATION_EX* ReturnedDriveLayout)
1132 PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx =
NULL;
1137 ASSERT(ReturnedDriveLayout);
1140 *ReturnedDriveLayout =
NULL;
1154 FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry) +
1167 DriveLayoutEx->Mbr.Signature = DriveLayout->
Signature;
1184 *ReturnedDriveLayout = DriveLayoutEx;
1251 PDRIVE_LAYOUT_INFORMATION_EX Layout =
NULL;
1301 ULONGLONG ReadPosition, WritePosition, SectorsForPartitions, PartitionIndex;
1314 PrimaryValid =
TRUE;
1328 if (PrimaryValid && BackupValid)
1337 if ((!PrimaryValid && !BackupValid) || !
FixErrors)
1349 WritePosition = Disk->SectorCount - SectorsForPartitions;
1351 ReadPosition = 2ULL;
1353 DPRINT(
"EFI::Will repair backup table from primary\n");
1358 WriteBackup =
FALSE;
1360 WritePosition = 2ULL;
1362 ReadPosition = Disk->SectorCount - SectorsForPartitions;
1364 DPRINT(
"EFI::Will repair primary table from backup\n");
1367 PartitionIndex = 0
ULL;
1370 if (SectorsForPartitions <= 0)
1373 SectorsForPartitions,
1385 for (; PartitionIndex < SectorsForPartitions; ++PartitionIndex)
1390 ReadPosition + PartitionIndex,
1400 WritePosition + PartitionIndex,
1410 SectorsForPartitions,
1478 IN ULONG PartitionsSizeSector,
1479 IN ULONG PartitionEntryNumber,
1498 if (!WriteBackupTable)
1500 FirstEntryLBA = 2ULL;
1504 FirstEntryLBA = Disk->SectorCount - PartitionsSizeSector - 1;
1518 if (
Offset == Disk->SectorSize || ForceWrite)
1535 if (PartitionEntryCRC32)
1546 IN ULONG PartitionsSizeSector,
1576 if (!WriteBackupTable)
1578 EFIHeader->
MyLBA = 1ULL;
1583 EFIHeader->
MyLBA = Disk->SectorCount - 1ULL;
1595 if (!WriteBackupTable)
1611 DPRINT(
"FSTUB: About to write the following header for %s table\n", (WriteBackupTable ?
"backup" :
"primary"));
1645 ULONG i, WrittenPartitions, SectoredPartitionEntriesSize, PartitionEntryCRC32;
1650 ASSERT(MaxPartitionCount >= 128);
1651 ASSERT(PartitionCount <= MaxPartitionCount);
1653 PartitionEntryCRC32 = 0;
1657 for (
i = 0, WrittenPartitions = 0;
i < PartitionCount;
i++)
1660 if (PartitionEntries[
i].Gpt.PartitionType.Data1 == 0 &&
1661 PartitionEntries[
i].Gpt.PartitionType.Data2 == 0 &&
1662 PartitionEntries[
i].Gpt.PartitionType.Data3 == 0 &&
1663 ((
PULONGLONG)PartitionEntries[
i].Gpt.PartitionType.Data4)[0] == 0)
1672 SectoredPartitionEntriesSize,
1677 &PartitionEntryCRC32);
1682 WrittenPartitions++;
1688 for (
i = WrittenPartitions;
i < MaxPartitionCount;
i++)
1691 SectoredPartitionEntriesSize,
1696 &PartitionEntryCRC32);
1705 SectoredPartitionEntriesSize,
1710 PartitionEntryCRC32,
1717 IN PDRIVE_LAYOUT_INFORMATION_EX LayoutEx)
1737 Disk->DiskGeometry.Geometry.SectorsPerTrack,
1738 Disk->DiskGeometry.Geometry.TracksPerCylinder,
1808 IN PCREATE_DISK Disk)
1817 PartitionStyle = ((Disk) ? Disk->PartitionStyle : PARTITION_STYLE_RAW);
1819 switch (PartitionStyle)
1825 case PARTITION_STYLE_RAW:
1850 BOOLEAN SingleDisk, IsBootDiskInfoEx;
1854 PDRIVE_LAYOUT_INFORMATION_EX DriveLayout =
NULL;
1856 ANSI_STRING ArcBootString, ArcSystemString, DeviceStringA, ArcNameStringA;
1896 for (DiskNumber = 0; DiskNumber < DiskCount; DiskNumber++)
1899 sprintf(
Buffer,
"\\Device\\Harddisk%lu\\Partition0", DiskNumber);
1925 sizeof(DiskGeometry),
1969 NextEntry = NextEntry->
Flink)
1980 if (((SingleDisk && DiskCount == 1) ||
2014 BootDiskInformation->BootDeviceSignature =
Signature;
2033 &PartitionInformation,
2034 sizeof(PartitionInformation),
2063 if (IsBootDiskInfoEx)
2085 BootDiskInformation->SystemDeviceSignature =
Signature;
2104 &PartitionInformation,
2105 sizeof(PartitionInformation),
2134 if (IsBootDiskInfoEx)
2177 ULONG HeaderCRC32,
i, CheckSum;
2184 if (BytesPerSector < 512)
2186 BytesPerSector = 512;
2256 for (
i = 0, CheckSum = 0;
i < 512;
i +=
sizeof(
UINT32))
2260 CheckSum = ~CheckSum + 1;
2280 IN PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
2308 switch (PartitionStyle)
2311 case PARTITION_STYLE_RAW:
2326 DPRINT(
"Unknown partition type\n");
2386 switch (PartitionStyle)
2441 switch (PartitionStyle)
2467 IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
2471 ULONG NumberOfEntries;
2474 ULONGLONG SectorsForPartitions, FirstUsableLBA, LastUsableLBA;
2492 switch (DriveLayout->PartitionStyle)
2523 FirstUsableLBA = SectorsForPartitions + 2;
2525 LastUsableLBA = Disk->
SectorCount - SectorsForPartitions - 1;
2533 DriveLayout->PartitionCount,
2534 DriveLayout->PartitionEntry);
2544 DriveLayout->PartitionCount,
2545 DriveLayout->PartitionEntry);
2556 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 STATUS_NOT_SUPPORTED
#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)
Returns a pointer to the I/O manager's global configuration information structure.
#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 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 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