]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiLib.h
MdePkg/UefiLib: Add a new API GetVariable3
[mirror_edk2.git] / MdePkg / Include / Library / UefiLib.h
index 08222d488bee72690fca07bfe08d3eb6d37a7bb3..7d97408eab2acd530648dc2e5142faa82d019f0f 100644 (file)
@@ -737,9 +737,9 @@ GetEfiGlobalVariable (
   @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
+  @retval EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @retval EFI_SUCCESS               Find the specified variable.\r
+  @retval Others Errors             Return errors from call to gRT->GetVariable.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -765,9 +765,9 @@ GetVariable2 (
   @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
+  @retval EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @retval EFI_SUCCESS               Find the specified variable.\r
+  @retval Others Errors             Return errors from call to gRT->GetVariable.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -778,6 +778,39 @@ GetEfiGlobalVariable2 (
   OUT UINTN          *Size OPTIONAL\r
   );\r
 \r
+/** Return the attributes of the variable.\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().  The attributes are returned if\r
+  the caller provides a valid Attribute parameter.\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
+  @param[out] Attr  The pointer to the variable attributes as found in var store\r
+\r
+  @retval EFI_OUT_OF_RESOURCES      Allocate buffer failed.\r
+  @retval EFI_SUCCESS               Find the specified variable.\r
+  @retval Others Errors             Return errors from call to gRT->GetVariable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+GetVariable3(\r
+  IN CONST CHAR16       *Name,\r
+  IN CONST EFI_GUID     *Guid,\r
+     OUT VOID           **Value,\r
+     OUT UINTN          *Size OPTIONAL,\r
+     OUT UINT32         *Attr OPTIONAL\r
+  );\r
+\r
 /**\r
   Returns a pointer to an allocated buffer that contains the best matching language\r
   from a set of supported languages.\r