#include <Protocol/PeCoffLoader.h>\r
\r
\r
+PE_COFF_LOADER_PROTOCOL *gPeCoffLoader = NULL;\r
+\r
+\r
/**\r
Retrieves information about a PE/COFF image.\r
\r
OUT VOID *Buffer\r
)\r
{\r
- return gPeCoffLoader->RelocateImageForRuntime (\r
- *FileHandle,\r
+ return gPeCoffLoader->ReadFromMemory (\r
+ FileHandle,\r
FileOffset,\r
- *ReadSize,\r
- *Buffer\r
+ ReadSize,\r
+ Buffer\r
);\r
\r
}\r
ImageBase,\r
VirtImageBase,\r
ImageSize,\r
- *RelocationData\r
+ RelocationData\r
);\r
}\r
\r
return gPeCoffLoader->UnloadImage (ImageContext);\r
}\r
\r
+typedef struct {\r
+ EFI_HOB_GUID_TYPE Hob;\r
+ VOID *Interface;\r
+} PROTOCOL_HOB;\r
\r
\r
/**\r
- Register LzmaDecompress and LzmaDecompressGetInfo handlers with LzmaCustomerDecompressGuid.\r
+ The constructor function caches the pointer of DXE Services Table.\r
+\r
+ The constructor function caches the pointer of DXE Services Table.\r
+ It will ASSERT() if that operation fails.\r
+ It will ASSERT() if the pointer of DXE Services Table is NULL.\r
+ It will always return EFI_SUCCESS.\r
+\r
+ @param ImageHandle The firmware allocated handle for the EFI image.\r
+ @param SystemTable A pointer to the EFI System Table.\r
+\r
+ @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
\r
- @retval RETURN_SUCCESS Register successfully.\r
- @retval RETURN_OUT_OF_RESOURCES No enough memory to store this handler.\r
**/\r
EFI_STATUS\r
EFIAPI\r
DxeHobPeCoffLibConstructor (\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
PROTOCOL_HOB *Hob;\r
- \r
+\r
Hob = GetFirstGuidHob (&gPeCoffLoaderProtocolGuid);\r
if (Hob == NULL) {\r
return EFI_NOT_FOUND;\r
}\r
\r
gPeCoffLoader = Hob->Interface;\r
+ return EFI_SUCCESS;\r
}\r
\r
\r