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 <[email protected]>
Cc: Liming Gao <[email protected]>
---
 .../BootMaintenanceManagerCustomizedUiSupport.c    | 65 ++++++++++++----------
 1 file changed, 36 insertions(+), 29 deletions(-)

diff --git 
a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
 
b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
index b32cbdb..a76209f 100644
--- 
a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
+++ 
b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerCustomizedUiSupport.c
@@ -43,17 +43,16 @@ BmmCreateBootNextMenu(
 {
   BM_MENU_ENTRY   *NewMenuEntry;
   BM_LOAD_CONTEXT *NewLoadContext;
-  UINTN           NumberOfOptions;
   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);
 
@@ -61,36 +60,44 @@ BmmCreateBootNextMenu(
     NewMenuEntry    = BOpt_GetMenuEntry (&BootOptionMenu, Index);
     NewLoadContext  = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
 
-    StringBuffer = HiiGetString (HiiHandle, NewMenuEntry->DisplayStringToken, 
NULL);
-    ASSERT (StringBuffer != NULL);
-    OptionId = HiiSetString (HiiHandle, 0, StringBuffer, NULL);
-    FreePool (StringBuffer);
+    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
+        );
+    }
+  }
 
+  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,
@@ -99,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
     );
-- 
2.6.4.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to