WCHAR Name[0x24]; // 56
} EFI_PARTITION_ENTRY, *PEFI_PARTITION_ENTRY;
-typedef struct _CREATE_DISK_MBR
-{
- ULONG Signature;
-} CREATE_DISK_MBR, *PCREATE_DISK_MBR;
-
-typedef struct _CREATE_DISK_GPT
-{
- GUID DiskId;
- ULONG MaxPartitionCount;
-} CREATE_DISK_GPT, *PCREATE_DISK_GPT;
-
-typedef struct _CREATE_DISK
-{
- PARTITION_STYLE PartitionStyle;
- union
- {
- CREATE_DISK_MBR Mbr;
- CREATE_DISK_GPT Gpt;
- };
-} CREATE_DISK, *PCREATE_DISK;
-
typedef struct _PARTITION_TABLE_ENTRY
{
UCHAR BootIndicator;
DriveLayout = ExAllocatePoolWithTag(NonPagedPool,
FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION, PartitionEntry) +
LayoutEx->PartitionCount * sizeof(PARTITION_INFORMATION),
- 'BtsF');
+ TAG_FSTUB);
if (!DriveLayout)
{
return NULL;
if ((Disk->SectorCount - 1ULL) != EfiHeader.AlternateLBA)
{
/* We'll update it. First, count number of sectors needed to store partitions */
- SectorsForPartitions = (EfiHeader.NumberOfEntries * PARTITION_ENTRY_SIZE) / Disk->SectorSize;
+ SectorsForPartitions = ((ULONGLONG)EfiHeader.NumberOfEntries * PARTITION_ENTRY_SIZE) / Disk->SectorSize;
/* Then set first usable LBA: Legacy MBR + GPT header + Partitions entries */
EfiHeader.FirstUsableLBA = SectorsForPartitions + 2;
/* Then set last usable LBA: Last sector - GPT header - Partitions entries */
DriveLayout);
/* Free allocated structure and return */
- ExFreePool(DriveLayout);
+ ExFreePoolWithTag(DriveLayout, TAG_FSTUB);
return Status;
}