X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FCore%2FDxeIplPeim%2FDxeLoad.c;h=8d3c29a5798fce41a5ab2b0689935487a66e984f;hp=e7359e5684824bc7e04ee754792cbbd6df428011;hb=1c9d209fc4f1b234fe3eab44281e816e97a92a55;hpb=d8c79a815f9e993b741ec38cd39498e674e1739e;ds=sidebyside diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c index e7359e5684..8d3c29a579 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c +++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c @@ -538,7 +538,7 @@ Returns: // Set gInMemory global variable to TRUE to indicate the dxeipl is shadowed. // *(BOOLEAN *) ((UINTN) &gInMemory + (UINTN) DxeIplEntryPoint - (UINTN) _ModuleEntryPoint) = TRUE; - Status = ((EFI_PEIM_ENTRY_POINT) (UINTN) DxeIplEntryPoint) ((EFI_PEI_FILE_HANDLE *) DxeIplFileHeader, GetPeiServicesTablePointer()); + Status = ((EFI_PEIM_ENTRY_POINT2) (UINTN) DxeIplEntryPoint) ((EFI_PEI_FILE_HANDLE *) DxeIplFileHeader, GetPeiServicesTablePointer()); } return Status; @@ -593,15 +593,23 @@ Returns: // Preprocess the FFS file to get a pointer to the PE32 information // in the enclosed PE32 image. // - Status = PeiProcessFile ( - EFI_SECTION_PE32, + Status = PeiProcessFile ( + EFI_SECTION_TE, FfsHeader, &Pe32Data, NULL ); - if (EFI_ERROR (Status)) { - return Status; + Status = PeiProcessFile ( + EFI_SECTION_PE32, + FfsHeader, + &Pe32Data, + NULL + ); + + if (EFI_ERROR (Status)) { + return Status; + } } // // Load the PE image from the FFS file @@ -647,7 +655,7 @@ Returns: EFI_STATUS Status; UINT8 *DstBuffer; UINT8 *ScratchBuffer; - UINT32 DstBufferSize; + UINTN DstBufferSize; UINT32 ScratchBufferSize; EFI_COMMON_SECTION_HEADER *CmpSection; UINTN CmpSectionLength; @@ -736,6 +744,7 @@ Returns: DEBUG ((EFI_D_ERROR, "Extract section content failed - %r\n", Status)); return Status; } + // // Todo check AuthenticationStatus and do the verify // @@ -754,7 +763,7 @@ Returns: Status = UefiDecompressGetInfo ( (UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1), (UINT32) SectionLength - sizeof (EFI_COMPRESSION_SECTION), - &DstBufferSize, + (UINT32 *) &DstBufferSize, &ScratchBufferSize ); if (EFI_ERROR (Status)) { @@ -958,7 +967,8 @@ CustomDecompressExtractSection ( EFI_STATUS Status; UINT8 *ScratchBuffer; UINT32 ScratchSize; - UINT32 SectionLength; + UINT32 SectionLength; + UINT32 DestinationSize; // // Set authentic value to zero. @@ -975,7 +985,7 @@ CustomDecompressExtractSection ( (GUID *) ((UINT8 *) InputSection + sizeof (EFI_COMMON_SECTION_HEADER)), (UINT8 *) InputSection + sizeof (EFI_GUID_DEFINED_SECTION), SectionLength - sizeof (EFI_GUID_DEFINED_SECTION), - OutputSize, + &DestinationSize, &ScratchSize ); if (EFI_ERROR (Status)) { @@ -996,6 +1006,7 @@ CustomDecompressExtractSection ( // // Allocate destination buffer // + *OutputSize = (UINTN) DestinationSize; *OutputBuffer = AllocatePages (EFI_SIZE_TO_PAGES (*OutputSize)); if (*OutputBuffer == NULL) { return EFI_OUT_OF_RESOURCES;