@@ -431,30 +431,24 @@ UefiSetupBlockDevices(VOID)
431431 }
432432 else if (handles [i ] == PublicBootHandle )
433433 {
434- ULONG increment = 0 ;
434+ ULONG increment = i ;
435435 ULONG i ;
436436
437- /* 3) Grab the offset into the array of handles and decrement per volume (valid partition) */
438- for ( increment = OffsetToBoot ; increment > 0 ; increment -- )
437+ GlobalSystemTable -> BootServices -> HandleProtocol ( handles [ increment ], & bioGuid , ( void * * ) & bio );
438+ if ( bio -> Media -> LogicalPartition == FALSE )
439439 {
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 ;
440+ TRACE ("Found root at increment %u\n" , increment );
441+ UefiBootRootIdentifier = increment ;
445442
446- for (i = 0 ; i <= PcBiosDiskCount ; ++ i )
443+ for (i = 0 ; i <= PcBiosDiskCount ; ++ i )
444+ {
445+ /* Now only of the root drive number is equal to this drive we found above */
446+ if (InternalUefiDisk [i ].UefiRootNumber == UefiBootRootIdentifier )
447447 {
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- }
448+ InternalUefiDisk [i ].IsThisTheBootDrive = TRUE;
449+ PublicBootArcDisk = i ;
450+ TRACE ("Found Boot drive\n" );
455451 }
456-
457- break ;
458452 }
459453 }
460454 }
0 commit comments