]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
IntelFrameworkModulePkg/BootMaint: Show "Change Boot order" page correctly
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BootMaint / UpdatePage.c
index 02efefd2a61428503b3d2fc291328924cb506a23..a2e38d2ee899222c8e7864e2ce060101671fcfa8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Dynamically update the pages.\r
 \r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -559,14 +559,30 @@ UpdateOrderPage (
   switch (UpdatePageId) { \r
 \r
   case FORM_BOOT_CHG_ID:\r
-    //GetBootOrder (CallbackData);\r
+    //\r
+    // If the BootOptionOrder in the BmmFakeNvData are same with the date in the BmmOldFakeNVData,\r
+    // means all Boot Options has been save in BootOptionMenu, we can get the date from the menu.\r
+    // else means browser maintains some uncommitted date which are not saved in BootOptionMenu,\r
+    // so we should not get the data from BootOptionMenu to show it.\r
+    //\r
+    if (CompareMem (CallbackData->BmmFakeNvData.BootOptionOrder, CallbackData->BmmOldFakeNVData.BootOptionOrder, sizeof (CallbackData->BmmFakeNvData.BootOptionOrder)) == 0) {\r
+      GetBootOrder (CallbackData);\r
+    }\r
     OptionOrder = CallbackData->BmmFakeNvData.BootOptionOrder;\r
     QuestionId = BOOT_OPTION_ORDER_QUESTION_ID;\r
     VarOffset = BOOT_OPTION_ORDER_VAR_OFFSET;\r
     break;\r
 \r
   case FORM_DRV_CHG_ID:\r
-    //GetDriverOrder (CallbackData);\r
+    //\r
+    // If the DriverOptionOrder in the BmmFakeNvData are same with the date in the BmmOldFakeNVData,\r
+    // means all Driver Options has been save in DriverOptionMenu, we can get the DriverOptionOrder from the menu.\r
+    // else means browser maintains some uncommitted date which are not saved in DriverOptionMenu,\r
+    // so we should not get the data from DriverOptionMenu to show it.\r
+    //\r
+    if (CompareMem (CallbackData->BmmFakeNvData.DriverOptionOrder, CallbackData->BmmOldFakeNVData.DriverOptionOrder, sizeof (CallbackData->BmmFakeNvData.DriverOptionOrder)) == 0) {\r
+      GetDriverOrder (CallbackData);\r
+    }\r
     OptionOrder = CallbackData->BmmFakeNvData.DriverOptionOrder;\r
     QuestionId = DRIVER_OPTION_ORDER_QUESTION_ID;\r
     VarOffset = DRIVER_OPTION_ORDER_VAR_OFFSET;\r