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) && \
100 ((Disk)->Buffer) && \
101 ((Disk)->SectorCount))
177 Count = *PartitionCount;
191 *PartitionCount =
Count;
216 if (!DiskInformation)
251 if (!DiskInformation->
Buffer)
258 *DiskBuffer = DiskInformation;
293 DriveLayout->
Signature = LayoutEx->Mbr.Signature;
296 for (
i = 0;
i < LayoutEx->PartitionCount;
i++)
324 Entry->PartitionType = Partition->Gpt.PartitionType;
325 Entry->UniquePartition = Partition->Gpt.PartitionId;
327 Entry->EndingLBA = (Partition->StartingOffset.QuadPart + Partition->PartitionLength.QuadPart - 1) /
SectorSize;
328 Entry->Attributes = Partition->Gpt.Attributes;
335 IN PCREATE_DISK_MBR DiskInfo)
364 MasterBootRecord->
Signature = DiskInfo->Signature;
382 IN PCREATE_DISK_GPT DiskInfo)
387 ULONG MaxPartitionCount, SectorsForPartitions;
411 MaxPartitionCount = DiskInfo->MaxPartitionCount;
417 FirstUsableLBA = SectorsForPartitions + 2;
419 LastUsableLBA = Disk->
SectorCount - SectorsForPartitions - 1;
534 "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
541FstubDbgPrintPartitionEx(
547 _In_ PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
553 DPRINT(
"FSTUB: DRIVE_LAYOUT_INFORMATION_EX: %p\n", DriveLayout);
554 switch (DriveLayout->PartitionStyle)
560 DbgPrint(
" Warning: Partition count isn't a 4-factor: %lu!\n", DriveLayout->PartitionCount);
562 DbgPrint(
" Signature: %8.8x\n", DriveLayout->Mbr.Signature);
563 for (
i = 0;
i < DriveLayout->PartitionCount;
i++)
565 FstubDbgPrintPartitionEx(DriveLayout->PartitionEntry,
i);
573 FstubDbgGuidToString(&(DriveLayout->Gpt.DiskId),
Guid);
575 DbgPrint(
" StartingUsableOffset: %I64x\n", DriveLayout->Gpt.StartingUsableOffset.QuadPart);
576 DbgPrint(
" UsableLength: %I64x\n", DriveLayout->Gpt.UsableLength.QuadPart);
577 DbgPrint(
" MaxPartitionCount: %lu\n", DriveLayout->Gpt.MaxPartitionCount);
578 for (
i = 0;
i < DriveLayout->PartitionCount;
i++)
580 FstubDbgPrintPartitionEx(DriveLayout->PartitionEntry,
i);
586 DbgPrint(
" Unsupported partition style: %lu\n", DriveLayout->PartitionStyle);
591FstubDbgPrintPartitionEx(
634 _In_ PSET_PARTITION_INFORMATION_EX PartitionEntry,
639 DPRINT(
"FSTUB: SET_PARTITION_INFORMATION_EX: %p\n", PartitionEntry);
641 switch (PartitionEntry->PartitionStyle)
644 DbgPrint(
" PartitionType: %02x\n", PartitionEntry->Mbr.PartitionType);
650 FstubDbgGuidToString(&(PartitionEntry->Gpt.PartitionType),
Guid);
652 FstubDbgGuidToString(&(PartitionEntry->Gpt.PartitionId),
Guid);
654 DbgPrint(
" Attributes: %I64x\n", PartitionEntry->Gpt.Attributes);
655 DbgPrint(
" Name: %ws\n", PartitionEntry->Gpt.Name);
660 DbgPrint(
" Unsupported partition style: %ld\n", PartitionEntry->PartitionStyle);
665#define FstubDbgPrintDriveLayoutEx(DriveLayout)
666#define FstubDbgPrintSetPartitionEx(PartitionEntry, PartitionNumber)
697 *PartitionStyle = PARTITION_STYLE_RAW;
722 if (DiskBuffer->Buffer)
797 *Geometry = *DiskGeometry;
834 ULONG i, HeaderCRC32, PreviousCRC32, SectoredPartitionEntriesSize, LonelyPartitions;
845 StartingSector = Disk->SectorCount - 1ULL;
850 StartingSector = 1ULL;
859 DPRINT(
"EFI::Failed reading header!\n");
874 DPRINT(
"EFI::Wrong signature/version/header size!\n");
888 DPRINT(
"EFI::Not matching header checksum!\n");
895 if (EFIHeader->
MyLBA != StartingSector)
897 DPRINT(
"EFI::Not matching starting sector!\n");
907 DPRINT(
"EFI::Lacking resources!\n");
914 for (
i = 0, PreviousCRC32 = 0;
i < SectoredPartitionEntriesSize;
i++)
923 DPRINT(
"EFI::Failed reading sector for partition entry!\n");
927 PreviousCRC32 =
RtlComputeCrc32(PreviousCRC32, Sector, Disk->SectorSize);
933 if (LonelyPartitions != 0)
943 DPRINT(
"EFI::Failed reading sector for partition entry!\n");
948 for (
i = 0;
i < LonelyPartitions;
i++)
961 *HeaderBuffer = EFIHeader;
966 DPRINT(
"EFI::Not matching partition table checksum!\n");
976 OUT PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
979 ULONG NumberOfEntries;
984 ULONGLONG SectorsForPartitions, PartitionEntryLBA;
988 PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx =
NULL;
990 ULONG i, PartitionCount, PartitionIndex, PartitionsPerSector;
1013 FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry) +
1022 if (!ReadBackupTable)
1029 if ((Disk->SectorCount - 1ULL) != EfiHeader->
AlternateLBA)
1036 EfiHeader->
LastUsableLBA = Disk->SectorCount - SectorsForPartitions - 1;
1038 UpdatedPartitionTable =
TRUE;
1045 DriveLayoutEx->Gpt.StartingUsableOffset.QuadPart = EfiHeader->
FirstUsableLBA * Disk->SectorSize;
1048 DriveLayoutEx->Gpt.DiskId = EfiHeader->
DiskGUID;
1058 for (
i = 0, PartitionCount = 0, PartitionIndex = PartitionsPerSector;
1059 i < NumberOfEntries;
1063 if (PartitionIndex == PartitionsPerSector)
1067 PartitionEntryLBA + (
i / PartitionsPerSector),
1086 PartitionInfo = &DriveLayoutEx->PartitionEntry[PartitionCount];
1090 PartitionEntry.
StartingLBA + 1) * Disk->SectorSize;
1099 PartitionEntry.
Name,
sizeof(PartitionEntry.
Name));
1104 DriveLayoutEx->PartitionCount = PartitionCount;
1108 if (UpdatedPartitionTable)
1116 *DriveLayout = DriveLayoutEx;
1125 OUT PDRIVE_LAYOUT_INFORMATION_EX* ReturnedDriveLayout)
1130 PDRIVE_LAYOUT_INFORMATION_EX DriveLayoutEx =
NULL;
1135 ASSERT(ReturnedDriveLayout);
1138 *ReturnedDriveLayout =
NULL;
1152 FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry) +
1165 DriveLayoutEx->Mbr.Signature = DriveLayout->
Signature;
1182 *ReturnedDriveLayout = DriveLayoutEx;
1249 PDRIVE_LAYOUT_INFORMATION_EX Layout =
NULL;
1299 ULONGLONG ReadPosition, WritePosition, SectorsForPartitions, PartitionIndex;
1312 PrimaryValid =
TRUE;
1326 if (PrimaryValid && BackupValid)
1335 if ((!PrimaryValid && !BackupValid) || !
FixErrors)
1347 WritePosition = Disk->SectorCount - SectorsForPartitions;
1349 ReadPosition = 2ULL;
1351 DPRINT(
"EFI::Will repair backup table from primary\n");
1356 WriteBackup =
FALSE;
1358 WritePosition = 2ULL;
1360 ReadPosition = Disk->SectorCount - SectorsForPartitions;
1362 DPRINT(
"EFI::Will repair primary table from backup\n");
1365 PartitionIndex = 0
ULL;
1368 if (SectorsForPartitions <= 0)
1371 SectorsForPartitions,
1383 for (; PartitionIndex < SectorsForPartitions; ++PartitionIndex)
1388 ReadPosition + PartitionIndex,
1398 WritePosition + PartitionIndex,
1408 SectorsForPartitions,
1476 IN ULONG PartitionsSizeSector,
1477 IN ULONG PartitionEntryNumber,
1496 if (!WriteBackupTable)
1498 FirstEntryLBA = 2ULL;
1502 FirstEntryLBA = Disk->SectorCount - PartitionsSizeSector - 1;
1516 if (
Offset == Disk->SectorSize || ForceWrite)
1533 if (PartitionEntryCRC32)
1544 IN ULONG PartitionsSizeSector,
1574 if (!WriteBackupTable)
1576 EFIHeader->
MyLBA = 1ULL;
1581 EFIHeader->
MyLBA = Disk->SectorCount - 1ULL;
1593 if (!WriteBackupTable)
1609 DPRINT(
"FSTUB: About to write the following header for %s table\n", (WriteBackupTable ?
"backup" :
"primary"));
1643 ULONG i, WrittenPartitions, SectoredPartitionEntriesSize, PartitionEntryCRC32;
1648 ASSERT(MaxPartitionCount >= 128);
1649 ASSERT(PartitionCount <= MaxPartitionCount);
1651 PartitionEntryCRC32 = 0;
1655 for (
i = 0, WrittenPartitions = 0;
i < PartitionCount;
i++)
1658 if (
IsEqualGUID(&PartitionEntries[
i].Gpt.PartitionType, &PARTITION_ENTRY_UNUSED_GUID))
1665 SectoredPartitionEntriesSize,
1670 &PartitionEntryCRC32);
1675 WrittenPartitions++;
1681 for (
i = WrittenPartitions;
i < MaxPartitionCount;
i++)
1684 SectoredPartitionEntriesSize,
1689 &PartitionEntryCRC32);
1698 SectoredPartitionEntriesSize,
1703 PartitionEntryCRC32,
1710 IN PDRIVE_LAYOUT_INFORMATION_EX LayoutEx)
1730 Disk->DiskGeometry.Geometry.SectorsPerTrack,
1731 Disk->DiskGeometry.Geometry.TracksPerCylinder,
1801 IN PCREATE_DISK Disk)
1810 PartitionStyle = ((Disk) ? Disk->PartitionStyle : PARTITION_STYLE_RAW);
1812 switch (PartitionStyle)
1818 case PARTITION_STYLE_RAW:
1843 BOOLEAN SingleDisk, IsBootDiskInfoEx;
1847 PDRIVE_LAYOUT_INFORMATION_EX DriveLayout =
NULL;
1849 ANSI_STRING ArcBootString, ArcSystemString, DeviceStringA, ArcNameStringA;
1889 for (DiskNumber = 0; DiskNumber < DiskCount; DiskNumber++)
1892 sprintf(
Buffer,
"\\Device\\Harddisk%lu\\Partition0", DiskNumber);
1918 sizeof(DiskGeometry),
1962 NextEntry = NextEntry->
Flink)
1975 if ((SingleDisk && (DiskCount == 1) &&
2009 BootDiskInformation->BootDeviceSignature =
Signature;
2028 &PartitionInformation,
2029 sizeof(PartitionInformation),
2058 if (IsBootDiskInfoEx)
2080 BootDiskInformation->SystemDeviceSignature =
Signature;
2099 &PartitionInformation,
2100 sizeof(PartitionInformation),
2129 if (IsBootDiskInfoEx)
2172 ULONG HeaderCRC32,
i, CheckSum;
2179 if (BytesPerSector < 512)
2181 BytesPerSector = 512;
2251 for (
i = 0, CheckSum = 0;
i < 512;
i +=
sizeof(
UINT32))
2255 CheckSum = ~CheckSum + 1;
2275 OUT PDRIVE_LAYOUT_INFORMATION_EX* DriveLayout)
2303 switch (PartitionStyle)
2306 case PARTITION_STYLE_RAW:
2321 DPRINT(
"Unknown partition type\n");
2379 switch (PartitionStyle)
2434 switch (PartitionStyle)
2460 IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
2464 ULONG NumberOfEntries;
2467 ULONGLONG SectorsForPartitions, FirstUsableLBA, LastUsableLBA;
2485 switch (DriveLayout->PartitionStyle)
2516 FirstUsableLBA = SectorsForPartitions + 2;
2518 LastUsableLBA = Disk->
SectorCount - SectorsForPartitions - 1;
2526 DriveLayout->PartitionCount,
2527 DriveLayout->PartitionEntry);
2537 DriveLayout->PartitionCount,
2538 DriveLayout->PartitionEntry);
2549 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
#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)
#define FstubDbgPrintDriveLayoutEx(DriveLayout)
NTSTATUS NTAPI IoSetPartitionInformationEx(IN PDEVICE_OBJECT DeviceObject, IN ULONG PartitionNumber, IN PSET_PARTITION_INFORMATION_EX PartitionInfo)
struct _EFI_PARTITION_HEADER * PEFI_PARTITION_HEADER
#define FstubDbgPrintSetPartitionEx(PartitionEntry, PartitionNumber)
NTSTATUS NTAPI FstubCreateDiskMBR(IN PDEVICE_OBJECT DeviceObject, IN PCREATE_DISK_MBR DiskInfo)
NTSTATUS NTAPI IoReadPartitionTableEx(IN PDEVICE_OBJECT DeviceObject, OUT PDRIVE_LAYOUT_INFORMATION_EX *DriveLayout)
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)
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)
for(i=0;i< ARRAY_SIZE(offsets);i++)
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 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)
_In_ ULONG _In_ ULONG Offset
static OUT PIO_STATUS_BLOCK IoStatusBlock
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 IsEqualGUID(rguid1, rguid2)
#define STATUS_DEVICE_NOT_READY
PULONG MinorVersion OPTIONAL
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_ PIO_STACK_LOCATION IoStackLocation
_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