From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: dandan.bi@intel.com) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by groups.io with SMTP; Tue, 09 Jul 2019 17:41:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2019 17:41:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,472,1557212400"; d="scan'208";a="189002961" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 09 Jul 2019 17:41:39 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 9 Jul 2019 17:41:39 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 9 Jul 2019 17:41:38 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.110]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.22]) with mapi id 14.03.0439.000; Wed, 10 Jul 2019 08:41:37 +0800 From: "Dandan Bi" To: "devel@edk2.groups.io" , "Yeh, GregX" CC: "Ni, Ray" , "Kuo, Ted" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyed Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess protocol in case it's destroyed Thread-Index: AQHVNgkB7HgGvDy3yEOXr/g23l0DOabDBEiw Date: Wed, 10 Jul 2019 00:41:36 +0000 Message-ID: <3C0D5C461C9E904E8F62152F6274C0BB40C1DBA4@SHSMSX104.ccr.corp.intel.com> References: <20190709034654.14896-1-gregx.yeh@intel.com> In-Reply-To: <20190709034654.14896-1-gregx.yeh@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 Return-Path: dandan.bi@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Dandan Bi Thanks, Dandan > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GregX Yeh > Sent: Tuesday, July 9, 2019 11:47 AM > To: devel@edk2.groups.io > Cc: Bi, Dandan ; Ni, Ray ; Kuo, T= ed > > Subject: [edk2-devel] [PATCH] MdeModulePkg/Setup: Check ConfigAccess > protocol in case it's destroyed >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1920 > Check ConfigAccess protocol is available before process user input. >=20 > Signed-off-by: GregX Yeh > Cc: Dandan Bi > Cc: Ray Ni > Cc: Ted Kuo > --- > .../Universal/SetupBrowserDxe/Presentation.c | 34 > ++++++++++++++++++++++ > 1 file changed, 34 insertions(+) >=20 > diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c > b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c > index d7927725b2..7c36a6f2b7 100644 > --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c > +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c > @@ -20,6 +20,38 @@ UINT16 mCurFakeQestId; > FORM_DISPLAY_ENGINE_FORM gDisplayFormData; > BOOLEAN mFinishRetrieveCall =3D FALSE; >=20 > +/** > + Check whether the ConfigAccess protocol is available > + > + @parm FormSet FormSet of which the ConfigAcces protocol nee= d to > be checked. > + > + @retval EFI_SUCCESS The function executed successfully. > + > +**/ > +EFI_STATUS > +CheckConfigAccess( > + IN FORM_BROWSER_FORMSET *FormSet > + ) > +{ > + EFI_STATUS Status; > + > + Status =3D gBS->HandleProtocol ( > + FormSet->DriverHandle, > + &gEfiHiiConfigAccessProtocolGuid, > + (VOID **) &FormSet->ConfigAccess > + ); > + if (EFI_ERROR (Status)) { > + // > + // Configuration Driver don't attach ConfigAccess protocol to its H= II > package > + // list, then there will be no configuration action required. > + // Or the ConfigAccess protocol has been uninstalled. > + // > + FormSet->ConfigAccess =3D NULL; > + } > + > + return EFI_SUCCESS; > +} > + > /** > Evaluate all expressions in a Form. >=20 > @@ -1686,6 +1718,8 @@ DisplayForm ( > return Status; > } >=20 > + CheckConfigAccess(gCurrentSelection->FormSet); > + > Status =3D ProcessUserInput (&UserInput); > FreeDisplayFormData(); > return Status; > -- > 2.16.2.windows.1 >=20 >=20 >=20