MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / GetInfo

Function GetInfo

BaseTools/Source/C/Common/Decompress.c:672–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670}
671
672EFI_STATUS
673GetInfo (
674 IN VOID *Source,
675 IN UINT32 SrcSize,
676 OUT UINT32 *DstSize,
677 OUT UINT32 *ScratchSize
678 )
679/*++
680
681Routine Description:
682
683 The implementation of EFI_DECOMPRESS_PROTOCOL.GetInfo().
684
685Arguments:
686
687 Source - The source buffer containing the compressed data.
688 SrcSize - The size of source buffer
689 DstSize - The size of destination buffer.
690 ScratchSize - The size of scratch buffer.
691
692Returns:
693
694 EFI_SUCCESS - The size of destination buffer and the size of scratch buffer are successfully retrieved.
695 EFI_INVALID_PARAMETER - The source data is corrupted
696
697--*/
698{
699 UINT8 *Src;
700 UINT32 CompSize;
701
702 *ScratchSize = sizeof (SCRATCH_DATA);
703
704 Src = Source;
705 if (SrcSize < 8) {
706 return EFI_INVALID_PARAMETER;
707 }
708
709 CompSize = Src[0] + (Src[1] << 8) + (Src[2] << 16) + (Src[3] << 24);
710 *DstSize = Src[4] + (Src[5] << 8) + (Src[6] << 16) + (Src[7] << 24);
711
712 if (SrcSize < CompSize + 8 || (CompSize + 8) < 8) {
713 return EFI_INVALID_PARAMETER;
714 }
715
716 return EFI_SUCCESS;
717}
718
719EFI_STATUS
720Decompress (

Callers 2

EfiGetInfoFunction · 0.70
TianoGetInfoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected