/* Serializes the variables known to this instance into the provided buffer. */
RETURN_STATUS EFIAPI SerializeVariablesToBuffer(IN EFI_HANDLE Handle, OUT VOID *Buffer, IN OUT UINTN *Size)
/* Serializes the variables known to this instance into the provided buffer. */
RETURN_STATUS EFIAPI SerializeVariablesToBuffer(IN EFI_HANDLE Handle, OUT VOID *Buffer, IN OUT UINTN *Size)
{
  SV_INSTANCE  *Instance;
  Instance = SV_FROM_HANDLE (Handle);
  if (Size == NULL) {
    return RETURN_INVALID_PARAMETER;
  }
  if (*Size < Instance->DataSize) {
    *Size = Instance->DataSize;
    return RETURN_BUFFER_TOO_SMALL;
  }
  if (Buffer == NULL) {
    return RETURN_INVALID_PARAMETER;
  }
  *Size = Instance->DataSize;
  CopyMem (Buffer, Instance->BufferPtr, Instance->DataSize);
  return RETURN_SUCCESS;
}