From dd7f1e65e5940b87e5098d4ae81bc456c804ed45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 7 Jul 2024 22:11:28 +0200 Subject: [PATCH] turn the partentry booleans into bitfields --- base/setup/lib/utils/partlist.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/base/setup/lib/utils/partlist.h b/base/setup/lib/utils/partlist.h index a85542b2efc..f6284893515 100644 --- a/base/setup/lib/utils/partlist.h +++ b/base/setup/lib/utils/partlist.h @@ -89,13 +89,21 @@ typedef struct _PARTENTRY ULONG PartitionIndex; /* Index in the LayoutBuffer->PartitionEntry[] cached array of the corresponding DiskEntry */ WCHAR DeviceName[MAX_PATH]; ///< NT device name: "\Device\HarddiskM\PartitionN" - BOOLEAN LogicalPartition; - - /* Partition is partitioned disk space */ - BOOLEAN IsPartitioned; - - /* Partition is new, table does not exist on disk yet */ - BOOLEAN New; + /* Partition state flags */ + union + { + UCHAR AsByte; + struct + { + BOOLEAN New : 1; ///< New partition, its table entry does not exist on disk yet. + // NOTE: See comment for the PARTLIST::SystemPartition member. + // MBR: BootIndicator == TRUE / GPT: PARTITION_SYSTEM_GUID. + // BOOLEAN IsSystemPartition : 1; // FIXME: Re-enable when BootIndicator gets deprecated. + BOOLEAN LogicalPartition : 1; ///< MBR-specific logical partition. + BOOLEAN IsPartitioned : 1; ///< Partitioned disk space. + UCHAR Reserved : 5; + }; + }; /* * Volume-related properties: