[USETUP] Blur the boundaries between MBR "Primary" and "Logical" partitions (#5837)

Do not do that yet for extended partitions (containers).

This is possible, because when creating partitions, we do that on
unpartitioned space that is already "tagged" as either being "logical"
or not, and the partition style is inherited from that.

The resulting code is simpler, yet working as it should.
This will also help in the future for supporting other platforms, where
the concept of "primary", "extended" and "logical" partitions do not
exist (basically all platforms except BIOS-based PC-AT).
This commit is contained in:
Hermès Bélusca-Maïto 2023-10-26 21:44:41 +02:00
parent 9ed4bf1ed7
commit ebcf3cf38e
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 158 additions and 245 deletions

View file

@ -294,25 +294,26 @@ GetPrevPartition(
IN PPARTLIST List,
IN PPARTENTRY CurrentPart OPTIONAL);
ERROR_NUMBER
PartitionCreationChecks(
_In_ PPARTENTRY PartEntry);
ERROR_NUMBER
ExtendedPartitionCreationChecks(
_In_ PPARTENTRY PartEntry);
BOOLEAN
CreatePrimaryPartition(
IN PPARTLIST List,
IN OUT PPARTENTRY PartEntry,
IN ULONGLONG SectorCount,
IN BOOLEAN AutoCreate);
CreatePartition(
_In_ PPARTLIST List,
_Inout_ PPARTENTRY PartEntry,
_In_ ULONGLONG SectorCount,
_In_ BOOLEAN AutoCreate);
BOOLEAN
CreateExtendedPartition(
IN PPARTLIST List,
IN OUT PPARTENTRY PartEntry,
IN ULONGLONG SectorCount);
BOOLEAN
CreateLogicalPartition(
IN PPARTLIST List,
IN OUT PPARTENTRY PartEntry,
IN ULONGLONG SectorCount,
IN BOOLEAN AutoCreate);
_In_ PPARTLIST List,
_Inout_ PPARTENTRY PartEntry,
_In_ ULONGLONG SectorCount);
NTSTATUS
DismountVolume(
@ -360,18 +361,6 @@ SetMBRPartitionType(
IN PPARTENTRY PartEntry,
IN UCHAR PartitionType);
ERROR_NUMBER
PrimaryPartitionCreationChecks(
IN PPARTENTRY PartEntry);
ERROR_NUMBER
ExtendedPartitionCreationChecks(
IN PPARTENTRY PartEntry);
ERROR_NUMBER
LogicalPartitionCreationChecks(
IN PPARTENTRY PartEntry);
BOOLEAN
GetNextUnformattedPartition(
IN PPARTLIST List,