/* If Source is NULL, then ASSERT(). If DestinationSize is NULL, then ASSERT(). If ScratchSize is NULL, then ASSERT(). */
RETURN_STATUS EFIAPI UefiDecompressGetInfo(IN CONST VOID *Source, IN UINT32 SourceSize, OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize)
/* If Source is NULL, then ASSERT(). If DestinationSize is NULL, then ASSERT(). If ScratchSize is NULL, then ASSERT(). */
RETURN_STATUS EFIAPI UefiDecompressGetInfo(IN CONST VOID *Source, IN UINT32 SourceSize, OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize)
{
  UINT32  CompressedSize;
  ASSERT (Source != NULL);
  ASSERT (DestinationSize != NULL);
  ASSERT (ScratchSize != NULL);
  if (SourceSize < 8) {
    return RETURN_INVALID_PARAMETER;
  }
  CompressedSize = ReadUnaligned32 ((UINT32 *)Source);
  if ((SourceSize < (CompressedSize + 8)) || ((CompressedSize + 8) < 8)) {
    return RETURN_INVALID_PARAMETER;
  }
  *ScratchSize     = sizeof (SCRATCH_DATA);
  *DestinationSize = ReadUnaligned32 ((UINT32 *)Source + 1);
  return RETURN_SUCCESS;
}