summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/UefiLib
diff options
context:
space:
mode:
authorZhang, Shenglei <shenglei.zhang@intel.com>2020-08-05 14:08:03 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-10-13 01:35:03 +0000
commit9c1f455f5f0ee63ce080940bf974aac4fefe526b (patch)
tree7c70a144f42ca240285dfc0f9ae0bcc4d33650d9 /MdePkg/Library/UefiLib
parentcc942105ede58a300ba46f3df0edfa86b3abd4dd (diff)
downloadedk2-9c1f455f5f0ee63ce080940bf974aac4fefe526b.tar.gz
edk2-9c1f455f5f0ee63ce080940bf974aac4fefe526b.tar.bz2
edk2-9c1f455f5f0ee63ce080940bf974aac4fefe526b.zip
MdePkg: Remove code wrapped by DISABLE_NEW_DEPRECATED_INTERFACES
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2777 Code wrapped by DISABLE_NEW_DEPRECATED_INTERFACES is deprecated. So remove it. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Diffstat (limited to 'MdePkg/Library/UefiLib')
-rw-r--r--MdePkg/Library/UefiLib/UefiLib.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c
index 07c45d1e91..835218f982 100644
--- a/MdePkg/Library/UefiLib/UefiLib.c
+++ b/MdePkg/Library/UefiLib/UefiLib.c
@@ -1285,98 +1285,6 @@ FreeUnicodeStringTable (
return EFI_SUCCESS;
}
-#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Returns a pointer to an allocated buffer that contains the contents of a
- variable retrieved through the UEFI Runtime Service GetVariable(). The
- returned buffer is allocated using AllocatePool(). The caller is responsible
- for freeing this buffer with FreePool().
-
- If Name is NULL, then ASSERT().
- If Guid is NULL, then ASSERT().
-
- @param[in] Name The pointer to a Null-terminated Unicode string.
- @param[in] Guid The pointer to an EFI_GUID structure
-
- @retval NULL The variable could not be retrieved.
- @retval NULL There are not enough resources available for the variable contents.
- @retval Other A pointer to allocated buffer containing the variable contents.
-
-**/
-VOID *
-EFIAPI
-GetVariable (
- IN CONST CHAR16 *Name,
- IN CONST EFI_GUID *Guid
- )
-{
- EFI_STATUS Status;
- UINTN Size;
- VOID *Value;
-
- ASSERT (Name != NULL);
- ASSERT (Guid != NULL);
-
- //
- // Try to get the variable size.
- //
- Value = NULL;
- Size = 0;
- Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &Size, Value);
- if (Status != EFI_BUFFER_TOO_SMALL) {
- return NULL;
- }
-
- //
- // Allocate buffer to get the variable.
- //
- Value = AllocatePool (Size);
- if (Value == NULL) {
- return NULL;
- }
-
- //
- // Get the variable data.
- //
- Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &Size, Value);
- if (EFI_ERROR (Status)) {
- FreePool(Value);
- return NULL;
- }
-
- return Value;
-}
-
-/**
- [ATTENTION] This function will be deprecated for security reason.
-
- Returns a pointer to an allocated buffer that contains the contents of a
- variable retrieved through the UEFI Runtime Service GetVariable(). This
- function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
- The returned buffer is allocated using AllocatePool(). The caller is
- responsible for freeing this buffer with FreePool().
-
- If Name is NULL, then ASSERT().
-
- @param[in] Name The pointer to a Null-terminated Unicode string.
-
- @retval NULL The variable could not be retrieved.
- @retval NULL There are not enough resources available for the variable contents.
- @retval Other A pointer to allocated buffer containing the variable contents.
-
-**/
-VOID *
-EFIAPI
-GetEfiGlobalVariable (
- IN CONST CHAR16 *Name
- )
-{
- return GetVariable (Name, &gEfiGlobalVariableGuid);
-}
-#endif
/**
Returns the status whether get the variable success. The function retrieves