X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FBootMaintenanceManagerUiLib%2FBootMaintenanceManagerCustomizedUiSupport.c;h=b25bc67c063c0d9629b6cc9eae674a6effbe41fe;hb=2c8d2545f59bf00f0b2460dbeabee6645d130d3e;hp=fefb714b91669e56ac14c92ba02b85d45b2c312d;hpb=7b13510f2a0a2a118cdafdaa67720ca8e3fe37de;p=mirror_edk2.git diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c index fefb714b91..b25bc67c06 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c @@ -32,7 +32,8 @@ STATIC UI_HII_DRIVER_INSTANCE *gHiiDriverList; /** Create the dynamic item to allow user to set the "BootNext" vaule. - @param CallbackData The BMM context data. + @param[in] HiiHandle The hii handle for the Uiapp driver. + @param[in] StartOpCodeHandle The opcode handle to save the new opcode. **/ VOID @@ -42,53 +43,62 @@ BmmCreateBootNextMenu( ) { BM_MENU_ENTRY *NewMenuEntry; - UINTN NumberOfOptions; + BM_LOAD_CONTEXT *NewLoadContext; UINT16 Index; VOID *OptionsOpCodeHandle; - CHAR16 *StringBuffer; - EFI_STRING_ID OptionId; + UINT32 BootNextIndex; - NumberOfOptions = BootOptionMenu.MenuNumber; - if (NumberOfOptions == 0) { + if (BootOptionMenu.MenuNumber == 0) { return; } + BootNextIndex = NONE_BOOTNEXT_VALUE; + OptionsOpCodeHandle = HiiAllocateOpCodeHandle (); ASSERT (OptionsOpCodeHandle != NULL); for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) { NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index); + NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext; + + if (NewLoadContext->IsBootNext) { + HiiCreateOneOfOptionOpCode ( + OptionsOpCodeHandle, + NewMenuEntry->DisplayStringToken, + EFI_IFR_OPTION_DEFAULT, + EFI_IFR_TYPE_NUM_SIZE_32, + Index + ); + BootNextIndex = Index; + } else { + HiiCreateOneOfOptionOpCode ( + OptionsOpCodeHandle, + NewMenuEntry->DisplayStringToken, + 0, + EFI_IFR_TYPE_NUM_SIZE_32, + Index + ); + } + } - StringBuffer = HiiGetString (HiiHandle, NewMenuEntry->DisplayStringToken, NULL); - ASSERT (StringBuffer != NULL); - OptionId = HiiSetString (HiiHandle, 0, StringBuffer, NULL); - FreePool (StringBuffer); - + if (BootNextIndex == NONE_BOOTNEXT_VALUE) { HiiCreateOneOfOptionOpCode ( OptionsOpCodeHandle, - OptionId, + STRING_TOKEN (STR_NONE), + EFI_IFR_OPTION_DEFAULT, + EFI_IFR_TYPE_NUM_SIZE_32, + NONE_BOOTNEXT_VALUE + ); + } else { + HiiCreateOneOfOptionOpCode ( + OptionsOpCodeHandle, + STRING_TOKEN (STR_NONE), 0, - EFI_IFR_TYPE_NUM_SIZE_16, - Index + EFI_IFR_TYPE_NUM_SIZE_32, + NONE_BOOTNEXT_VALUE ); } - StringBuffer = HiiGetString (HiiHandle, STRING_TOKEN (STR_NONE), NULL); - ASSERT (StringBuffer != NULL); - OptionId = HiiSetString (HiiHandle, 0, StringBuffer, NULL); - FreePool (StringBuffer); - - // - // Set no Boot Next Value as default. - // - HiiCreateOneOfOptionOpCode ( - OptionsOpCodeHandle, - OptionId, - EFI_IFR_OPTION_DEFAULT, - EFI_IFR_TYPE_NUM_SIZE_16, - Index - ); - HiiCreateOneOfOpCode ( StartOpCodeHandle, (EFI_QUESTION_ID) BOOT_NEXT_QUESTION_ID, @@ -97,7 +107,7 @@ BmmCreateBootNextMenu( STRING_TOKEN (STR_BOOT_NEXT), STRING_TOKEN (STR_BOOT_NEXT_HELP), 0, - EFI_IFR_NUMERIC_SIZE_2, + EFI_IFR_NUMERIC_SIZE_4, OptionsOpCodeHandle, NULL ); @@ -111,10 +121,6 @@ BmmCreateBootNextMenu( @param[in] HiiHandle The hii handle for the Uiapp driver. @param[in] StartOpCodeHandle The opcode handle to save the new opcode. - @param[in] PromptId The Prompt string id. - @param[in] HelpId The help string id. - @param[in] FormId The Form id for the dest form. - @param[in] QuestionId The question id for this goto question. **/ VOID @@ -213,10 +219,6 @@ BmmCreateComOptionMenu ( @param[in] HiiHandle The hii handle for the Uiapp driver. @param[in] StartOpCodeHandle The opcode handle to save the new opcode. - @param[in] PromptId The Prompt string id. - @param[in] HelpId The help string id. - @param[in] FormId The Form id for the dest form. - @param[in] QuestionId The question id for this goto question. **/ VOID @@ -354,8 +356,8 @@ IsRequiredDriver ( @param HiiHandle The hii handle for the Uiapp driver. @param ClassGuid The class guid for the driver which is the target. + @param SpecialHandlerFn The pointer to the specail handler function, if any. @param StartOpCodeHandle The opcode handle to save the new opcode. - @param SpecialHandler The pointer to the specail handler function, if any. @retval EFI_SUCCESS Search the driver success