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; } /**