@@ -431,30 +431,23 @@ UefiSetupBlockDevices(VOID)
431431 }
432432 else if (handles [i ] == PublicBootHandle )
433433 {
434- ULONG increment = 0 ;
435- ULONG i ;
436-
437- /* 3) Grab the offset into the array of handles and decrement per volume (valid partition) */
438- for (increment = OffsetToBoot ; increment > 0 ; increment -- )
434+ GlobalSystemTable -> BootServices -> HandleProtocol (handles [i ], & bioGuid , (void * * )& bio );
435+ if (bio -> Media -> LogicalPartition == FALSE)
439436 {
440- GlobalSystemTable -> BootServices -> HandleProtocol (handles [increment ], & bioGuid , (void * * )& bio );
441- if (bio -> Media -> LogicalPartition == FALSE)
442- {
443- TRACE ("Found root at increment %u\n" , increment );
444- UefiBootRootIdentifier = increment ;
437+ ULONG j ;
438+
439+ TRACE ("Found root at index %u\n" , i );
440+ UefiBootRootIdentifier = i ;
445441
446- for (i = 0 ; i <= PcBiosDiskCount ; ++ i )
442+ for (j = 0 ; j <= PcBiosDiskCount ; ++ j )
443+ {
444+ /* Now only of the root drive number is equal to this drive we found above */
445+ if (InternalUefiDisk [j ].UefiRootNumber == UefiBootRootIdentifier )
447446 {
448- /* Now only of the root drive number is equal to this drive we found above */
449- if (InternalUefiDisk [i ].UefiRootNumber == UefiBootRootIdentifier )
450- {
451- InternalUefiDisk [i ].IsThisTheBootDrive = TRUE;
452- PublicBootArcDisk = i ;
453- TRACE ("Found Boot drive\n" );
454- }
447+ InternalUefiDisk [j ].IsThisTheBootDrive = TRUE;
448+ PublicBootArcDisk = j ;
449+ TRACE ("Found Boot drive\n" );
455450 }
456-
457- break ;
458451 }
459452 }
460453 }
0 commit comments