<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=gb2312"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:等线;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@等线";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:宋体;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:等线;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:等线'>I am OK for any option. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:等线'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:等线'>Thanks<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:等线'>LIming<o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:等线'>发件人<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-size:11.0pt;font-family:等线'> bounce+27952+71277+4905953+8761045@groups.io <bounce+27952+71277+4905953+8761045@groups.io> </span><b><span style='font-size:11.0pt;font-family:等线'>代表 </span></b><span lang=EN-US style='font-size:11.0pt;font-family:等线'>Abner Chang<br></span><b><span style='font-size:11.0pt;font-family:等线'>发送时间<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-size:11.0pt;font-family:等线'> 2021</span><span style='font-size:11.0pt;font-family:等线'>年<span lang=EN-US>2</span>月<span lang=EN-US>5</span>日<span lang=EN-US> 9:51<br></span><b>收件人<span lang=EN-US>:</span></b><span lang=EN-US> devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>; dandan.bi@intel.com<br></span><b>抄送<span lang=EN-US>:</span></b><span lang=EN-US> 'Dong, Eric' <eric.dong@intel.com>; Wang, Nickle (HPS SW) <nickle.wang@hpe.com><br></span><b>主题<span lang=EN-US>:</span></b><span lang=EN-US> Re: [edk2-devel] [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLib for EDK2 Redfish<o:p></o:p></span></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:ZH-TW'>Hi Liming,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:ZH-TW'>Do you agree to keep the one Dandan suggested? <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:ZH-TW'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:ZH-TW'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:ZH-TW'>Abner<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:ZH-TW'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri",sans-serif'> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> [<a href="mailto:devel@edk2.groups.io">mailto:devel@edk2.groups.io</a>] <b>On Behalf Of </b>Abner Chang<br><b>Sent:</b> Thursday, February 4, 2021 4:36 PM<br><b>To:</b> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>; <a href="mailto:dandan.bi@intel.com">dandan.bi@intel.com</a><br><b>Cc:</b> 'Dong, Eric' <<a href="mailto:eric.dong@intel.com">eric.dong@intel.com</a>>; Wang, Nickle (HPS SW) <<a href="mailto:nickle.wang@hpe.com">nickle.wang@hpe.com</a>><br><b>Subject:</b> Re: [edk2-devel] [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLib for EDK2 Redfish<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='color:#212121'>This looks to me not quite intuitional.<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span lang=EN-US style='color:#212121'> !(!TryBestLanguage && Language == NULL) seems more straightforward and exactly what we would like to catch.<o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><p class=MsoNormal><span lang=EN-US>Abner <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Get <a href="https://aka.ms/ghei36">Outlook for Android</a><o:p></o:p></span></p><div id=id-eb242f6b-27c7-4609-9248-32c8ce4dfbb8><div><p class=MsoNormal><span lang=EN-US style='font-family:"Arial",sans-serif;color:black'><o:p> </o:p></span></p></div><div class=MsoNormal align=center style='text-align:center'><span lang=EN-US><hr size=2 width="98%" align=center></span></div><div id=divRplyFwdMsg><p class=MsoNormal><strong><span lang=EN-US style='font-family:宋体'>From:</span></strong><span lang=EN-US> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>> on behalf of gaoliming <<a href="mailto:gaoliming@byosoft.com.cn">gaoliming@byosoft.com.cn</a>><br><strong><span style='font-family:宋体'>Sent:</span></strong> Thursday, February 4, 2021, 3:13 PM<br><strong><span style='font-family:宋体'>To:</span></strong> <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>; Chang, Abner (HPS SW/FW Technologist); <a href="mailto:dandan.bi@intel.com">dandan.bi@intel.com</a><br><strong><span style='font-family:宋体'>Cc:</span></strong> 'Dong, Eric'; Wang, Nickle (HPS SW)<br><strong><span style='font-family:宋体'>Subject:</span></strong> </span>回复<span lang=EN-US>: [edk2-devel] [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLib for EDK2 Redfish<o:p></o:p></span></p></div><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US style='font-size:11.0pt'><o:p> </o:p></span></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span lang=EN-US style='font-size:11.0pt'>If TryBestLanguage is FALE and Language is NULL, then ASSERT().<br><br>So, ASSERT statement should be ASSERT (TryBestLanguage || (Language !=<br>NULL)); <br><br>Is this clear?<br><br>Thanks<br>Liming<br>> -----</span><span style='font-size:11.0pt'>邮件原件<span lang=EN-US>-----<br>> </span>发件人<span lang=EN-US>: <a href="mailto:bounce+27952+71110+4905953+8761045@groups.io">bounce+27952+71110+4905953+8761045@groups.io</a><br>> <<a href="mailto:bounce+27952+71110+4905953+8761045@groups.io">bounce+27952+71110+4905953+8761045@groups.io</a>> </span>代表<span lang=EN-US> Abner Chang<br>> </span>发送时间<span lang=EN-US>: 2021</span>年<span lang=EN-US>2</span>月<span lang=EN-US>3</span>日<span lang=EN-US> 23:21<br>> </span>收件人<span lang=EN-US>: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a>; <a href="mailto:dandan.bi@intel.com">dandan.bi@intel.com</a><br>> </span>抄送<span lang=EN-US>: Dong, Eric <<a href="mailto:eric.dong@intel.com">eric.dong@intel.com</a>>; Wang, Nickle (HPS SW)<br>> <<a href="mailto:nickle.wang@hpe.com">nickle.wang@hpe.com</a>><br>> </span>主题<span lang=EN-US>: Re: [edk2-devel] [PATCH v3] MdeModulePkg/Library: Add<br>> HiiGetStringEx to UefiHiiLib for EDK2 Redfish<br>> <br>> Yes Dandan, yours follow coding standard. I will handle that.<br>> Also, I will help to push the patch to upstream with your review tag.<br>> <br>> Thanks<br>> Abner<br>> <br>> > -----Original Message-----<br>> > From: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a> [<a href="mailto:devel@edk2.groups.io">mailto:devel@edk2.groups.io</a>] On Behalf Of<br>> > Dandan Bi<br>> > Sent: Wednesday, February 3, 2021 7:34 PM<br>> > To: Chang, Abner (HPS SW/FW Technologist) <<a href="mailto:abner.chang@hpe.com">abner.chang@hpe.com</a>>;<br>> > <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>> > Cc: Dong, Eric <<a href="mailto:eric.dong@intel.com">eric.dong@intel.com</a>>; Wang, Nickle (HPS SW)<br>> > <<a href="mailto:nickle.wang@hpe.com">nickle.wang@hpe.com</a>><br>> > Subject: Re: [edk2-devel] [PATCH v3] MdeModulePkg/Library: Add<br>> > HiiGetStringEx to UefiHiiLib for EDK2 Redfish<br>> ><br>> > One minor comment inline below.<br>> > Reviewed-by: Dandan Bi <<a href="mailto:dandan.bi@intel.com">dandan.bi@intel.com</a>> with this is handled.<br>> ><br>> > Thanks,<br>> > Dandan<br>> > > -----Original Message-----<br>> > > From: Abner Chang <<a href="mailto:abner.chang@hpe.com">abner.chang@hpe.com</a>><br>> > > Sent: Monday, February 1, 2021 11:06 AM<br>> > > To: <a href="mailto:devel@edk2.groups.io">devel@edk2.groups.io</a><br>> > > Cc: Bi, Dandan <<a href="mailto:dandan.bi@intel.com">dandan.bi@intel.com</a>>; Dong, Eric<br>> > > <<a href="mailto:eric.dong@intel.com">eric.dong@intel.com</a>>; Nickle Wang <<a href="mailto:nickle.wang@hpe.com">nickle.wang@hpe.com</a>><br>> > > Subject: [PATCH v3] MdeModulePkg/Library: Add HiiGetStringEx to<br>> > > UefiHiiLib for EDK2 Redfish<br>> > ><br>> > > Add HiiGetStringEx and leveraged by HiiGetString function to support<br>> > > getting string with the best language in optionally. This avoids the<br>> > > string in x-uefi language is misled to the language defined by<br>> > > "PlatformLang" or the "Supported Languages". This change is introduced<br>> > > to support x-uefi keyword language for configuring BIOS setting.<br>> > ><br>> > > Signed-off-by: Jiaxin Wu <<a href="mailto:jiaxin.wu@intel.com">jiaxin.wu@intel.com</a>><br>> > > Signed-off-by: Siyuan Fu <<a href="mailto:siyuan.fu@intel.com">siyuan.fu@intel.com</a>><br>> > > Signed-off-by: Fan Wang <<a href="mailto:fan.wang@intel.com">fan.wang@intel.com</a>><br>> > > Signed-off-by: Abner Chang <<a href="mailto:abner.chang@hpe.com">abner.chang@hpe.com</a>><br>> > > Cc: Dandan Bi <<a href="mailto:dandan.bi@intel.com">dandan.bi@intel.com</a>><br>> > > Cc: Eric Dong <<a href="mailto:eric.dong@intel.com">eric.dong@intel.com</a>><br>> > > Cc: Nickle Wang <<a href="mailto:nickle.wang@hpe.com">nickle.wang@hpe.com</a>><br>> > > ---<br>> > >  MdeModulePkg/Include/Library/HiiLib.h       | 60 ++++++++++---<br>> > >  MdeModulePkg/Library/UefiHiiLib/HiiString.c | 98<br>> > > +++++++++++++++------<br>> > >  2 files changed, 119 insertions(+), 39 deletions(-)<br>> > ><br>> > > diff --git a/MdeModulePkg/Include/Library/HiiLib.h<br>> > > b/MdeModulePkg/Include/Library/HiiLib.h<br>> > > index c475cb74a1..cd9027fefd 100644<br>> > > --- a/MdeModulePkg/Include/Library/HiiLib.h<br>> > > +++ b/MdeModulePkg/Include/Library/HiiLib.h<br>> > > @@ -1,7 +1,8 @@<br>> > >  /** @file<br>> > >    Public include file for the HII Library<br>> > ><br>> > > -Copyright (c) 2007 - 2018, Intel Corporation. All rights<br>> > > reserved.<BR><br>> > > +Copyright (c) 2007 - 2021, Intel Corporation. All rights<br>> > > +reserved.<BR><br>> > > +(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR><br>> > >  SPDX-License-Identifier: BSD-2-Clause-Patent<br>> > ><br>> > >  **/<br>> > > @@ -123,16 +124,8 @@ HiiSetString (<br>> > >  ;<br>> > ><br>> > >  /**<br>> > > -  Retrieves a string from a string package in a specific language.<br>> > > If the language<br>> > > -  is not specified, then a string from a string package in the<br>> > > current platform<br>> > > -  language is retrieved.  If the string cannot be retrieved using the<br>> > > specified<br>> > > -  language or the current platform language, then the string is<br>> > > retrieved from<br>> > > -  the string package in the first language the string package<br>> > > supports.  The<br>> > > -  returned string is allocated using AllocatePool().  The caller is<br>> > > responsible<br>> > > -  for freeing the allocated buffer using FreePool().<br>> > > -<br>> > > -  If HiiHandle is NULL, then ASSERT().<br>> > > -  If StringId is 0, then ASSERT().<br>> > > +  Retrieves a string from a string package in a specific language<br>> > > + specified in Language  or in the best lanaguage. See HiiGetStringEx<br>> > > + () for<br>> > > the details.<br>> > ><br>> > >    @param[in]  HiiHandle  A handle that was previously registered in<br>> > > the HII Database.<br>> > >    @param[in]  StringId   The identifier of the string to retrieved<br>from<br>> the<br>> > > string<br>> > > @@ -152,8 +145,49 @@ HiiGetString (<br>> > >    IN EFI_HII_HANDLE  HiiHandle,<br>> > >    IN EFI_STRING_ID   StringId,<br>> > >    IN CONST CHAR8     *Language  OPTIONAL<br>> > > -  )<br>> > > -;<br>> > > +  );<br>> > > +<br>> > > +/**<br>> > > +  Retrieves a string from a string package in a specific language or<br>> > > +in the best<br>> > > +  language at discretion of this function according to the priority<br>of<br>> > languages.<br>> > > +  TryBestLanguage is used to get the string in the best language or<br>> > > +in the language<br>> > > +  specified in Language parameter. The behavior is,<br>> > > +  If TryBestLanguage is TRUE, this function looks for the best<br>> > > +language for<br>> > > the string.<br>> > > +   - If the string can not be retrieved using the specified language<br>> > > + or the<br>> > > current<br>> > > +     platform language, then the string is retrieved from the string<br>> > > + package in<br>> > > the<br>> > > +     first language the string package supports.<br>> > > +  If TryBestLanguage is FALSE, Language must be specified for<br>> > > + retrieving the<br>> > > string.<br>> > > +<br>> > > +  The returned string is allocated using AllocatePool().  The caller<br>> > > + is responsible  for freeing the allocated buffer using FreePool().<br>> > > +<br>> > > +  If HiiHandle is NULL, then ASSERT().<br>> > > +  If StringId is 0, then ASSET.<br>> > > +  If TryBestLanguage is FALE and Language is NULL, then ASSERT().<br>> > > +<br>> > > +  @param[in]  HiiHandle         A handle that was previously<br>> registered in the<br>> > > HII Database.<br>> > > +  @param[in]  StringId          The identifier of the string to<br>> retrieved from<br>> > the<br>> > > string<br>> > > +                                package associated with<br>> HiiHandle.<br>> > > +  @param[in]  Language          The language of the string to<br>> retrieve.  If this<br>> > > parameter<br>> > > +                                is NULL, then the current<br>> platform language is used.  The<br>> > > +                                format of Language must follow<br>> the<br>> > > + language format<br>> > > assumed<br>> > > +                                the HII Database.<br>> > > +  @param[in]  TryBestLanguage   If TRUE, try to get the best<br>> matching<br>> > > language from all<br>> > > +                                supported languages.If FALSE,<br>> the<br>> > > + Language must be<br>> > > assigned<br>> > > +                                for the StringID.<br>> > > +<br>> > > +  @retval NULL   The string specified by StringId is not present in<br>the<br>> string<br>> > > package.<br>> > > +  @retval Other  The string was returned.<br>> > > +<br>> > > +**/<br>> > > +EFI_STRING<br>> > > +EFIAPI<br>> > > +HiiGetStringEx (<br>> > > +  IN EFI_HII_HANDLE  HiiHandle,<br>> > > +  IN EFI_STRING_ID   StringId,<br>> > > +  IN CONST CHAR8     *Language  OPTIONAL,<br>> > > +  IN BOOLEAN         TryBestLanguage<br>> > > +  );<br>> > ><br>> > >  /**<br>> > >    Retrieves a string from a string package named by GUID, in the<br>> > > specified language.<br>> > > diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiString.c<br>> > > b/MdeModulePkg/Library/UefiHiiLib/HiiString.c<br>> > > index 95229f8a8c..a9a11aef98 100644<br>> > > --- a/MdeModulePkg/Library/UefiHiiLib/HiiString.c<br>> > > +++ b/MdeModulePkg/Library/UefiHiiLib/HiiString.c<br>> > > @@ -1,7 +1,8 @@<br>> > >  /** @file<br>> > >    HII Library implementation that uses DXE protocols and services.<br>> > ><br>> > > -  Copyright (c) 2006 - 2018, Intel Corporation. All rights<br>> > > reserved.<BR><br>> > > +  Copyright (c) 2006 - 2021, Intel Corporation. All rights<br>> > > + reserved.<BR><br>> > > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR><br>> > >    SPDX-License-Identifier: BSD-2-Clause-Patent<br>> > ><br>> > >  **/<br>> > > @@ -190,16 +191,8 @@ HiiGetPackageString (  }<br>> > ><br>> > >  /**<br>> > > -  Retrieves a string from a string package in a specific language.<br>> > > If the language<br>> > > -  is not specified, then a string from a string package in the<br>> > > current platform<br>> > > -  language is retrieved.  If the string can not be retrieved using<br>> > > the specified<br>> > > -  language or the current platform language, then the string is<br>> > > retrieved from<br>> > > -  the string package in the first language the string package<br>> > > supports.  The<br>> > > -  returned string is allocated using AllocatePool().  The caller is<br>> > > responsible<br>> > > -  for freeing the allocated buffer using FreePool().<br>> > > -<br>> > > -  If HiiHandle is NULL, then ASSERT().<br>> > > -  If StringId is 0, then ASSET.<br>> > > +  Retrieves a string from a string package in a specific language<br>> > > + specified in Language  or in the best lanaguage. See HiiGetStringEx<br>> > > + () for<br>> > > the details.<br>> > ><br>> > >    @param[in]  HiiHandle  A handle that was previously registered in<br>> > > the HII Database.<br>> > >    @param[in]  StringId   The identifier of the string to retrieved<br>from<br>> the<br>> > > string<br>> > > @@ -220,6 +213,51 @@ HiiGetString (<br>> > >    IN EFI_STRING_ID   StringId,<br>> > >    IN CONST CHAR8     *Language  OPTIONAL<br>> > >    )<br>> > > +{<br>> > > +  return HiiGetStringEx (HiiHandle, StringId, Language, TRUE); }<br>> > > +<br>> > > +/**<br>> > > +  Retrieves a string from a string package in a specific language or<br>> > > +in the best<br>> > > +  language at discretion of this function according to the priority<br>of<br>> > languages.<br>> > > +  TryBestLanguage is used to get the string in the best language or<br>> > > +in the language<br>> > > +  specified in Language parameter. The behavior is,<br>> > > +  If TryBestLanguage is TRUE, this function looks for the best<br>> > > +language for<br>> > > the string.<br>> > > +   - If the string can not be retrieved using the specified language<br>> > > + or the<br>> > > current<br>> > > +     platform language, then the string is retrieved from the string<br>> > > + package in<br>> > > the<br>> > > +     first language the string package supports.<br>> > > +  If TryBestLanguage is FALSE, Language must be specified for<br>> > > + retrieving the<br>> > > string.<br>> > > +<br>> > > +  The returned string is allocated using AllocatePool().  The caller<br>> > > + is responsible  for freeing the allocated buffer using FreePool().<br>> > > +<br>> > > +  If HiiHandle is NULL, then ASSERT().<br>> > > +  If StringId is 0, then ASSET.<br>> > > +  If TryBestLanguage is FALE and Language is NULL, then ASSERT().<br>> > > +<br>> > > +  @param[in]  HiiHandle         A handle that was previously<br>> registered in the<br>> > > HII Database.<br>> > > +  @param[in]  StringId          The identifier of the string to<br>> retrieved from<br>> > the<br>> > > string<br>> > > +                                package associated with<br>> HiiHandle.<br>> > > +  @param[in]  Language          The language of the string to<br>> retrieve.  If this<br>> > > parameter<br>> > > +                                is NULL, then the current<br>> platform language is used.  The<br>> > > +                                format of Language must follow<br>> the<br>> > > + language format<br>> > > assumed<br>> > > +                                the HII Database.<br>> > > +  @param[in]  TryBestLanguage   If TRUE, try to get the best<br>> matching<br>> > > language from all<br>> > > +                                supported languages.If FALSE,<br>> the<br>> > > + Language must be<br>> > > assigned<br>> > > +                                for the StringID.<br>> > > +<br>> > > +  @retval NULL   The string specified by StringId is not present in<br>the<br>> string<br>> > > package.<br>> > > +  @retval Other  The string was returned.<br>> > > +<br>> > > +**/<br>> > > +EFI_STRING<br>> > > +EFIAPI<br>> > > +HiiGetStringEx (<br>> > > +  IN EFI_HII_HANDLE  HiiHandle,<br>> > > +  IN EFI_STRING_ID   StringId,<br>> > > +  IN CONST CHAR8     *Language  OPTIONAL,<br>> > > +  IN BOOLEAN         TryBestLanguage<br>> > > +  )<br>> > >  {<br>> > >    EFI_STATUS  Status;<br>> > >    UINTN       StringSize;<br>> > > @@ -231,7 +269,10 @@ HiiGetString (<br>> > ><br>> > >    ASSERT (HiiHandle != NULL);<br>> > >    ASSERT (StringId != 0);<br>> > > -<br>> > > +  //<br>> > > +  // Language must be specified if TryBestLanguage = FALSE.<br>> > > +  //<br>> > > +  ASSERT (!(TryBestLanguage == FALSE && Language == NULL));<br>> > One minor here, in order to following the coding style, this seems<br>should be<br>> > ASSERT (!(!TryBestLanguage && Language == NULL)); Please help double<br>> > check.<br>> ><br>> > >    //<br>> > >    // Initialize all allocated buffers to NULL<br>> > >    //<br>> > > @@ -261,21 +302,26 @@ HiiGetString (<br>> > >      Language = "";<br>> > >    }<br>> > ><br>> > > -  //<br>> > > -  // Get the best matching language from SupportedLanguages<br>> > > -  //<br>> > > -  BestLanguage = GetBestLanguage (<br>> > > -                   SupportedLanguages,<br>> > > -                   FALSE,<br>> // RFC 4646 mode<br>> > > -                   Language,<br>> // Highest priority<br>> > > -                   PlatformLanguage != NULL ? PlatformLanguage :<br>> "",  // Next<br>> > > highest priority<br>> > > -                   SupportedLanguages,<br>> // Lowest priority<br>> > > -                   NULL<br>> > > -                   );<br>> > > -  if (BestLanguage == NULL) {<br>> > > -    goto Error;<br>> > > +  if (TryBestLanguage) {<br>> > > +    //<br>> > > +    // Get the best matching language from SupportedLanguages<br>> > > +    //<br>> > > +    BestLanguage = GetBestLanguage (<br>> > > +                     SupportedLanguages,<br>> > > +                     FALSE,<br>> // RFC 4646 mode<br>> > > +                     Language,<br>> // Highest priority<br>> > > +                     PlatformLanguage != NULL ?<br>> PlatformLanguage :<br>> > > + "",  // Next<br>> > > highest priority<br>> > > +                     SupportedLanguages,<br>> // Lowest priority<br>> > > +                     NULL<br>> > > +                     );<br>> > > +    if (BestLanguage == NULL) {<br>> > > +      goto Error;<br>> > > +    }<br>> > > +  } else {<br>> > > +    BestLanguage = (CHAR8 *) Language;<br>> > >    }<br>> > ><br>> > > +<br>> > >    //<br>> > >    // Retrieve the size of the string in the string package for the<br>> > BestLanguage<br>> > >    //<br>> > > @@ -337,7 +383,7 @@ Error:<br>> > >    if (PlatformLanguage != NULL) {<br>> > >      FreePool (PlatformLanguage);<br>> > >    }<br>> > > -  if (BestLanguage != NULL) {<br>> > > +  if (TryBestLanguage && BestLanguage != NULL) {<br>> > >      FreePool (BestLanguage);<br>> > >    }<br>> > ><br>> > > --<br>> > > 2.17.1<br>> ><br>> ><br>> ><br>> ><br>> ><br>> <br>> <br>> <br>> <br>> <br><br><br><br><br><br><br><o:p></o:p></span></span></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal></o:p></span></p></div></div></body></html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/71288">View/Reply Online (#71288)</a> |    |  <a target="_blank" href="https://groups.io/mt/80398776/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>