From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.10544.1612365641175274036 for ; Wed, 03 Feb 2021 07:20:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=oOVji7Nx; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=066834118c=abner.chang@hpe.com) Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 113F8bPj025898 for ; Wed, 3 Feb 2021 15:20:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=Z/sKo8fGR/yRwp6kiyljW4/sqPGFV9f0mCraqqXp340=; b=oOVji7NxnZuod7h3PFykqoVX37Yw4kAuJjOKxqYrf+GBEsSbW1cSOV0meOydxCqZPs5z qVjt85WH5NN7wrEnMdlUOf8YPcGDbIERjg1BHvmMmnR/hOlpUQ+UAcYbcyrPUoqkPZth LJZGffWvCLBLyi52BtUVAcQ9MpgBm6qHq7eVf0SwnL7INDWKeE0C9hUPD0m9wZKW2SF/ f4Tt1814+TF2lbbL5PLDu/ulS1cI2mBo76koGSXQKvfKJ7IbQyuV4pWFIOYRzbm7GK2l 0C5ImiSntpbuFH7KTYAxxCeqcwoPU1I0zXcsXFjiQ4uCzU1kJXVyGiL6xUJui78c8Yu9 FA== Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 36fbwrfuj0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 03 Feb 2021 15:20:40 +0000 Received: from G9W9209.americas.hpqcorp.net (g9w9209.houston.hpecorp.net [16.220.66.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5009.houston.hpe.com (Postfix) with ESMTPS id 9839465 for ; Wed, 3 Feb 2021 15:20:39 +0000 (UTC) Received: from G9W9209.americas.hpqcorp.net (2002:10dc:429c::10dc:429c) by G9W9209.americas.hpqcorp.net (2002:10dc:429c::10dc:429c) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Feb 2021 15:20:38 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (15.241.52.10) by G9W9209.americas.hpqcorp.net (16.220.66.156) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 3 Feb 2021 15:20:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E0kxov9jMsR3kRrLLagHnrAFDjYGrMH/xC1DGDQO4+mDD4bIPKGxc7zvzc6sBMDHMZgCkCkVR0MlRRIodoUkS8ykUhp176me9WtY1oBuqIbUhCDl6nvkzttYMKQow1m8cgPPb/ciVd+vajOtT6YcnzPUDEDoiu5uPKhaf4yAGNeRMteBeDdSix33oadR0gQHy2Vj6jLTRIks80WWYFV4eXbN5qRa8ReeS6CvFlkYTZX8MrM95rcj4EgHKGgQMPyzIpHML5OAjStrWOe5/RoqEvN5JD1ori0WVZmJz1S+PXzSgFXU35owljcAz2vl4Ac3Dzs5zpAsPESyzKmzL4qDxA== 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=KPEkr/wCMYmBL+4msUtrjo486sMsGiEQltAnnKefwvE=; b=QIL5Cz11et3krhjbI+eF7jzcBI9v72ulLguMg90ybmmgNPWdViMSfqZh2Sr20Qs1BH39+zDrnQQrKgqPWP2jQeMQ8VDE0wUQt6AKNxc6YNaRkjbcLETFR3fJoO5ZF5gUp8YuXCIKZfXixDofU6mgMNE3RHDS3Swrd+3Lrrer9oZPVtEFCy9nI7/6Yglve2K8vQGOCPVVJmxAmYOQwxRMHLKg/5xGliTPJ3sG54pNhsJ2k4gMdmga08K3ys2DytrKfKcuKzLt0Xc7dTCdAsbuK3CQbJVRi3SF2CbKZJ31Pyfx4Gj3Un91M6AddInmhi5oXVh5tw7LSTPWiO5J7jmuyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7508::16) by CS1PR8401MB0472.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7509::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3805.19; Wed, 3 Feb 2021 15:20:37 +0000 Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::adb6:a875:93ca:b54a]) by CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::adb6:a875:93ca:b54a%12]) with mapi id 15.20.3805.028; Wed, 3 Feb 2021 15:20:37 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "dandan.bi@intel.com" CC: "Dong, Eric" , "Wang, Nickle (HPS SW)" Subject: Re: [edk2-devel] [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLib for EDK2 Redfish Thread-Topic: [edk2-devel] [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLib for EDK2 Redfish Thread-Index: AQHW+E38alKsDp1akUCgbH27fkLXf6pGTecwgABAqIA= Date: Wed, 3 Feb 2021 15:20:37 +0000 Message-ID: References: <20210201030542.22997-1-abner.chang@hpe.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; x-originating-ip: [16.242.247.131] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4add03de-06ac-4b96-c177-08d8c857426d x-ms-traffictypediagnostic: CS1PR8401MB0472: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:193; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: T6Bysn8wmvmdFGZMTV0AnrTKAbkwk18ucKbSMIssY6Ds/QuK983LBcCDHhy7mU7Hyaikhu6X18oXqyhshbNkt9U4/gxjuF4QLwhxiC9JJhkivXnG/ZLNWCzJ/T2NdmGlnEbDtds7USsfO4RzxTTA7BEzk8nvMmSSFqm9npSpkt86Ec2WgSgK6g+lVtAOkUCyUCFwwIHOvDtnq2WGFvmnlZNLwhxZIs35nnedZwZAMAtycFinL+j9QHoeLG0Ghlt2BfYeL7fqbMwvdnDGFzwrz/PIFhxuIIkzMpZEe07+ymrKvj/yTwWgkjygJkhu8eJ8/dJqHzkFkuRIWgE4x0SgZv+0yDB8uLp+eo16bcfBnMyFEud7tdQ88of6mKlCr9CCIKiiUEi2yqenaudHRmYWWrL6EFEHLgdeG6yrONa1mIr5+hECeHujgw2yLpcHkBoOiQ+6vmIcMvQUKGzanrTKPQpEqPcVgO3In5tJ3sL+ImgYcu37lGCNX41xdEsoxkTaFi+DG7TryMvo/OXY0HA34YAYRjN4YXNFPz8P1LregVFwOJEsFtiJaK09qRlmlg+1ne5NMErYSwqfdWXkqeI7hk2JRY6ESjk2hoE3fCFEqxs= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(396003)(346002)(376002)(366004)(136003)(39860400002)(55016002)(478600001)(66446008)(66946007)(66476007)(66556008)(2906002)(966005)(54906003)(9686003)(7696005)(316002)(64756008)(52536014)(110136005)(86362001)(6506007)(4326008)(33656002)(8676002)(26005)(8936002)(76116006)(19627235002)(71200400001)(5660300002)(186003)(30864003)(83380400001)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Y+7F8N9AuZKqMHLSMDXuK6bapgoBgD11kJvJN55FHB7Y64UbuKm0zpJIJOaY?= =?us-ascii?Q?FyVwfgTeqQjNLkeImj6Fncf9r0Tb9HMR1Ff/YnXmkjLHmivcYyas32MDp68g?= =?us-ascii?Q?cYwJqbJw8rFsZ+vY8j+pDghMvulaxK8hXrTOrxaSyQI588fKjypR/VEoas7F?= =?us-ascii?Q?0glmxFk6gPNTSlpWf3tN6IcCM7TE349LHFCdr53GXHZj8BKqFgF9Lz8ngsS2?= =?us-ascii?Q?CZa8n5SeJUZtZyjTkVIjtr9NDOY9EP2C2i/a6rvCgeRUMHqfN6oXCMrhVT96?= =?us-ascii?Q?Ij9YniTkAdgmemhRqaKayCwWeoY9WH7zzdK6C8XK6P0zSALc+x9J3nioYRHH?= =?us-ascii?Q?XSHa7e0qiLuZtTUCGg82nUFt2PRO/FoT2Dbn9SZ2rByMwA4IqeoZCgGbbk4r?= =?us-ascii?Q?lE5/BStR9ZrXalNYAQPzK/+GrwixoP0G34MET3267tNBG/W8T2bBR31OUzb1?= =?us-ascii?Q?SnFue+R+0XJgia6Wgss1y8A5fHMxcphfpI5cZUWhB3TrWnOUHt/ys6kkQrct?= =?us-ascii?Q?iU5Oq0PcxrED/JuttjM9X8OXldKOahJSS0bumj8BPNCxl4fnJ0VRp3hA6nUU?= =?us-ascii?Q?GHwIyRDzomkPibDHYt4ZXjxcDHCy1M0zYslndHTx8+5hTm8OFQrLxW3mmfVk?= =?us-ascii?Q?WamRofEcqHhKFHPWjcrNJrEmqmjztMdkYrI73GH8CphLDQwHf3ADL40O19bI?= =?us-ascii?Q?bAN3QuDJ3s5WUibZiJabcgK8voKeQL4FlnCgp2PBMnyD4k5jKuFuz8F7vSsi?= =?us-ascii?Q?07+uN6GtDkzr0Z9vdqKImMNnNaQq76CMT0n+4lDKI5JUY+sfiwrbkTlx49N8?= =?us-ascii?Q?s7J0MJJqVqnFH3UxpV2nE6Kz88g6UX5MoEuHmbfKpZ9avx7sV9L2j3ssXpGw?= =?us-ascii?Q?HfvtRpb1s7ec25WBB4N8/z/Bm5C1L8KQFNk130ZCpa5CT51/uP5nu1H6OO5Z?= =?us-ascii?Q?x6xE2lSDBMzWtXsuT2zb+qlW0zeuiVsCrRQnG5lwIwAqhU3REa388xazLRVI?= =?us-ascii?Q?GA+5xKZUSUjMcx3mpYXr/VtvvfE8ZNUXxmSHr4382N0o5Dt3mudBtUZtVCJr?= =?us-ascii?Q?n8e7fL59f8/bIGGywUAAtkO8/mRI1iKPSRsDLezIvLhCU6CUgZTpGZRyI+do?= =?us-ascii?Q?8QiFttNvx1tQ2ut4j7wsJosMnBp481oo94QW7LNpDluqNbTlJaGTAPLDRBG1?= =?us-ascii?Q?xPq4X3HCoQwzsgRhah5ThS7AiFjZGI2ocl1U2sxMPE8dk06Xv2Z+J44KKpTe?= =?us-ascii?Q?gIXwSSGpqixOLrSQRiC7sMi0AEivO4A9FpZwPAei3tJZeMhTP8Ajr49/qfVE?= =?us-ascii?Q?LwqSDUJWbuPDyWl5RpHXihTC?= X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 4add03de-06ac-4b96-c177-08d8c857426d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2021 15:20:37.3754 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LCzHc9iuNEMWqcntw7pc8N4zgFVxRG9VHBFSRUxx+JtC5phFjDFedEIw5u/VIdoXLYXVH5ERNrTAOfXKbUKo2Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0472 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.737 definitions=2021-02-03_06:2021-02-03,2021-02-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 phishscore=0 impostorscore=0 mlxscore=0 malwarescore=0 adultscore=0 spamscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102030096 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes Dandan, yours follow coding standard. I will handle that. Also, I will help to push the patch to upstream with your review tag. Thanks Abner > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Dandan Bi > Sent: Wednesday, February 3, 2021 7:34 PM > To: Chang, Abner (HPS SW/FW Technologist) ; > devel@edk2.groups.io > Cc: Dong, Eric ; Wang, Nickle (HPS SW) > > Subject: Re: [edk2-devel] [PATCH v3] MdeModulePkg/Library: Add > HiiGetStringEx to UefiHiiLib for EDK2 Redfish >=20 > One minor comment inline below. > Reviewed-by: Dandan Bi with this is handled. >=20 > 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 > > UefiHiiLib for EDK2 Redfish > > > > Add HiiGetStringEx and leveraged by HiiGetString function to support > > getting 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 keyword language for configuring BIOS setting. > > > > 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(-) > > > > 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 > > > > -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 > > > > **/ > > @@ -123,16 +124,8 @@ HiiSetString ( > > ; > > > > /** > > - Retrieves a string from a string package in a specific language. > > If the language > > - is not specified, then a string from a string package in the > > current platform > > - language is retrieved. If the string cannot be retrieved using the > > specified > > - language or the current platform language, then the string is > > retrieved from > > - the string package in the first language the string package > > supports. 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 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. > > > > @param[in] HiiHandle A handle that was previously registered in > > the HII Database. > > @param[in] StringId The identifier of the string to retrieved fr= om 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 o= f > languages. > > + 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 > > + package 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 register= ed in the > > HII Database. > > + @param[in] StringId The identifier of the string to retri= eved from > the > > string > > + package associated with HiiHandle. > > + @param[in] Language The language of the string to retriev= e. If this > > parameter > > + is NULL, then the current platform la= nguage is used. The > > + format of Language must follow the > > + language format > > assumed > > + the HII Database. > > + @param[in] TryBestLanguage If TRUE, try to get the best matching > > language from all > > + supported languages.If FALSE, the > > + Language must be > > assigned > > + for the StringID. > > + > > + @retval NULL The string specified by StringId is not present in t= he 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 > > + ); > > > > /** > > Retrieves a string from a string package named by GUID, in the > > specified 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. > > > > - 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 > > > > **/ > > @@ -190,16 +191,8 @@ HiiGetPackageString ( } > > > > /** > > - Retrieves a string from a string package in a specific language. > > If the language > > - is not specified, then a string from a string package in the > > current platform > > - language is retrieved. If the string can not be retrieved using > > the specified > > - language or the current platform language, then the string is > > retrieved from > > - the string package in the first language the string package > > supports. 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. > > + Retrieves a string from a string package in a specific language > > + specified in Language or in the best lanaguage. See HiiGetStringEx > > + () for > > the details. > > > > @param[in] HiiHandle A handle that was previously registered in > > the HII Database. > > @param[in] StringId The identifier of the string to retrieved fr= om 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 o= f > languages. > > + 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 > > + package 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 register= ed in the > > HII Database. > > + @param[in] StringId The identifier of the string to retri= eved from > the > > string > > + package associated with HiiHandle. > > + @param[in] Language The language of the string to retriev= e. If this > > parameter > > + is NULL, then the current platform la= nguage is used. The > > + format of Language must follow the > > + language format > > assumed > > + the HII Database. > > + @param[in] TryBestLanguage If TRUE, try to get the best matching > > language from all > > + supported languages.If FALSE, the > > + Language must be > > assigned > > + for the StringID. > > + > > + @retval NULL The string specified by StringId is not present in t= he 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 ( > > > > 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 shoul= d be > ASSERT (!(!TryBestLanguage && Language =3D=3D NULL)); Please help double > check. >=20 > > // > > // Initialize all allocated buffers to NULL > > // > > @@ -261,21 +302,26 @@ HiiGetString ( > > Language =3D ""; > > } > > > > - // > > - // 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; > > } > > > > + > > // > > // Retrieve the size of the string in the string package for the > BestLanguage > > // > > @@ -337,7 +383,7 @@ Error: > > if (PlatformLanguage !=3D NULL) { > > FreePool (PlatformLanguage); > > } > > - if (BestLanguage !=3D NULL) { > > + if (TryBestLanguage && BestLanguage !=3D NULL) { > > FreePool (BestLanguage); > > } > > > > -- > > 2.17.1 >=20 >=20 >=20 >=20 >=20