[NTOS:FSTUB/IO] Unhardcode some values

This commit is contained in:
Hermès Bélusca-Maïto
2026-04-11 18:16:22 +02:00
parent 0bbb12f991
commit 2e610aa9df
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -278,8 +278,8 @@ HalpQueryPartitionType(
return STATUS_SUCCESS;
}
/* Now, evaluate the partition to the 4 in the input layout */
for (i = 0; i < 4; ++i)
/* Now, evaluate the partition to those in the input layout */
for (i = 0; i < NUM_PARTITION_TABLE_ENTRIES; ++i)
{
/* If we find a partition matching */
if (LayoutInfo->PartitionEntry[i].StartingOffset.QuadPart == PartitionInfo.StartingOffset.QuadPart)
+1 -1
View File
@@ -564,7 +564,7 @@ FstubDbgPrintDriveLayoutEx(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout)
switch (DriveLayout->PartitionStyle)
{
case PARTITION_STYLE_MBR:
if (DriveLayout->PartitionCount % 4 != 0)
if (DriveLayout->PartitionCount % NUM_PARTITION_TABLE_ENTRIES != 0)
{
DPRINT("Warning: Partition count isn't a 4-factor: %lu!\n", DriveLayout->PartitionCount);
}
+1 -1
View File
@@ -628,7 +628,7 @@ IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
/* Check MBR type against EZ Drive type */
StartingOffset.QuadPart = 0;
HalExamineMBR(DeviceObject, DiskGeometry.BytesPerSector, 0x55, &Data);
HalExamineMBR(DeviceObject, DiskGeometry.BytesPerSector, PARTITION_EZDRIVE, &Data);
if (Data)
{
/* If MBR is of the EZ Drive type, we'll read after it */