LoadOptionType = LoadOptions[Index].OptionType;\r
}\r
ASSERT (LoadOptionType == LoadOptions[Index].OptionType);\r
+ ASSERT (LoadOptionType != LoadOptionTypeBoot);\r
\r
Status = EfiBootManagerProcessLoadOption (&LoadOptions[Index]);\r
\r
+ //\r
+ // Status indicates whether the load option is loaded and executed\r
+ // LoadOptions[Index].Status is what the load option returns\r
+ //\r
if (!EFI_ERROR (Status)) {\r
- if (LoadOptionType == LoadOptionTypePlatformRecovery) {\r
- //\r
- // Stop processing if any entry is successful\r
- //\r
+ //\r
+ // Stop processing if any PlatformRecovery#### returns success.\r
+ //\r
+ if ((LoadOptions[Index].Status == EFI_SUCCESS) &&\r
+ (LoadOptionType == LoadOptionTypePlatformRecovery)) {\r
break;\r
}\r
- if ((LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) {\r
+\r
+ //\r
+ // Only set ReconnectAll flag when the load option executes successfully.\r
+ //\r
+ if (!EFI_ERROR (LoadOptions[Index].Status) &&\r
+ (LoadOptions[Index].Attributes & LOAD_OPTION_FORCE_RECONNECT) != 0) {\r
ReconnectAll = TRUE;\r
}\r
}\r