summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/BootMaintenanceManagerUiLib
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2016-05-17 14:00:06 +0800
committerLiming Gao <liming.gao@intel.com>2016-05-18 10:52:02 +0800
commit720eea6aa80b48acb05c1adc0f835e849d71da97 (patch)
treecddb830fd8e82a05addf34c3a408edbe220c9fa1 /MdeModulePkg/Library/BootMaintenanceManagerUiLib
parentd3bb711834acd3eda35a07d0be7911bc3dbb9e6f (diff)
downloadedk2-720eea6aa80b48acb05c1adc0f835e849d71da97.tar.gz
edk2-720eea6aa80b48acb05c1adc0f835e849d71da97.tar.bz2
edk2-720eea6aa80b48acb05c1adc0f835e849d71da97.zip
BootMaintenanceManagerUiLib: Rollback changes for BootNext.
Commit a85be3ae48a8aaa40b755cd0ff7270c67cfed585 imports errors for BootNext question, this patch rollback the related changes. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/BootMaintenanceManagerUiLib')
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c69
1 files changed, 39 insertions, 30 deletions
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
index fefb714b91..5156975b68 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
@@ -42,53 +42,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,
+ STRING_TOKEN (STR_NONE),
+ EFI_IFR_OPTION_DEFAULT,
+ EFI_IFR_TYPE_NUM_SIZE_32,
+ NONE_BOOTNEXT_VALUE
+ );
+ } else {
HiiCreateOneOfOptionOpCode (
OptionsOpCodeHandle,
- OptionId,
+ 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 +106,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
);