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;
/* Allocate a buffer to read a sector on the disk */
Sector = ExAllocatePoolWithTag(NonPagedPool,
Disk->SectorSize,
- 'BtsF');
+ TAG_FSTUB);
if (!Sector)
{
DPRINT("EFI::Lacking resources!\n");
(PUSHORT)Sector);
if (!NT_SUCCESS(Status))
{
- ExFreePoolWithTag(Sector, 'BtsF');
+ ExFreePoolWithTag(Sector, TAG_FSTUB);
DPRINT("EFI::Failed reading sector for partition entry!\n");
return Status;
}
(PUSHORT)Sector);
if (!NT_SUCCESS(Status))
{
- ExFreePoolWithTag(Sector, 'BtsF');
+ ExFreePoolWithTag(Sector, TAG_FSTUB);
DPRINT("EFI::Failed reading sector for partition entry!\n");
return Status;
}
}
/* Finally, release memory */
- ExFreePoolWithTag(Sector, 'BtsF');
+ ExFreePoolWithTag(Sector, TAG_FSTUB);
/* Compare checksums */
if (PreviousCRC32 == EFIHeader->PartitionEntryCRC32)
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;
}