]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add new interface GetVariable2 and GetEfiGlobalVariable2 to return more info. Also...
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 May 2012 07:36:00 +0000 (07:36 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 30 May 2012 07:36:00 +0000 (07:36 +0000)
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13375 6f19259b-4bc3-4df7-8a09-765794883524

20 files changed:
EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
MdeModulePkg/Library/UefiHiiLib/HiiString.c
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
MdePkg/Include/Library/UefiLib.h
MdePkg/Library/UefiLib/UefiLib.c
NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c
NetworkPkg/IScsiDxe/IScsiMisc.c
Nt32Pkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c
PerformancePkg/Dp_App/DpUtilities.c
SecurityPkg/Library/DxeDeferImageLoadLib/DxeDeferImageLoadLib.c
SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c
SecurityPkg/UserIdentification/UserProfileManagerDxe/ModifyAccessPolicy.c
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
UnixPkg/MiscSubClassPlatformDxe/MiscNumberOfInstallableLanguagesFunction.c

index ae2124522f6c8b1c5e1d2acb4ac24ea8bd4d0e00..3b14c75df5702f17f555f8bd38e5506f8f784850 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   This file implements the protocol functions related to string package.\r
   \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, 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
@@ -349,7 +349,7 @@ HiiThunkGetString (
   //\r
   // Get the current platform language setting\r
   //\r
-  PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");\r
+  GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);\r
 \r
   //\r
   // Get the best matching language from SupportedLanguages\r
index 1c0c6dc6463750f6066406911496fb30e80f1ea3..91dc6def4e7b233f44f2809498f1f3d483d0bff3 100644 (file)
@@ -1513,8 +1513,8 @@ BdsLibEnumerateAllBootOption (
   // device from the boot order variable\r
   //\r
   if (mEnumBootDevice) {\r
-    LastLang = GetVariable (LAST_ENUM_LANGUAGE_VARIABLE_NAME, &gLastEnumLangGuid);\r
-    PlatLang = GetEfiGlobalVariable (L"PlatformLang");\r
+    GetVariable2 (LAST_ENUM_LANGUAGE_VARIABLE_NAME, &gLastEnumLangGuid, &LastLang, NULL);\r
+    GetEfiGlobalVariable2 (L"PlatformLang", &PlatLang, NULL);\r
     ASSERT (PlatLang != NULL);\r
     if ((LastLang != NULL) && (AsciiStrCmp (LastLang, PlatLang) == 0)) {\r
       Status = BdsLibBuildOptionFromVar (BdsBootOptionList, L"BootOrder");\r
index 6cb9d6b7ab07de5da771e4f26c430822a03a860e..0dddba7077c54894dda6dcc755356fa99e865037 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The platform device manager reference implementation\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, 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
@@ -2167,7 +2167,7 @@ DriverHealthSelectBestLanguage (
   CHAR8           *LanguageVariable;\r
   CHAR8           *BestLanguage;\r
 \r
-  LanguageVariable =  GetEfiGlobalVariable (Iso639Language ? L"Lang" : L"PlatformLang");\r
+  GetEfiGlobalVariable2 (Iso639Language ? L"Lang" : L"PlatformLang", &LanguageVariable, NULL);\r
 \r
   BestLanguage = GetBestLanguage(\r
                    SupportedLanguages,\r
index 53dcf82ea91999bdd94a84ec4deec0ae94df0152..30e43e81c73ae9dcd5429acdc2fed36b743db432 100644 (file)
@@ -232,7 +232,7 @@ FrontPageCallback (
         Index++;\r
       }\r
 \r
-      PlatformSupportedLanguages = GetEfiGlobalVariable (L"PlatformLangCodes");\r
+      GetEfiGlobalVariable2 (L"PlatformLangCodes", &PlatformSupportedLanguages, NULL);\r
       if (PlatformSupportedLanguages == NULL) {\r
         PlatformSupportedLanguages = AllocateCopyPool (\r
                                        AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)),\r
@@ -430,7 +430,7 @@ InitializeFrontPage (
   Lang = AllocatePool (AsciiStrSize (LanguageString));\r
   ASSERT (Lang != NULL);\r
 \r
-  CurrentLang = GetEfiGlobalVariable (L"PlatformLang");\r
+  GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);\r
   //\r
   // Select the best language in LanguageString as the default one.\r
   //\r
index 6b1ec2d703ea22553392a4e8c240b3a9dd9aa96d..4cc7b802c6f2f8416e10bd2062964abed0aaffba 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   HII Library implementation that uses DXE protocols and services.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, 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
@@ -250,7 +250,7 @@ HiiGetString (
   //\r
   // Get the current platform language setting\r
   //\r
-  PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");\r
+  GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);\r
 \r
   //\r
   // If Languag is NULL, then set it to an empty string, so it will be \r
index 6a65731acad36d2da061c7fab583cceee0a1bd97..008e746b334d20708d7a9bf5b98ee9937a2047eb 100644 (file)
@@ -2,7 +2,7 @@
   Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and\r
   Simple Text Output Protocol upon Serial IO Protocol.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, 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
@@ -358,7 +358,7 @@ IsTerminalInConsoleVariable (
   //\r
   // Get global variable and its size according to the name given.\r
   //\r
-  Variable = GetEfiGlobalVariable (VariableName);\r
+  GetEfiGlobalVariable2 (VariableName, &Variable, NULL);\r
   if (Variable == NULL) {\r
     return FALSE;\r
   }\r
@@ -1431,7 +1431,7 @@ TerminalUpdateConsoleDevVariable (
   //\r
   // Get global variable and its size according to the name given.\r
   //\r
-  Variable = GetEfiGlobalVariable (VariableName);\r
+  GetEfiGlobalVariable2 (VariableName, &Variable, NULL);\r
   if (Variable == NULL) {\r
     return;\r
   }\r
@@ -1500,7 +1500,7 @@ TerminalRemoveConsoleDevVariable (
   //\r
   // Get global variable and its size according to the name given.\r
   //\r
-  Variable = GetEfiGlobalVariable (VariableName);\r
+  GetEfiGlobalVariable2 (VariableName, &Variable, NULL);\r
   if (Variable == NULL) {\r
     return ;\r
   }\r
index 66fc6b9781490e139856f79a550077323f67d43d..93857bd11be4cafb2c653b86e6c28c938d385ef7 100644 (file)
@@ -2368,7 +2368,7 @@ HiiStringIdToImage (
   if (Language == NULL) {\r
     Language = "";\r
   }\r
-  CurrentLanguage = GetEfiGlobalVariable (L"PlatformLang");\r
+  GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLanguage, NULL);\r
   BestLanguage = GetBestLanguage (\r
                    SupportedLanguages,\r
                    FALSE,\r
index f283db019d75c7ee76fbf859210357c779424d8c..27ee99219bc1e463b029d7fc9ddcdf67b1f8f472 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Routines used to operate the Ip4 configure variable.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, 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<BR>\r
@@ -91,7 +91,7 @@ Ip4ConfigReadVariable (
 {\r
   NIC_IP4_CONFIG_INFO *NicConfig;\r
 \r
-  NicConfig = GetVariable (Instance->MacString, &gEfiNicIp4ConfigVariableGuid);\r
+  GetVariable2 (Instance->MacString, &gEfiNicIp4ConfigVariableGuid, &NicConfig, NULL);\r
   if (NicConfig != NULL) {\r
     Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);\r
   }\r
@@ -255,7 +255,7 @@ Check:
       continue;\r
     }\r
 \r
-    NicConfig = GetVariable (VariableName, &gEfiNicIp4ConfigVariableGuid);\r
+    GetVariable2 (VariableName, &gEfiNicIp4ConfigVariableGuid, &NicConfig, NULL);\r
     if (NicConfig == NULL) {\r
       break;\r
     }\r
index ab8a000f1360916ae4a421974b99934f4a3e0cbf..1c2b02f5a909e60ea39ef43c57fe19c6907c7daa 100644 (file)
@@ -13,7 +13,7 @@
   4. It save all the mapping info in NV variables which will be consumed\r
      by platform override protocol driver to publish the platform override protocol.\r
 \r
-Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2012, 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
@@ -185,7 +185,7 @@ GetComponentNameWorker (
   //\r
   // Find the best matching language.\r
   //\r
-  Language = GetEfiGlobalVariable (VariableName);\r
+  GetEfiGlobalVariable2 (VariableName, &Language, NULL);\r
   BestLanguage = GetBestLanguage (\r
                    ComponentName->SupportedLanguages,\r
                    (BOOLEAN) (ProtocolGuid == &gEfiComponentNameProtocolGuid),\r
index df7e7d53799be251654ac67ff64768d60e4f0005..4ce8dc6c059a62256a8af38f404aec0d6e2e3c8e 100644 (file)
@@ -12,7 +12,7 @@
   of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is\r
   defined, then debug and assert related macros wrapped by it are the NULL implementations.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -629,8 +629,11 @@ FreeUnicodeStringTable (
   IN EFI_UNICODE_STRING_TABLE  *UnicodeStringTable\r
   );\r
 \r
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
 \r
 /**\r
+  [ATTENTION] This function will be deprecated for security reason.\r
+\r
   Returns a pointer to an allocated buffer that contains the contents of a \r
   variable retrieved through the UEFI Runtime Service GetVariable().  The \r
   returned buffer is allocated using AllocatePool().  The caller is responsible\r
@@ -655,6 +658,8 @@ GetVariable (
   );\r
 \r
 /**\r
+  [ATTENTION] This function will be deprecated for security reason.\r
+\r
   Returns a pointer to an allocated buffer that contains the contents of a \r
   variable retrieved through the UEFI Runtime Service GetVariable().  This \r
   function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.\r
@@ -675,7 +680,64 @@ EFIAPI
 GetEfiGlobalVariable (\r
   IN CONST CHAR16  *Name\r
   );\r
+#endif\r
+\r
+\r
+/**\r
+  Returns the status whether get the variable success. The function retrieves \r
+  variable  through the UEFI Runtime Service GetVariable().  The \r
+  returned buffer is allocated using AllocatePool().  The caller is responsible\r
+  for freeing this buffer with FreePool().\r
+\r
+  If Name  is NULL, then ASSERT().\r
+  If Guid  is NULL, then ASSERT().\r
+  If Value is NULL, then ASSERT().\r
+\r
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.\r
+  @param[in]  Guid  The pointer to an EFI_GUID structure\r
+  @param[out] Value The buffer point saved the variable info.\r
+  @param[out] Size  The buffer size of the variable.\r
+\r
+  @return EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @return EFI_SUCCESS               Find the specified variable.\r
+  @return Others Errors             Return errors from call to gRT->GetVariable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetVariable2 (\r
+  IN CONST CHAR16    *Name,\r
+  IN CONST EFI_GUID  *Guid,\r
+  OUT VOID           **Value,\r
+  OUT UINTN          *Size OPTIONAL\r
+  );\r
+\r
+/**\r
+  Returns a pointer to an allocated buffer that contains the contents of a \r
+  variable retrieved through the UEFI Runtime Service GetVariable().  This \r
+  function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.\r
+  The returned buffer is allocated using AllocatePool().  The caller is \r
+  responsible for freeing this buffer with FreePool().\r
+\r
+  If Name  is NULL, then ASSERT().\r
+  If Value is NULL, then ASSERT().\r
 \r
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.\r
+  @param[out] Value The buffer point saved the variable info.\r
+  @param[out] Size  The buffer size of the variable.\r
+\r
+  @return EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @return EFI_SUCCESS               Find the specified variable.\r
+  @return Others Errors             Return errors from call to gRT->GetVariable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetEfiGlobalVariable2 (\r
+  IN CONST CHAR16    *Name,\r
+  OUT VOID           **Value,\r
+  OUT UINTN          *Size OPTIONAL\r
+  );\r
 \r
 /**\r
   Returns a pointer to an allocated buffer that contains the best matching language \r
index 96dccb1477ace083bfee2a5fb5a8e82c7ebddee9..112766ad86345ee9a5c3261e16c15081bf7e133e 100644 (file)
@@ -5,7 +5,7 @@
   EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, \r
   and print messages on the console output and standard error devices.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2012, 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
@@ -1212,7 +1212,11 @@ FreeUnicodeStringTable (
   return EFI_SUCCESS;\r
 }\r
 \r
+#ifndef DISABLE_NEW_DEPRECATED_INTERFACES\r
+\r
 /**\r
+  [ATTENTION] This function will be deprecated for security reason.\r
+\r
   Returns a pointer to an allocated buffer that contains the contents of a \r
   variable retrieved through the UEFI Runtime Service GetVariable().  The \r
   returned buffer is allocated using AllocatePool().  The caller is responsible\r
@@ -1273,8 +1277,9 @@ GetVariable (
   return Value;\r
 }\r
 \r
-\r
 /**\r
+  [ATTENTION] This function will be deprecated for security reason.\r
+\r
   Returns a pointer to an allocated buffer that contains the contents of a \r
   variable retrieved through the UEFI Runtime Service GetVariable().  This \r
   function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.\r
@@ -1298,7 +1303,110 @@ GetEfiGlobalVariable (
 {\r
   return GetVariable (Name, &gEfiGlobalVariableGuid);\r
 }\r
+#endif\r
+\r
+/**\r
+  Returns the status whether get the variable success. The function retrieves \r
+  variable  through the UEFI Runtime Service GetVariable().  The \r
+  returned buffer is allocated using AllocatePool().  The caller is responsible\r
+  for freeing this buffer with FreePool().\r
+\r
+  If Name  is NULL, then ASSERT().\r
+  If Guid  is NULL, then ASSERT().\r
+  If Value is NULL, then ASSERT().\r
+\r
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.\r
+  @param[in]  Guid  The pointer to an EFI_GUID structure\r
+  @param[out] Value The buffer point saved the variable info.\r
+  @param[out] Size  The buffer size of the variable.\r
+\r
+  @return EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @return EFI_SUCCESS               Find the specified variable.\r
+  @return Others Errors             Return errors from call to gRT->GetVariable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetVariable2 (\r
+  IN CONST CHAR16    *Name,\r
+  IN CONST EFI_GUID  *Guid,\r
+  OUT VOID           **Value,\r
+  OUT UINTN          *Size OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  UINTN       BufferSize;\r
+\r
+  ASSERT (Name != NULL && Guid != NULL && Value != NULL);\r
+\r
+  //\r
+  // Try to get the variable size.\r
+  //\r
+  BufferSize = 0;\r
+  *Value     = NULL;\r
+  if (Size != NULL) {\r
+    *Size  = 0;\r
+  }\r
+  \r
+  Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value);\r
+  if (Status != EFI_BUFFER_TOO_SMALL) {\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Allocate buffer to get the variable.\r
+  //\r
+  *Value = AllocatePool (BufferSize);\r
+  ASSERT (*Value != NULL);\r
+  if (*Value == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // Get the variable data.\r
+  //\r
+  Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value);\r
+  if (EFI_ERROR (Status)) {\r
+    FreePool(*Value);\r
+    *Value = NULL;\r
+  }\r
+\r
+  if (Size != NULL) {\r
+    *Size = BufferSize;\r
+  }\r
+\r
+  return Status;\r
+}\r
 \r
+/**\r
+  Returns a pointer to an allocated buffer that contains the contents of a \r
+  variable retrieved through the UEFI Runtime Service GetVariable().  This \r
+  function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.\r
+  The returned buffer is allocated using AllocatePool().  The caller is \r
+  responsible for freeing this buffer with FreePool().\r
+\r
+  If Name is NULL, then ASSERT().\r
+  If Value is NULL, then ASSERT().\r
+\r
+  @param[in]  Name  The pointer to a Null-terminated Unicode string.\r
+  @param[out] Value The buffer point saved the variable info.\r
+  @param[out] Size  The buffer size of the variable.\r
+\r
+  @return EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @return EFI_SUCCESS               Find the specified variable.\r
+  @return Others Errors             Return errors from call to gRT->GetVariable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetEfiGlobalVariable2 (\r
+  IN CONST CHAR16    *Name,\r
+  OUT VOID           **Value,\r
+  OUT UINTN          *Size OPTIONAL\r
+  )\r
+{\r
+  return GetVariable2 (Name, &gEfiGlobalVariableGuid, Value, Size);\r
+}\r
 \r
 /**\r
   Returns a pointer to an allocated buffer that contains the best matching language \r
index ac0e577f5e333eaae1661d606c58520cc4dc4e1b..479eb143d8a8e169255e7e6e48ec569566a31a1f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Dhcp6 support functions implementation.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -41,7 +41,7 @@ Dhcp6GenerateClientId (
   // Attempt to get client Id from variable to keep it constant.\r
   // See details in section-9 of rfc-3315.\r
   //\r
-  Duid = GetVariable (L"ClientId", &gEfiDhcp6ServiceBindingProtocolGuid);\r
+  GetVariable2 (L"ClientId", &gEfiDhcp6ServiceBindingProtocolGuid, &Duid, NULL);\r
   if (Duid != NULL) {\r
     return Duid;\r
   }\r
index f3ecdb5f6a1de4d24e6994bd944cc669c382b77e..46e97a9fcd66be2e09e16e491b60a7f6f6b18dc9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Miscellaneous routines for iSCSI driver.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2012, 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
@@ -1076,10 +1076,12 @@ IScsiGetConfigData (
       (UINTN) AttemptConfigOrder[Index]\r
       );\r
 \r
-    AttemptConfigData = (ISCSI_ATTEMPT_CONFIG_NVDATA *) GetVariable (\r
-                                                          mPrivate->PortString,\r
-                                                          &gEfiIScsiInitiatorNameProtocolGuid\r
-                                                          );\r
+    GetVariable2 (\r
+                 mPrivate->PortString,\r
+                 &gEfiIScsiInitiatorNameProtocolGuid,\r
+                 &AttemptConfigData,\r
+                 NULL\r
+                 );\r
 \r
     if (AttemptConfigData == NULL) {\r
       continue;\r
index 5be7444b31735cb890e5de8c25f94ac15c3243bd..1968d07ec27b81746bf4a3c5a4ad9431308ed405 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
  \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2012, 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
@@ -43,7 +43,7 @@ CurrentLanguageMatch (
     return;\r
   }\r
 \r
-  CurrentLang  = GetEfiGlobalVariable (L"PlatformLang");\r
+  GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);\r
   DefaultLang  = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);\r
   BestLanguage = GetBestLanguage (\r
                    Languages,\r
index f60006125f3ce375a37b02fe7d791e678005c7da..0d4e17acc136364e0e7c71f58e999d4c7c22655c 100644 (file)
@@ -270,7 +270,7 @@ GetNameFromHandle (
     //\r
     // Get the current platform language setting\r
     //\r
-    PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");\r
+    GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);\r
     Status = ComponentName2->GetDriverName (\r
                                ComponentName2,\r
                                PlatformLanguage != NULL ? PlatformLanguage : "en-US",\r
index f7fe594060e80e366eaf28b250f5b4d4f0cea087..b5b51b4ed2500bc3f7c645c8aedc0a1430c8942f 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implement defer image load services for user identification in UEFI2.2.\r
 \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2012, 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
@@ -532,7 +532,7 @@ IsBootOption (
     // Try to find the DevicePath in BootOption\r
     //\r
     UnicodeSPrint (StrTemp, sizeof (StrTemp), L"Boot%04x", Index);\r
-    OptionBuffer = GetEfiGlobalVariable (StrTemp);\r
+    GetEfiGlobalVariable2 (StrTemp, &OptionBuffer, NULL);\r
     if (OptionBuffer == NULL) {\r
       continue;\r
     }\r
index 843ca2a92c23cd228df2410a1e36d46b619a33ac..ec18a1b523388f38c1a97617d8a69a7ad766fb79 100644 (file)
@@ -1065,7 +1065,7 @@ VerifyCertUefiGuid (
   //\r
   // Get KEK database variable.\r
   //\r
-  KekList = GetEfiGlobalVariable (EFI_KEY_EXCHANGE_KEY_NAME);\r
+  GetEfiGlobalVariable2 (EFI_KEY_EXCHANGE_KEY_NAME, &KekList, NULL);\r
   if (KekList == NULL) {\r
     return EFI_SECURITY_VIOLATION;\r
   }\r
@@ -1260,7 +1260,7 @@ DxeImageVerificationHandler (
     return EFI_ACCESS_DENIED;\r
   }\r
 \r
-  SecureBootEnable = GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid);\r
+  GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);\r
   //\r
   // Skip verification if SecureBootEnable variable doesn't exist.\r
   //\r
@@ -1278,7 +1278,7 @@ DxeImageVerificationHandler (
 \r
   FreePool (SecureBootEnable);\r
 \r
-  SetupMode = GetEfiGlobalVariable (EFI_SETUP_MODE_NAME);\r
+  GetEfiGlobalVariable2 (EFI_SETUP_MODE_NAME, &SetupMode, NULL);\r
 \r
   //\r
   // SetupMode doesn't exist means no AuthVar driver is dispatched,\r
@@ -1544,7 +1544,7 @@ VariableWriteCallBack (
   // If this library is built-in, it means firmware has capability to perform\r
   // driver signing verification.\r
   //\r
-  SecureBootModePtr = GetEfiGlobalVariable (EFI_SECURE_BOOT_MODE_NAME);\r
+  GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, &SecureBootModePtr, NULL);\r
   if (SecureBootModePtr == NULL) {\r
     SecureBootMode   = SECURE_BOOT_MODE_DISABLE;\r
     //\r
index d73f77eeec970fa87adb7dde444209b3ed4c6b92..8585c72712240a450019173de2cd4a72cb719ce1 100644 (file)
@@ -410,7 +410,7 @@ DisplayLoadPermit(
     // Get driver device path.\r
     //\r
     UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", Order[Index]);\r
-    Var = GetEfiGlobalVariable (VarName);\r
+    GetEfiGlobalVariable2 (VarName, &Var, NULL);\r
     if (Var == NULL) {\r
       continue;\r
     }\r
@@ -655,7 +655,7 @@ AddToForbidLoad (
   // Get loadable driver device path.\r
   //\r
   UnicodeSPrint  (VarName, sizeof (VarName), L"Driver%04x", DriverIndex);\r
-  Var = GetEfiGlobalVariable (VarName);\r
+  GetEfiGlobalVariable2 (VarName, &Var, NULL);\r
   if (Var == NULL) {\r
     return;\r
   }\r
index f740c0ae755f193415bb60d903b4efef7cf764cb..0dc9c2b22d5c98dec7afa5024dd901d48a9baa24 100644 (file)
@@ -215,7 +215,7 @@ DeleteVariable (
   UINTN                   DataSize;\r
   UINT32                  Attr;\r
 \r
-  Variable = GetVariable (VariableName, VendorGuid);\r
+  GetVariable2 (VariableName, VendorGuid, &Variable, NULL);\r
   if (Variable == NULL) {\r
     return EFI_SUCCESS;\r
   }\r
@@ -2064,7 +2064,7 @@ SecureBootExtractConfigFromVariable (
   //\r
   // Get the SecureBootEnable Variable\r
   //\r
-  SecureBootEnable = GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid);\r
+  GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);\r
 \r
   //\r
   // If the SecureBootEnable Variable doesn't exist, hide the SecureBoot Enable/Disable\r
@@ -2088,7 +2088,7 @@ SecureBootExtractConfigFromVariable (
   //\r
   // If there is no PK then the Delete Pk button will be gray.\r
   //\r
-  SetupMode = GetVariable (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid);\r
+  GetVariable2 (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid, &SetupMode, NULL);\r
   if (SetupMode == NULL || (*SetupMode) == 1) {\r
     ConfigData->HasPk = FALSE;\r
   } else  {\r
@@ -2098,7 +2098,7 @@ SecureBootExtractConfigFromVariable (
   //\r
   // Get the SecureBootMode from CustomMode variable.\r
   //\r
-  SecureBootMode = GetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid);\r
+  GetVariable2 (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &SecureBootMode, NULL);\r
   if (SecureBootMode == NULL) {\r
     ConfigData->SecureBootMode = STANDARD_SECURE_BOOT_MODE;\r
   } else {\r
@@ -2298,6 +2298,9 @@ SecureBootCallback (
   UINTN                           BufferSize;\r
   SECUREBOOT_CONFIGURATION        *IfrNvData;\r
   UINT16                          LabelId;\r
+  UINT8                           *SecureBootEnable;\r
+\r
+  SecureBootEnable = NULL;\r
 \r
   if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -2326,7 +2329,8 @@ SecureBootCallback (
 \r
     switch (QuestionId) {\r
     case KEY_SECURE_BOOT_ENABLE:\r
-      if (NULL != GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid)) {\r
+      GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);\r
+      if (NULL != SecureBootEnable) {\r
         if (EFI_ERROR (SaveSecureBootVariable (Value->u8))) {\r
           CreatePopUp (\r
             EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
@@ -2513,7 +2517,8 @@ SecureBootCallback (
       break;\r
       \r
     case KEY_SECURE_BOOT_MODE:\r
-      if (NULL != GetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid)) {\r
+      GetVariable2 (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &SecureBootEnable, NULL);\r
+      if (NULL != SecureBootEnable) {\r
         Status = gRT->SetVariable (                          \r
                         EFI_CUSTOM_MODE_NAME,\r
                         &gEfiCustomModeEnableGuid,\r
index 64addad4a9d47fcc394943211dda19ef714bfe81..600f2ee9ae662b47deddc30d2f848a3f99affea5 100644 (file)
@@ -2,7 +2,7 @@
   This driver parses the mSmbiosMiscDataTable structure and reports\r
   any generated data.\r
 \r
-  Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2012, 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
@@ -45,7 +45,7 @@ CurrentLanguageMatch (
     return;\r
   }\r
 \r
-  CurrentLang  = GetEfiGlobalVariable (L"PlatformLang");\r
+  GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);\r
   DefaultLang  = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);\r
   BestLanguage = GetBestLanguage (\r
                    Languages,\r