mirror of
https://github.com/reactos/reactos.git
synced 2026-06-03 01:41:13 +08:00
[FREELDR] Improve disk detection (#8074)
Improve disk detection on UEFI by using PublicBootHandle index JIRA issue: CORE-11954
This commit is contained in:
@@ -431,30 +431,23 @@ UefiSetupBlockDevices(VOID)
|
||||
}
|
||||
else if (handles[i] == PublicBootHandle)
|
||||
{
|
||||
ULONG increment = 0;
|
||||
ULONG i;
|
||||
|
||||
/* 3) Grab the offset into the array of handles and decrement per volume (valid partition) */
|
||||
for (increment = OffsetToBoot; increment > 0; increment--)
|
||||
GlobalSystemTable->BootServices->HandleProtocol(handles[i], &bioGuid, (void**)&bio);
|
||||
if (bio->Media->LogicalPartition == FALSE)
|
||||
{
|
||||
GlobalSystemTable->BootServices->HandleProtocol(handles[increment], &bioGuid, (void**)&bio);
|
||||
if (bio->Media->LogicalPartition == FALSE)
|
||||
ULONG j;
|
||||
|
||||
TRACE("Found root at index %u\n", i);
|
||||
UefiBootRootIdentifier = i;
|
||||
|
||||
for (j = 0; j <= PcBiosDiskCount; ++j)
|
||||
{
|
||||
TRACE("Found root at increment %u\n", increment);
|
||||
UefiBootRootIdentifier = increment;
|
||||
|
||||
for (i = 0; i <= PcBiosDiskCount; ++i)
|
||||
/* Now only of the root drive number is equal to this drive we found above */
|
||||
if (InternalUefiDisk[j].UefiRootNumber == UefiBootRootIdentifier)
|
||||
{
|
||||
/* Now only of the root drive number is equal to this drive we found above */
|
||||
if (InternalUefiDisk[i].UefiRootNumber == UefiBootRootIdentifier)
|
||||
{
|
||||
InternalUefiDisk[i].IsThisTheBootDrive = TRUE;
|
||||
PublicBootArcDisk = i;
|
||||
TRACE("Found Boot drive\n");
|
||||
}
|
||||
InternalUefiDisk[j].IsThisTheBootDrive = TRUE;
|
||||
PublicBootArcDisk = j;
|
||||
TRACE("Found Boot drive\n");
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user