From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3DD98821EB for ; Mon, 20 Feb 2017 03:13:48 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 20 Feb 2017 03:13:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,186,1484035200"; d="scan'208";a="1132326979" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 20 Feb 2017 03:13:46 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 20 Feb 2017 03:13:46 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 20 Feb 2017 03:13:24 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Mon, 20 Feb 2017 19:13:22 +0800 From: "Dong, Eric" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [edk2] [patch] MdeModulePkg/BMMUiLib: Remove old useless data before new save action Thread-Index: AQHSizccOf3Y9/UESkGLK6U6ykHBUKFxvjBA Date: Mon, 20 Feb 2017 11:13:22 +0000 Message-ID: References: <1487567149-274444-1-git-send-email-dandan.bi@intel.com> In-Reply-To: <1487567149-274444-1-git-send-email-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch] MdeModulePkg/BMMUiLib: Remove old useless data before new save action 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, 20 Feb 2017 11:13:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Da= ndan Bi > Sent: Monday, February 20, 2017 1:06 PM > To: edk2-devel@lists.01.org > Cc: Dong, Eric; Gao, Liming > Subject: [edk2] [patch] MdeModulePkg/BMMUiLib: Remove old useless data be= fore new save action >=20 > There exits the case that when saving changes in form A, > the old saved data in form B are not cleaned, will be saved > again with the new save. Thus incorrect UI behavior will be > shown. This patch is to remove some useless data. >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D385 >=20 > Cc: Eric Dong > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Dandan Bi > --- > .../BootMaintenanceManagerUiLib/BootMaintenance.c | 35 ++++++++++++++++= +++++- > .../BootMaintenanceManager.h | 14 ++++++++- > 2 files changed, 47 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMainten= ance.c > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c > index e49ab98..3ff23a5 100644 > --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c > +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c > @@ -1,9 +1,9 @@ > /** @file > The functions for Boot Maintainence Main menu. >=20 > -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BS= D License > which accompanies this distribution. The full text of the license may b= e found at > http://opensource.org/licenses/bsd-license.php >=20 > @@ -1212,13 +1212,15 @@ BootMaintCallback ( > if ((Value =3D=3D NULL) || (ActionRequest =3D=3D NULL)) { > return EFI_INVALID_PARAMETER; > } >=20 > if (QuestionId =3D=3D KEY_VALUE_SAVE_AND_EXIT_BOOT) { > + CleanUselessBeforeSubmit (Private); > CurrentFakeNVMap->BootOptionChanged =3D FALSE; > *ActionRequest =3D EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT; > } else if (QuestionId =3D=3D KEY_VALUE_SAVE_AND_EXIT_DRIVER) { > + CleanUselessBeforeSubmit (Private); > CurrentFakeNVMap->DriverOptionChanged =3D FALSE; > *ActionRequest =3D EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT; > } else if (QuestionId =3D=3D KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER) { > // > // Discard changes and exit formset > @@ -1267,10 +1269,11 @@ BootMaintCallback ( > } else { > switch (QuestionId) { > case KEY_VALUE_SAVE_AND_EXIT: > case KEY_VALUE_NO_SAVE_AND_EXIT: > if (QuestionId =3D=3D KEY_VALUE_SAVE_AND_EXIT) { > + CleanUselessBeforeSubmit (Private); > *ActionRequest =3D EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT= ; > } else if (QuestionId =3D=3D KEY_VALUE_NO_SAVE_AND_EXIT) { > DiscardChangeHandler (Private, CurrentFakeNVMap); > *ActionRequest =3D EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXI= T; > } > @@ -1369,10 +1372,40 @@ DiscardChangeHandler ( > break; > } > } >=20 > /** > + This function is to clean some useless data before submit changes. > + > + @param Private The BMM context data. > + > +**/ > +VOID > +CleanUselessBeforeSubmit ( > + IN BMM_CALLBACK_DATA *Private > + ) > +{ > + UINT16 Index; > + if (Private->BmmPreviousPageId !=3D FORM_BOOT_DEL_ID) { > + for (Index =3D 0; Index < BootOptionMenu.MenuNumber; Index++) { > + if (Private->BmmFakeNvData.BootOptionDel[Index] && !Private->BmmFa= keNvData.BootOptionDelMark[Index]) { > + Private->BmmFakeNvData.BootOptionDel[Index] =3D FALSE; > + Private->BmmOldFakeNVData.BootOptionDel[Index] =3D FALSE; > + } > + } > + } > + if (Private->BmmPreviousPageId !=3D FORM_DRV_DEL_ID) { > + for (Index =3D 0; Index < DriverOptionMenu.MenuNumber; Index++) { > + if (Private->BmmFakeNvData.DriverOptionDel[Index] && !Private->Bmm= FakeNvData.DriverOptionDelMark[Index]) { > + Private->BmmFakeNvData.DriverOptionDel[Index] =3D FALSE; > + Private->BmmOldFakeNVData.DriverOptionDel[Index] =3D FALSE; > + } > + } > + } > +} > + > +/** >=20 > Update the menus in the BMM page. >=20 > **/ > VOID > diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMainten= anceManager.h > b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager= .h > index 0665c78..532b75b 100644 > --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceMan= ager.h > +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceMan= ager.h > @@ -1,9 +1,9 @@ > /** @file > Header file for boot maintenance module. >=20 > -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BS= D License > which accompanies this distribution. The full text of the license may b= e found at > http://opensource.org/licenses/bsd-license.php >=20 > @@ -1047,10 +1047,22 @@ VOID > DiscardChangeHandler ( > IN BMM_CALLBACK_DATA *Private, > IN BMM_FAKE_NV_DATA *CurrentFakeNVMap > ); >=20 > + > +/** > + This function is to clean some useless data before submit changes. > + > + @param Private The BMM context data. > + > +**/ > +VOID > +CleanUselessBeforeSubmit ( > + IN BMM_CALLBACK_DATA *Private > + ); > + > /** > Dispatch the display to the next page based on NewPageId. >=20 > @param Private The BMM context data. > @param NewPageId The original page ID. > -- > 1.9.5.msysgit.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel