diff options
author | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-05 19:31:45 +0000 |
---|---|---|
committer | mdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-02-05 19:31:45 +0000 |
commit | e8ba34ff3dfb888f86d62ad229c6c5d624f56135 (patch) | |
tree | 82a6558f48a732ea948a51a777427a58053b0def /DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c | |
parent | 4ab0dff3381de97cbecd8ec48d68c7bacfea1fb3 (diff) | |
download | edk2-platforms-e8ba34ff3dfb888f86d62ad229c6c5d624f56135.tar.xz |
Update DUET PCI Bus Driver to use PeCoffLib instead of parsing the PE/COFF image itself
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7439 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c')
-rw-r--r-- | DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c b/DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c index 67de1392f7..17bf212a19 100644 --- a/DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c +++ b/DuetPkg/PciBusNoEnumerationDxe/PciDriverOverride.c @@ -135,9 +135,8 @@ Returns: {
EFI_STATUS Status;
- EFI_IMAGE_DOS_HEADER *DosHdr;
- EFI_IMAGE_NT_HEADERS *PeHdr;
EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
+ PE_COFF_LOADER_IMAGE_CONTEXT ImageContext;
PCI_DRIVER_OVERRIDE_LIST *Node;
#if (EFI_SPECIFICATION_VERSION < 0x00020000)
EFI_DRIVER_OS_HANDOFF_HEADER *DriverOsHandoffHeader;
@@ -167,14 +166,19 @@ Returns: PciIoDevice->BusOverride = TRUE;
- DosHdr = (EFI_IMAGE_DOS_HEADER *) LoadedImage->ImageBase;
- if (DosHdr->e_magic != EFI_IMAGE_DOS_SIGNATURE) {
+
+ ImageContext.Handle = LoadedImage->ImageBase;
+ ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory;
+
+ //
+ // Get information about the image
+ //
+ Status = PeCoffLoaderGetImageInfo (&ImageContext);
+ if (EFI_ERROR (Status)) {
return EFI_SUCCESS;
}
- PeHdr = (EFI_IMAGE_NT_HEADERS *) ((UINTN) LoadedImage->ImageBase + DosHdr->e_lfanew);
-
- if (PeHdr->FileHeader.Machine != EFI_IMAGE_MACHINE_EBC) {
+ if (ImageContext.Machine != EFI_IMAGE_MACHINE_EBC) {
return EFI_SUCCESS;
}
|