BootMaintenanceManagerUiLib: Rollback changes for BootNext.

Commit a85be3ae48 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>
This commit is contained in:
Eric Dong 2016-05-17 14:00:06 +08:00 committed by Liming Gao
parent d3bb711834
commit 720eea6aa8
1 changed files with 42 additions and 33 deletions

View File

@ -42,52 +42,61 @@ BmmCreateBootNextMenu(
) )
{ {
BM_MENU_ENTRY *NewMenuEntry; BM_MENU_ENTRY *NewMenuEntry;
UINTN NumberOfOptions; BM_LOAD_CONTEXT *NewLoadContext;
UINT16 Index; UINT16 Index;
VOID *OptionsOpCodeHandle; VOID *OptionsOpCodeHandle;
CHAR16 *StringBuffer; UINT32 BootNextIndex;
EFI_STRING_ID OptionId;
NumberOfOptions = BootOptionMenu.MenuNumber; if (BootOptionMenu.MenuNumber == 0) {
if (NumberOfOptions == 0) {
return; return;
} }
BootNextIndex = NONE_BOOTNEXT_VALUE;
OptionsOpCodeHandle = HiiAllocateOpCodeHandle (); OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (OptionsOpCodeHandle != NULL); ASSERT (OptionsOpCodeHandle != NULL);
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) { for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index); NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
StringBuffer = HiiGetString (HiiHandle, NewMenuEntry->DisplayStringToken, NULL); if (NewLoadContext->IsBootNext) {
ASSERT (StringBuffer != NULL); HiiCreateOneOfOptionOpCode (
OptionId = HiiSetString (HiiHandle, 0, StringBuffer, NULL); OptionsOpCodeHandle,
FreePool (StringBuffer); NewMenuEntry->DisplayStringToken,
EFI_IFR_OPTION_DEFAULT,
HiiCreateOneOfOptionOpCode ( EFI_IFR_TYPE_NUM_SIZE_32,
OptionsOpCodeHandle, Index
OptionId, );
0, BootNextIndex = Index;
EFI_IFR_TYPE_NUM_SIZE_16, } else {
Index HiiCreateOneOfOptionOpCode (
); OptionsOpCodeHandle,
NewMenuEntry->DisplayStringToken,
0,
EFI_IFR_TYPE_NUM_SIZE_32,
Index
);
}
} }
StringBuffer = HiiGetString (HiiHandle, STRING_TOKEN (STR_NONE), NULL); if (BootNextIndex == NONE_BOOTNEXT_VALUE) {
ASSERT (StringBuffer != NULL); HiiCreateOneOfOptionOpCode (
OptionId = HiiSetString (HiiHandle, 0, StringBuffer, NULL); OptionsOpCodeHandle,
FreePool (StringBuffer); STRING_TOKEN (STR_NONE),
EFI_IFR_OPTION_DEFAULT,
// EFI_IFR_TYPE_NUM_SIZE_32,
// Set no Boot Next Value as default. NONE_BOOTNEXT_VALUE
// );
HiiCreateOneOfOptionOpCode ( } else {
OptionsOpCodeHandle, HiiCreateOneOfOptionOpCode (
OptionId, OptionsOpCodeHandle,
EFI_IFR_OPTION_DEFAULT, STRING_TOKEN (STR_NONE),
EFI_IFR_TYPE_NUM_SIZE_16, 0,
Index EFI_IFR_TYPE_NUM_SIZE_32,
); NONE_BOOTNEXT_VALUE
);
}
HiiCreateOneOfOpCode ( HiiCreateOneOfOpCode (
StartOpCodeHandle, StartOpCodeHandle,
@ -97,7 +106,7 @@ BmmCreateBootNextMenu(
STRING_TOKEN (STR_BOOT_NEXT), STRING_TOKEN (STR_BOOT_NEXT),
STRING_TOKEN (STR_BOOT_NEXT_HELP), STRING_TOKEN (STR_BOOT_NEXT_HELP),
0, 0,
EFI_IFR_NUMERIC_SIZE_2, EFI_IFR_NUMERIC_SIZE_4,
OptionsOpCodeHandle, OptionsOpCodeHandle,
NULL NULL
); );