summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-10-17 14:04:21 +0800
committerStar Zeng <star.zeng@intel.com>2016-10-19 11:37:51 +0800
commit7880f73a8e89f482c61e181861997331baf37857 (patch)
tree520fdf9b6dd144d676b693795f2d56405f3e4418 /MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
parent9ec24f5f7322402e8ac5ba0501cd271dd17bf237 (diff)
downloadedk2-platforms-7880f73a8e89f482c61e181861997331baf37857.tar.xz
MdeModulePkg/BMMUI: Make the BmmFakeNvData and BmmOldFakeNVData consistent
In BootMaintRouteConfig function, it will compare the data in BmmFakeNvData and BmmOldFakeNVData to see whether there are some changes need to save. In current codes when discarding changes or removing the useless changes, it will update the related fields in BmmFakeNvData. But also need to update related fields in BmmOldFakeNVData, or it will result in incorrect comparison in BootMaintRouteConfig function, then resulting in incorrect UI behaviors. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c')
-rw-r--r--MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
index 92c44ea867..7475a94a27 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
@@ -925,6 +925,7 @@ BootMaintCallback (
BMM_CALLBACK_DATA *Private;
BM_MENU_ENTRY *NewMenuEntry;
BMM_FAKE_NV_DATA *CurrentFakeNVMap;
+ BMM_FAKE_NV_DATA *OldFakeNVMap;
UINTN Index;
EFI_DEVICE_PATH_PROTOCOL * File;
@@ -959,6 +960,7 @@ BootMaintCallback (
// Retrive uncommitted data from Form Browser
//
CurrentFakeNVMap = &Private->BmmFakeNvData;
+ OldFakeNVMap = &Private->BmmOldFakeNVData;
HiiGetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap);
if (Action == EFI_BROWSER_ACTION_CHANGING) {
@@ -1061,8 +1063,10 @@ BootMaintCallback (
//
// Discard changes and exit formset
//
- CurrentFakeNVMap->DriverOptionalData[0] = 0x0000;
- CurrentFakeNVMap->DriverDescriptionData[0] = 0x0000;
+ ZeroMem (CurrentFakeNVMap->DriverOptionalData, sizeof (CurrentFakeNVMap->DriverOptionalData));
+ ZeroMem (CurrentFakeNVMap->BootDescriptionData, sizeof (CurrentFakeNVMap->BootDescriptionData));
+ ZeroMem (OldFakeNVMap->DriverOptionalData, sizeof (OldFakeNVMap->DriverOptionalData));
+ ZeroMem (OldFakeNVMap->DriverDescriptionData, sizeof (OldFakeNVMap->DriverDescriptionData));
CurrentFakeNVMap->DriverOptionChanged = FALSE;
CurrentFakeNVMap->ForceReconnect = TRUE;
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
@@ -1070,8 +1074,10 @@ BootMaintCallback (
//
// Discard changes and exit formset
//
- CurrentFakeNVMap->BootOptionalData[0] = 0x0000;
- CurrentFakeNVMap->BootDescriptionData[0] = 0x0000;
+ ZeroMem (CurrentFakeNVMap->BootOptionalData, sizeof (CurrentFakeNVMap->BootOptionalData));
+ ZeroMem (CurrentFakeNVMap->BootDescriptionData, sizeof (CurrentFakeNVMap->BootDescriptionData));
+ ZeroMem (OldFakeNVMap->BootOptionalData, sizeof (OldFakeNVMap->BootOptionalData));
+ ZeroMem (OldFakeNVMap->BootDescriptionData, sizeof (OldFakeNVMap->BootDescriptionData));
CurrentFakeNVMap->BootOptionChanged = FALSE;
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT;
} else if (QuestionId == KEY_VALUE_BOOT_DESCRIPTION || QuestionId == KEY_VALUE_BOOT_OPTION) {