]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
Add new interface GetVariable2 and GetEfiGlobalVariable2 to return more info. Also...
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
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