]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/Language.c
Report the setting variable failure to platform through the status code when core...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / Language.c
index a1272006b1b1a1db3ddd97f39da30497e7e603a3..2eab617ae59ce109188f72d237608de800dbbe5a 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Language settings\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
@@ -400,7 +400,6 @@ IsLangInSupportedLangCodes(
                                       TRUE for L"Lang" LangName or FALSE for L"PlatformLang" LangName.\r
 \r
 **/\r
-\r
 VOID\r
 InitializeLangVariable (\r
   IN CHAR16     *LangName,\r
@@ -415,7 +414,7 @@ InitializeLangVariable (
   //\r
   // Find current Lang or PlatformLang from EFI Variable.\r
   //\r
-  Status = GetEfiGlobalVariable2 (LangName, &Lang, NULL);\r
+  Status = GetEfiGlobalVariable2 (LangName, (VOID **) &Lang, NULL);\r
   //\r
   // If Lang or PlatformLang variable is not found,\r
   // or it has been set to an unsupported value(not one of the supported language codes),\r
@@ -426,7 +425,7 @@ InitializeLangVariable (
     // The default language code should be one of the supported language codes.\r
     //\r
     ASSERT (IsLangInSupportedLangCodes (SupportedLang, DefaultLang, Iso639Language));\r
-    Status = gRT->SetVariable (\r
+    BdsDxeSetVariableAndReportStatusCodeOnError (\r
                     LangName,\r
                     &gEfiGlobalVariableGuid,\r
                     EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
@@ -472,6 +471,10 @@ InitializeLanguage (
                       AsciiStrSize (LangCodes),\r
                       LangCodes\r
                       );\r
+      //\r
+      // Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail.\r
+      //\r
+      ASSERT_EFI_ERROR (Status);\r
     }\r
 \r
     Status = gRT->SetVariable (\r
@@ -481,6 +484,10 @@ InitializeLanguage (
                     AsciiStrSize (PlatformLangCodes),\r
                     PlatformLangCodes\r
                     );\r
+    //\r
+    // Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail.\r
+    //\r
+    ASSERT_EFI_ERROR (Status);\r
   }\r
 \r
   if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) {\r