From 6320fa42c9216930926da7cef1bb726fe04699c3 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Tue, 22 Dec 2009 08:02:33 +0000 Subject: [PATCH] Produce LoadPeImage protocol only in framework compatibility mode. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9586 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Core/Dxe/DxeMain.inf | 5 ++++- MdeModulePkg/Core/Dxe/Image/Image.c | 22 +++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeMain.inf index a7191b87e1..3c711400e3 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.inf +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf @@ -107,7 +107,7 @@ gEfiStatusCodeRuntimeProtocolGuid ## SOMETIMES_CONSUMES gEfiCapsuleArchProtocolGuid ## CONSUMES gEfiDecompressProtocolGuid ## CONSUMES - gEfiLoadPeImageProtocolGuid ## PRODUCES + gEfiLoadPeImageProtocolGuid ## SOMETIMES_PRODUCES (Produces when PcdFrameworkCompatibilitySupport is set) gEfiSimpleFileSystemProtocolGuid ## CONSUMES gEfiLoadFileProtocolGuid ## CONSUMES gEfiLoadFile2ProtocolGuid ## CONSUMES @@ -140,3 +140,6 @@ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueBootServiceExit gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeDriverBegin gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeDriverEnd + +[FeaturePcd.common] + gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index d0539b98e4..7e5cea7b76 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -144,15 +144,19 @@ CoreInitializeImageServices ( gDxeCoreImageHandle = Image->Handle; gDxeCoreLoadedImage = &Image->Info; - // - // Export DXE Core PE Loader functionality - // - return CoreInstallProtocolInterface ( - &mLoadPe32PrivateData.Handle, - &gEfiLoadPeImageProtocolGuid, - EFI_NATIVE_INTERFACE, - &mLoadPe32PrivateData.Pe32Image - ); + if (FeaturePcdGet (PcdFrameworkCompatibilitySupport)) { + // + // Export DXE Core PE Loader functionality for backward compatibility. + // + Status = CoreInstallProtocolInterface ( + &mLoadPe32PrivateData.Handle, + &gEfiLoadPeImageProtocolGuid, + EFI_NATIVE_INTERFACE, + &mLoadPe32PrivateData.Pe32Image + ); + } + + return Status; } /** -- 2.39.2