From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.8003.1612352063814012604 for ; Wed, 03 Feb 2021 03:34:24 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=jRDCMZG3; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: dandan.bi@intel.com) IronPort-SDR: sSryhPM4/55aN1p1MQ2DI5Fo3juCqevCqbO1jVEv+mqVL7vguKtwvUQQG9SuSGxwY5vN4Zdj2c mtE341BavrMg== X-IronPort-AV: E=McAfee;i="6000,8403,9883"; a="180251848" X-IronPort-AV: E=Sophos;i="5.79,398,1602572400"; d="scan'208";a="180251848" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2021 03:34:22 -0800 IronPort-SDR: ZtS4nc5IFipkMjAanZCV0NCdM9AsE+bkJjfUKKshWuXxm/vhXkTEjmUMphay5KXrxmRQg03l2B m6MnKBm0XWRA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,398,1602572400"; d="scan'208";a="433373349" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga001.jf.intel.com with ESMTP; 03 Feb 2021 03:34:22 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 3 Feb 2021 03:34:22 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Wed, 3 Feb 2021 03:34:21 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2 via Frontend Transport; Wed, 3 Feb 2021 03:34:21 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.177) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 3 Feb 2021 03:34:20 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LyCa6/ckdxkVGP8+2Q5V0harcI/htimbK43+m+p8aPMUtT3ee7de0rfktqyAHcKTslYAd33qNsY1zPpRcOySKuBseRRZQMAvLQfIaaY13NjDWj1CIu0kuh/bWfFgbmN5tFHEKGIgXetHcejcYT6bwpCrRhhabdNxZPSZsaYvkWVY13Z0Xs+lJ+WB9T7w//SVICAHXHU7gqHR99A0habgBcdfd79nRBgy382lZk3sN9ekViwSjpCppnlwN4CX/ZFRpOV2P9dwOKhMHaE2ZPfXYh3WjEJAKPyNqWgiclngT07M6TQRzA1I9fd3BGCaAGgECIiB+cal2q2SQKk0lkqQBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DT9uItn/lj+5FOFwL0Dxh+Ovk+Z9788rpyhPw+IwIvI=; b=CTanQ56vQg6wG6VCJpqoPVDOaH+Q0nR9BHL3KXKDRTDcPx02FYr69LKeoFRrvEq7IOmnsw5EOYLWctq+v72vhQ3nUsq9A7K/bEAqUtcMF3K1HRlNiwa22usUEKmv2Hz4Egfy75Ltn7YyXUtbIOrLd1eb31mgztnpbJmPPv3lgpw9z41rSvBJOXjKXf8invyOibqpFu7CZEI0TC7MSEKyi8UxIS6IyO56PAiS1k0SBfQQ4SXfkD59qnOIwhA1hMCqsyvxtfjSicnt7oelP8Ij05I/620yuRQ1eXWtFr8c8OkQwli5rHyjt+bmdzzN9UwmxYmYkfo/OJ40RHGVnQGprw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DT9uItn/lj+5FOFwL0Dxh+Ovk+Z9788rpyhPw+IwIvI=; b=jRDCMZG3IvMy6q7yCnRRhwaqtPIFArajmGOf4MDI3onyLoxpvZ7Mb69A/2N6dV9rPqHEbZuX9sToX1kjJDJswxNJyWCN1ViQs/gFkxx7QM5xWzuqxEqH5rRJft4CYHe9g2IkqdkMZ+g5C/FsTs7PhCIIElhOuDBzPbmBKKHirns= Received: from SJ0PR11MB4862.namprd11.prod.outlook.com (2603:10b6:a03:2de::16) by BY5PR11MB4305.namprd11.prod.outlook.com (2603:10b6:a03:1bf::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.16; Wed, 3 Feb 2021 11:34:19 +0000 Received: from SJ0PR11MB4862.namprd11.prod.outlook.com ([fe80::9c2d:ffbd:1695:c115]) by SJ0PR11MB4862.namprd11.prod.outlook.com ([fe80::9c2d:ffbd:1695:c115%6]) with mapi id 15.20.3805.027; Wed, 3 Feb 2021 11:34:19 +0000 From: "Dandan Bi" To: Abner Chang , "devel@edk2.groups.io" CC: "Dong, Eric" , Nickle Wang Subject: Re: [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLib for EDK2 Redfish Thread-Topic: [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLib for EDK2 Redfish Thread-Index: AQHW+E38alKsDp1akUCgbH27fkLXf6pGTecw Date: Wed, 3 Feb 2021 11:34:19 +0000 Message-ID: References: <20210201030542.22997-1-abner.chang@hpe.com> In-Reply-To: <20210201030542.22997-1-abner.chang@hpe.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: hpe.com; dkim=none (message not signed) header.d=none;hpe.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.55.46.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 594fd78d-43f4-40e8-c8e6-08d8c837a566 x-ms-traffictypediagnostic: BY5PR11MB4305: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i+zl+e1cmfcCbRsmoYe7e9ZMZGPl/MntGhVIfN/BW2BM4vd/91rg5UraWPeGIwt36YduJqTqzJ/BO3b4mhgEX+bwJCBHuJtXPOAf0wzXifjrHTGpkztZrB48shKP48GI7Y76+zzH4jypXK8UL/jW0sIB1bNvUoA0ohQEhBbmsbDi4juBrRmRog6VANdvGGt74aSZn7KA48peOraGCdeVMK4yup+6oBLh2+Nc3n7uf3OWQcmYiue0P24R4WDbtt+RmduyRCiCTJrfKuA2iuHaEPnn5rghMQ6T4zQmDeMhZvYE0gUUuR3Yt8YQTHK/JCl0TRPd/NFJ4G1SLfB0ptnh83krfa3hRCaqNoGZaRohSXB3dhfTd7P3ZYqicLwtCAWpNRKHq1QEijEQh91fV8nSyw4GYSzNcIvTen7x6XzmNRxVoMI2olAIS7n7Ki+acitGdyCvQntVXPgqfwOINgv4w3TDrnQiZpIyfcburJwcl0c9g7VfkBUEAH34S5ve3XLGaf5N5+tau0ervf8EYm/p6g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR11MB4862.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(396003)(346002)(39860400002)(366004)(136003)(55016002)(86362001)(53546011)(316002)(71200400001)(66946007)(8936002)(66556008)(66446008)(6506007)(296002)(2906002)(33656002)(64756008)(66476007)(4326008)(5660300002)(76116006)(186003)(30864003)(26005)(52536014)(110136005)(7696005)(83380400001)(9686003)(478600001)(8676002)(54906003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?LEOBuFta947fsOOjmeR2tsSs+3+IACMl0O9KRWx1btKaEwl6clKeAqNZR2Io?= =?us-ascii?Q?6+F8MhMA7AIOe4aGJscZTqMRRxMGbMeinroXyfKWSGZhJNo7w5ArlArTKJze?= =?us-ascii?Q?F5A8AWsLwIXjvlocdViDWIZjRETo8JU6uoIeNr8373Y9xhmhrhs7CyWHW0WM?= =?us-ascii?Q?KwqfycyzBjcNymLE8AZzj9dcNh0ARIkd6Ff2VioyknQCl5pQIsfQniBPLVX4?= =?us-ascii?Q?twJIRhdzNobFKiyMWz3TIirMct/5ULrCChRSJz7I4L5WWA7//nUS5yf2+9FK?= =?us-ascii?Q?vsszRNSpvIkocvV4aAc0v9Q4CmdN95cliXBLy0fDYNmkE2kVRubuSoXtgoE+?= =?us-ascii?Q?RpD8yowNekod5PvbHzKsbHTfWV8ker+x4et6Z/WWc33njSo4Vu6e9LAigGs+?= =?us-ascii?Q?mQWNSwSSQwPVhcpr+hJHbF4Kl8NGZMdb2rMY5kaaOfhB5YZzAPIWTQFGoSH2?= =?us-ascii?Q?6USvVgv3EvHjNpRP6D1q6khNFVs65Z0NXTI43DXplN6KRaKdBPj4lB128i6u?= =?us-ascii?Q?gxQ8x8NGd9WOawXdB2edPZHcKFaVUJaWhsZlVcITO9o1Y3q/Bcf3FhjMh7UD?= =?us-ascii?Q?KawcRuINaYxfDtejlMDBZgr9oUbmffZ7hJrZNSJwEhlRccgYZ759p11QdEb6?= =?us-ascii?Q?6TR0uu3JRfhbM9YYrYcOlNlTMJSf298rhCpZPYkFvQs54RyZo9poaK6vssLx?= =?us-ascii?Q?NQfdMp2euV9DLkeEAvUXPwn81lSNwkonowun6etVL7wLVYa+No773NZr+iEf?= =?us-ascii?Q?nZH6AsSIXjlTvLlu9eMLUCJOwARChK7L57yC8xnY5WbgT4ze8vQ+nP8e9FR8?= =?us-ascii?Q?JA5yJzQOeyGNdtBVBNA3dVsapGF5WWS8rUJ9LoS/lSPlY6dZb03eZEARWkR8?= =?us-ascii?Q?wnYrso/lTubJSfNpGZoEn+Mg/geVTOF5tSuvWvUrdZfIhwNw2EJ4acLwkr0s?= =?us-ascii?Q?gWtpvMXY8G+8c3VDZMT3kX+5SOxY6CHubJDNgoOxHyEilYONl5WpZuXHpCvd?= =?us-ascii?Q?gQ5MQ1MIVz2ukHXi5HYsDtoP/53ngeNU3nMiUTcnKs6eD9H2PEDs4wHwmcuK?= =?us-ascii?Q?P67fHkaN?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB4862.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 594fd78d-43f4-40e8-c8e6-08d8c837a566 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2021 11:34:19.5792 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OeHmo7yHxdvXbfAdhG0m3lHE+nEbqGjOH5LBBd/F+t2Z8maV9QFU/H6we9D9tcMqTzQKMSfqSM6ImlUftAE9GQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4305 Return-Path: dandan.bi@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable One minor comment inline below. Reviewed-by: Dandan Bi with this is handled. Thanks, Dandan > -----Original Message----- > From: Abner Chang > Sent: Monday, February 1, 2021 11:06 AM > To: devel@edk2.groups.io > Cc: Bi, Dandan ; Dong, Eric ; > Nickle Wang > Subject: [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLi= b > for EDK2 Redfish >=20 > Add HiiGetStringEx and leveraged by HiiGetString function to support gett= ing > string with the best language in optionally. This avoids the string in x-= uefi > language is misled to the language defined by "PlatformLang" or the > "Supported Languages". This change is introduced to support x-uefi keywor= d > language for configuring BIOS setting. >=20 > Signed-off-by: Jiaxin Wu > Signed-off-by: Siyuan Fu > Signed-off-by: Fan Wang > Signed-off-by: Abner Chang > Cc: Dandan Bi > Cc: Eric Dong > Cc: Nickle Wang > --- > MdeModulePkg/Include/Library/HiiLib.h | 60 ++++++++++--- > MdeModulePkg/Library/UefiHiiLib/HiiString.c | 98 +++++++++++++++------ > 2 files changed, 119 insertions(+), 39 deletions(-) >=20 > diff --git a/MdeModulePkg/Include/Library/HiiLib.h > b/MdeModulePkg/Include/Library/HiiLib.h > index c475cb74a1..cd9027fefd 100644 > --- a/MdeModulePkg/Include/Library/HiiLib.h > +++ b/MdeModulePkg/Include/Library/HiiLib.h > @@ -1,7 +1,8 @@ > /** @file > Public include file for the HII Library >=20 > -Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
> +(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -123,16 +124,8 @@ HiiSetString ( > ; >=20 > /** > - Retrieves a string from a string package in a specific language. If t= he > language > - is not specified, then a string from a string package in the current p= latform > - language is retrieved. If the string cannot be retrieved using the sp= ecified > - language or the current platform language, then the string is retrieve= d from > - the string package in the first language the string package supports. = The > - returned string is allocated using AllocatePool(). The caller is resp= onsible > - for freeing the allocated buffer using FreePool(). > - > - If HiiHandle is NULL, then ASSERT(). > - If StringId is 0, then ASSERT(). > + Retrieves a string from a string package in a specific language > + specified in Language or in the best lanaguage. See HiiGetStringEx () = for > the details. >=20 > @param[in] HiiHandle A handle that was previously registered in the = HII > Database. > @param[in] StringId The identifier of the string to retrieved from = the > string > @@ -152,8 +145,49 @@ HiiGetString ( > IN EFI_HII_HANDLE HiiHandle, > IN EFI_STRING_ID StringId, > IN CONST CHAR8 *Language OPTIONAL > - ) > -; > + ); > + > +/** > + Retrieves a string from a string package in a specific language or in > +the best > + language at discretion of this function according to the priority of l= anguages. > + TryBestLanguage is used to get the string in the best language or in > +the language > + specified in Language parameter. The behavior is, > + If TryBestLanguage is TRUE, this function looks for the best language = for > the string. > + - If the string can not be retrieved using the specified language or = the > current > + platform language, then the string is retrieved from the string pac= kage in > the > + first language the string package supports. > + If TryBestLanguage is FALSE, Language must be specified for retrieving= the > string. > + > + The returned string is allocated using AllocatePool(). The caller is > + responsible for freeing the allocated buffer using FreePool(). > + > + If HiiHandle is NULL, then ASSERT(). > + If StringId is 0, then ASSET. > + If TryBestLanguage is FALE and Language is NULL, then ASSERT(). > + > + @param[in] HiiHandle A handle that was previously registered = in the > HII Database. > + @param[in] StringId The identifier of the string to retrieve= d from the > string > + package associated with HiiHandle. > + @param[in] Language The language of the string to retrieve. = If this > parameter > + is NULL, then the current platform langu= age is used. The > + format of Language must follow the langu= age format > assumed > + the HII Database. > + @param[in] TryBestLanguage If TRUE, try to get the best matching > language from all > + supported languages.If FALSE, the Langua= ge must be > assigned > + for the StringID. > + > + @retval NULL The string specified by StringId is not present in the = string > package. > + @retval Other The string was returned. > + > +**/ > +EFI_STRING > +EFIAPI > +HiiGetStringEx ( > + IN EFI_HII_HANDLE HiiHandle, > + IN EFI_STRING_ID StringId, > + IN CONST CHAR8 *Language OPTIONAL, > + IN BOOLEAN TryBestLanguage > + ); >=20 > /** > Retrieves a string from a string package named by GUID, in the specifi= ed > language. > diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiString.c > b/MdeModulePkg/Library/UefiHiiLib/HiiString.c > index 95229f8a8c..a9a11aef98 100644 > --- a/MdeModulePkg/Library/UefiHiiLib/HiiString.c > +++ b/MdeModulePkg/Library/UefiHiiLib/HiiString.c > @@ -1,7 +1,8 @@ > /** @file > HII Library implementation that uses DXE protocols and services. >=20 > - Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> + Copyright (c) 2006 - 2021, Intel Corporation. All rights > + reserved.
> + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -190,16 +191,8 @@ HiiGetPackageString ( } >=20 > /** > - Retrieves a string from a string package in a specific language. If t= he > language > - is not specified, then a string from a string package in the current p= latform > - language is retrieved. If the string can not be retrieved using the s= pecified > - language or the current platform language, then the string is retrieve= d from > - the string package in the first language the string package supports. = The > - returned string is allocated using AllocatePool(). The caller is resp= onsible > - for freeing the allocated buffer using FreePool(). > - > - If HiiHandle is NULL, then ASSERT(). > - If StringId is 0, then ASSET. > + Retrieves a string from a string package in a specific language > + specified in Language or in the best lanaguage. See HiiGetStringEx () = for > the details. >=20 > @param[in] HiiHandle A handle that was previously registered in the = HII > Database. > @param[in] StringId The identifier of the string to retrieved from = the > string > @@ -220,6 +213,51 @@ HiiGetString ( > IN EFI_STRING_ID StringId, > IN CONST CHAR8 *Language OPTIONAL > ) > +{ > + return HiiGetStringEx (HiiHandle, StringId, Language, TRUE); } > + > +/** > + Retrieves a string from a string package in a specific language or in > +the best > + language at discretion of this function according to the priority of l= anguages. > + TryBestLanguage is used to get the string in the best language or in > +the language > + specified in Language parameter. The behavior is, > + If TryBestLanguage is TRUE, this function looks for the best language = for > the string. > + - If the string can not be retrieved using the specified language or = the > current > + platform language, then the string is retrieved from the string pac= kage in > the > + first language the string package supports. > + If TryBestLanguage is FALSE, Language must be specified for retrieving= the > string. > + > + The returned string is allocated using AllocatePool(). The caller is > + responsible for freeing the allocated buffer using FreePool(). > + > + If HiiHandle is NULL, then ASSERT(). > + If StringId is 0, then ASSET. > + If TryBestLanguage is FALE and Language is NULL, then ASSERT(). > + > + @param[in] HiiHandle A handle that was previously registered = in the > HII Database. > + @param[in] StringId The identifier of the string to retrieve= d from the > string > + package associated with HiiHandle. > + @param[in] Language The language of the string to retrieve. = If this > parameter > + is NULL, then the current platform langu= age is used. The > + format of Language must follow the langu= age format > assumed > + the HII Database. > + @param[in] TryBestLanguage If TRUE, try to get the best matching > language from all > + supported languages.If FALSE, the Langua= ge must be > assigned > + for the StringID. > + > + @retval NULL The string specified by StringId is not present in the = string > package. > + @retval Other The string was returned. > + > +**/ > +EFI_STRING > +EFIAPI > +HiiGetStringEx ( > + IN EFI_HII_HANDLE HiiHandle, > + IN EFI_STRING_ID StringId, > + IN CONST CHAR8 *Language OPTIONAL, > + IN BOOLEAN TryBestLanguage > + ) > { > EFI_STATUS Status; > UINTN StringSize; > @@ -231,7 +269,10 @@ HiiGetString ( >=20 > ASSERT (HiiHandle !=3D NULL); > ASSERT (StringId !=3D 0); > - > + // > + // Language must be specified if TryBestLanguage =3D FALSE. > + // > + ASSERT (!(TryBestLanguage =3D=3D FALSE && Language =3D=3D NULL)); One minor here, in order to following the coding style, this seems should b= e ASSERT (!(!TryBestLanguage && Language =3D=3D NULL)); Please help double check. > // > // Initialize all allocated buffers to NULL > // > @@ -261,21 +302,26 @@ HiiGetString ( > Language =3D ""; > } >=20 > - // > - // Get the best matching language from SupportedLanguages > - // > - BestLanguage =3D GetBestLanguage ( > - SupportedLanguages, > - FALSE, //= RFC 4646 mode > - Language, //= Highest priority > - PlatformLanguage !=3D NULL ? PlatformLanguage : "", = // Next > highest priority > - SupportedLanguages, //= Lowest priority > - NULL > - ); > - if (BestLanguage =3D=3D NULL) { > - goto Error; > + if (TryBestLanguage) { > + // > + // Get the best matching language from SupportedLanguages > + // > + BestLanguage =3D GetBestLanguage ( > + SupportedLanguages, > + FALSE, = // RFC 4646 mode > + Language, = // Highest priority > + PlatformLanguage !=3D NULL ? PlatformLanguage : "",= // Next > highest priority > + SupportedLanguages, = // Lowest priority > + NULL > + ); > + if (BestLanguage =3D=3D NULL) { > + goto Error; > + } > + } else { > + BestLanguage =3D (CHAR8 *) Language; > } >=20 > + > // > // Retrieve the size of the string in the string package for the BestL= anguage > // > @@ -337,7 +383,7 @@ Error: > if (PlatformLanguage !=3D NULL) { > FreePool (PlatformLanguage); > } > - if (BestLanguage !=3D NULL) { > + if (TryBestLanguage && BestLanguage !=3D NULL) { > FreePool (BestLanguage); > } >=20 > -- > 2.17.1