/* Allocates the number bytes specified by AllocationSize of a certain pool type and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. */
VOID* InternalVarCheckAllocatePool(IN EFI_MEMORY_TYPE MemoryType, IN UINTN AllocationSize)
/* Allocates the number bytes specified by AllocationSize of a certain pool type and returns a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. */
VOID* InternalVarCheckAllocatePool(IN EFI_MEMORY_TYPE MemoryType, IN UINTN AllocationSize)
{
  EFI_STATUS  Status;
  VOID        *Memory;
  Status = gBS->AllocatePool (MemoryType, AllocationSize, &Memory);
  if (EFI_ERROR (Status)) {
    Memory = NULL;
  }
  return Memory;
}