X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FApplication%2FUiApp%2FFrontPageCustomizedUiSupport.c;h=93f6e4e88feff456f98d6a5f0b9a1395bddd7532;hb=7e9cf612056ed2667eaad7f0e901f0a37f6ddd5b;hp=dc5d1c6c409bd5ce0905fe6c3f1fdb7f54389b09;hpb=7258076baee1fad8e07684140bcca614fdabfcc7;p=mirror_edk2.git diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c index dc5d1c6c40..93f6e4e88f 100644 --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c @@ -56,6 +56,7 @@ CHAR8 *gLanguageString; EFI_STRING_ID *gLanguageToken; UI_HII_DRIVER_INSTANCE *gHiiDriverList; extern EFI_HII_HANDLE gStringPackHandle; +UINT8 gCurrentLanguageIndex; /** @@ -130,6 +131,7 @@ LanguageChangeHandler ( GetNextLanguage (&LangCode, Lang); if (Index == Value->u8) { + gCurrentLanguageIndex = Value->u8; break; } @@ -190,6 +192,16 @@ UiSupportLibCallbackHandler ( return FALSE; } + if (Action == EFI_BROWSER_ACTION_RETRIEVE) { + if (QuestionId == FRONT_PAGE_KEY_LANGUAGE) { + Value->u8 = gCurrentLanguageIndex; + *Status = EFI_SUCCESS; + } else { + *Status = EFI_UNSUPPORTED; + } + return TRUE; + } + if (Action != EFI_BROWSER_ACTION_CHANGED) { // // Do nothing for other UEFI Action. Only do call back when data is changed. @@ -247,6 +259,7 @@ UiCreateLanguageMenu ( { CHAR8 *LangCode; CHAR8 *Lang; + UINTN LangSize; CHAR8 *CurrentLang; UINTN OptionCount; CHAR16 *StringBuffer; @@ -316,9 +329,10 @@ UiCreateLanguageMenu ( } if (EFI_ERROR (Status)) { - StringBuffer = AllocatePool (AsciiStrSize (Lang) * sizeof (CHAR16)); + LangSize = AsciiStrSize (Lang); + StringBuffer = AllocatePool (LangSize * sizeof (CHAR16)); ASSERT (StringBuffer != NULL); - AsciiStrToUnicodeStr (Lang, StringBuffer); + AsciiStrToUnicodeStrS (Lang, StringBuffer, LangSize); } ASSERT (StringBuffer != NULL); @@ -347,6 +361,7 @@ UiCreateLanguageMenu ( EFI_IFR_NUMERIC_SIZE_1, (UINT8) OptionCount ); + gCurrentLanguageIndex = (UINT8) OptionCount; } else { HiiCreateOneOfOptionOpCode ( OptionsOpCodeHandle,