From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4D9231A1E89 for ; Mon, 17 Oct 2016 01:52:45 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP; 17 Oct 2016 01:52:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,357,1473145200"; d="scan'208";a="773489403" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by FMSMGA003.fm.intel.com with ESMTP; 17 Oct 2016 01:52:44 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Laszlo Ersek , Liming Gao , Eric Dong Date: Mon, 17 Oct 2016 16:51:57 +0800 Message-Id: <1476694318-18804-4-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1476694318-18804-1-git-send-email-dandan.bi@intel.com> References: <1476694318-18804-1-git-send-email-dandan.bi@intel.com> Subject: [patch 4/5] MdeModulePkg/BMMUI: Show "Change Boot/Driver order" page correctly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 08:52:45 -0000 When user enter the "Change Boot Order" page, the BootOptionOrder in BmmFakeNvData may maintain some uncommitted data which are not saved in "BootOrder" Variable and BootOptionMenu. So we should not always get the BootOptionOrder through the function GetBootOrder, it will result in incorrect UI behaviors. When the BootOptionOrder has not been saved, we should use the BootOptionOrder in current BmmFakeNvData. Cc: Laszlo Ersek Cc: Liming Gao Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- .../Library/BootMaintenanceManagerUiLib/UpdatePage.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c index 29d3ac9..8194979 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/UpdatePage.c @@ -583,18 +583,34 @@ UpdateOrderPage ( QuestionId = 0; VarOffset = 0; switch (UpdatePageId) { case FORM_BOOT_CHG_ID: - GetBootOrder (CallbackData); + // + // If the BootOptionOrder in the BmmFakeNvData are same with the date in the BmmOldFakeNVData, + // means all Boot Options has been save in BootOptionMenu, we can get the date from the menu. + // else means browser maintains some uncommitted date which are not saved in BootOptionMenu, + // so we should not get the data from BootOptionMenu to show it. + // + if (CompareMem (CallbackData->BmmFakeNvData.BootOptionOrder, CallbackData->BmmOldFakeNVData.BootOptionOrder, sizeof (CallbackData->BmmFakeNvData.BootOptionOrder)) == 0) { + GetBootOrder (CallbackData); + } OptionOrder = CallbackData->BmmFakeNvData.BootOptionOrder; QuestionId = BOOT_OPTION_ORDER_QUESTION_ID; VarOffset = BOOT_OPTION_ORDER_VAR_OFFSET; break; case FORM_DRV_CHG_ID: - GetDriverOrder (CallbackData); + // + // If the DriverOptionOrder in the BmmFakeNvData are same with the date in the BmmOldFakeNVData, + // means all Driver Options has been save in DriverOptionMenu, we can get the DriverOptionOrder from the menu. + // else means browser maintains some uncommitted date which are not saved in DriverOptionMenu, + // so we should not get the data from DriverOptionMenu to show it. + // + if (CompareMem (CallbackData->BmmFakeNvData.DriverOptionOrder, CallbackData->BmmOldFakeNVData.DriverOptionOrder, sizeof (CallbackData->BmmFakeNvData.DriverOptionOrder)) == 0) { + GetDriverOrder (CallbackData); + } OptionOrder = CallbackData->BmmFakeNvData.DriverOptionOrder; QuestionId = DRIVER_OPTION_ORDER_QUESTION_ID; VarOffset = DRIVER_OPTION_ORDER_VAR_OFFSET; break; } -- 1.9.5.msysgit.1