Reviewed-by: Star Zeng <[email protected]>

-----Original Message-----
From: edk2-devel [mailto:[email protected]] On Behalf Of Ard 
Biesheuvel
Sent: Friday, April 29, 2016 3:44 PM
To: [email protected]; Tian, Feng <[email protected]>; Zeng, Star 
<[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Subject: [edk2] [PATCH] MdeModulePkg/DxeCore: set ImageContext Handle and 
ImageRead() fields

Set the ImageContext.Handle and ImageContext.ImageRead() fields so that
PeCoffLoaderRelocateImageExtraAction() can invoke PeCoffLoaderGetImageInfo or 
PeCoffLoaderGetPeHeader if desired to obtain additional metadata.

We will use this to create a PeCoffLoaderRelocateImageExtraAction()
implementation that applies boot time strict mapping permissions to PE/COFF 
modules.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <[email protected]>
---
 MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c 
b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 70a283bc2ba2..c34067e11845 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -315,6 +315,8 @@ DxeMain (
   if (Status == EFI_SUCCESS) {
     ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
   }
+  ImageContext.Handle         = (VOID *)(UINTN)gDxeCoreLoadedImage->ImageBase;
+  ImageContext.ImageRead      = PeCoffLoaderImageReadFromMemory;
   PeCoffLoaderRelocateImageExtraAction (&ImageContext);
 
   //
--
2.7.4

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to