/** @file\r
FrontPage routines to handle the callbacks and browser calls\r
\r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
CHAR8 *LangCode;\r
CHAR8 *Lang;\r
UINTN Index;\r
- EFI_STATUS Status;\r
\r
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {\r
//\r
}\r
\r
if (Index == Value->u8) {\r
- Status = gRT->SetVariable (\r
+ BdsDxeSetVariableAndReportStatusCodeOnError (\r
L"PlatformLang",\r
&gEfiGlobalVariableGuid,\r
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
AsciiStrSize (Lang),\r
Lang\r
);\r
- ASSERT_EFI_ERROR(Status);\r
} else {\r
ASSERT (FALSE);\r
}\r
\r
CurrentLang = GetEfiGlobalVariable (L"PlatformLang");\r
\r
- if (gFrontPagePrivate.LanguageToken == NULL) {\r
- //\r
- // Get Support language list from variable.\r
- //\r
+ //\r
+ // Get Support language list from variable.\r
+ //\r
+ if (mLanguageString == NULL){\r
mLanguageString = GetEfiGlobalVariable (L"PlatformLangCodes");\r
if (mLanguageString == NULL) {\r
mLanguageString = AllocateCopyPool (\r
);\r
ASSERT (mLanguageString != NULL);\r
}\r
+ }\r
\r
+ if (gFrontPagePrivate.LanguageToken == NULL) {\r
//\r
// Count the language list number.\r
// \r
sizeof(UINT64),\r
&OsIndication\r
);\r
+ //\r
+ // Changing the content without increasing its size with current variable implementation shouldn't fail.\r
+ //\r
ASSERT_EFI_ERROR (Status);\r
\r
//\r
\r
if (mLanguageString != NULL) {\r
FreePool (mLanguageString);\r
+ mLanguageString = NULL;\r
}\r
//\r
//Will leave browser, check any reset required change is applied? if yes, reset system\r