**/\r
typedef struct {\r
CONST BDS_COMMON_OPTION *BootOption; // reference only, no ownership\r
+ BOOLEAN Appended; // has been added to a BOOT_ORDER?\r
} ACTIVE_OPTION;\r
\r
\r
/**\r
\r
- Append BootOptionId to BootOrder, reallocating the latter if needed.\r
+ Append an active boot option to BootOrder, reallocating the latter if needed.\r
\r
@param[in out] BootOrder The structure pointing to the array and holding\r
allocation and usage counters.\r
\r
- @param[in] BootOptionId The value to append to the array.\r
+ @param[in] ActiveOption The active boot option whose ID should be\r
+ appended to the array.\r
\r
\r
- @retval RETURN_SUCCESS BootOptionId appended.\r
+ @retval RETURN_SUCCESS ID of ActiveOption appended.\r
\r
@retval RETURN_OUT_OF_RESOURCES Memory reallocation failed.\r
\r
STATIC\r
RETURN_STATUS\r
BootOrderAppend (\r
- IN OUT BOOT_ORDER *BootOrder,\r
- IN UINT16 BootOptionId\r
+ IN OUT BOOT_ORDER *BootOrder,\r
+ IN OUT ACTIVE_OPTION *ActiveOption\r
)\r
{\r
if (BootOrder->Produced == BootOrder->Allocated) {\r
BootOrder->Data = DataNew;\r
}\r
\r
- BootOrder->Data[BootOrder->Produced++] = BootOptionId;\r
+ BootOrder->Data[BootOrder->Produced++] =\r
+ ActiveOption->BootOption->BootCurrent;\r
+ ActiveOption->Appended = TRUE;\r
return RETURN_SUCCESS;\r
}\r
\r
if (IS_LOAD_OPTION_TYPE (Current->Attribute, LOAD_OPTION_ACTIVE)) {\r
if (ScanMode == 1) {\r
(*ActiveOption)[*Count].BootOption = Current;\r
+ (*ActiveOption)[*Count].Appended = FALSE;\r
}\r
++*Count;\r
}\r
//\r
// match found, store ID and continue with next OpenFirmware path\r
//\r
- Status = BootOrderAppend (&BootOrder,\r
- ActiveOption[Idx].BootOption->BootCurrent);\r
+ Status = BootOrderAppend (&BootOrder, &ActiveOption[Idx]);\r
if (Status != RETURN_SUCCESS) {\r
goto ErrorFreeActiveOption;\r
}\r