summaryrefslogtreecommitdiff
path: root/EdkModulePkg
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-27 05:07:48 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2006-07-27 05:07:48 +0000
commit5b18234d980e3eb199c3a784b2fdfdd3acffef57 (patch)
treea55bbf4b3caa9f28680b44542dd935a293f579c3 /EdkModulePkg
parent1dbcbb6158d394dcb736bd08a44c299169005c15 (diff)
downloadedk2-platforms-5b18234d980e3eb199c3a784b2fdfdd3acffef57.tar.xz
Add temporary fix for PeLoader
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1113 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
-rw-r--r--EdkModulePkg/Core/Pei/Image/Image.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/EdkModulePkg/Core/Pei/Image/Image.c b/EdkModulePkg/Core/Pei/Image/Image.c
index 6b9a7eb444..32f0fe6523 100644
--- a/EdkModulePkg/Core/Pei/Image/Image.c
+++ b/EdkModulePkg/Core/Pei/Image/Image.c
@@ -147,17 +147,20 @@ Returns:
EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr;
UINT32 NumberOfRvaAndSizes;
- DosHeader = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
- if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
- //
- // DOS image header is present, so read the PE header after the DOS image header
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + (UINTN)((DosHeader->e_lfanew) & 0x0ffff));
- } else {
- //
- // DOS image header is not present, so PE header is at the image base
- //
- Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
+ Hdr.Pe32 = NULL;
+ if (TEImageHeader == NULL) {
+ DosHeader = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
+ if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
+ //
+ // DOS image header is present, so read the PE header after the DOS image header
+ //
+ Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)((UINTN)Pe32Data + (UINTN)((DosHeader->e_lfanew) & 0x0ffff));
+ } else {
+ //
+ // DOS image header is not present, so PE header is at the image base
+ //
+ Hdr.Pe32 = (EFI_IMAGE_NT_HEADERS32 *)Pe32Data;
+ }
}
//