Produce LoadPeImage protocol only in framework compatibility mode.
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Dec 2009 08:02:33 +0000 (08:02 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Dec 2009 08:02:33 +0000 (08:02 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9586 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/DxeMain.inf
MdeModulePkg/Core/Dxe/Image/Image.c

index a7191b8..3c71140 100644 (file)
   gEfiStatusCodeRuntimeProtocolGuid             ## SOMETIMES_CONSUMES\r
   gEfiCapsuleArchProtocolGuid                   ## CONSUMES\r
   gEfiDecompressProtocolGuid                    ## CONSUMES\r
-  gEfiLoadPeImageProtocolGuid                   ## PRODUCES\r
+  gEfiLoadPeImageProtocolGuid                   ## SOMETIMES_PRODUCES (Produces when PcdFrameworkCompatibilitySupport is set)\r
   gEfiSimpleFileSystemProtocolGuid              ## CONSUMES\r
   gEfiLoadFileProtocolGuid                      ## CONSUMES\r
   gEfiLoadFile2ProtocolGuid                     ## CONSUMES\r
   gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueBootServiceExit\r
   gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeDriverBegin\r
   gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeDriverEnd\r
+\r
+[FeaturePcd.common]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport         ## CONSUMES\r
index d0539b9..7e5cea7 100644 (file)
@@ -144,15 +144,19 @@ CoreInitializeImageServices (
   gDxeCoreImageHandle = Image->Handle;\r
   gDxeCoreLoadedImage = &Image->Info;\r
 \r
-  //\r
-  // Export DXE Core PE Loader functionality\r
-  //\r
-  return CoreInstallProtocolInterface (\r
-           &mLoadPe32PrivateData.Handle,\r
-           &gEfiLoadPeImageProtocolGuid,\r
-           EFI_NATIVE_INTERFACE,\r
-           &mLoadPe32PrivateData.Pe32Image\r
-           );\r
+  if (FeaturePcdGet (PcdFrameworkCompatibilitySupport)) {\r
+    //\r
+    // Export DXE Core PE Loader functionality for backward compatibility.\r
+    //\r
+    Status = CoreInstallProtocolInterface (\r
+      &mLoadPe32PrivateData.Handle,\r
+      &gEfiLoadPeImageProtocolGuid,\r
+      EFI_NATIVE_INTERFACE,\r
+      &mLoadPe32PrivateData.Pe32Image\r
+      );\r
+  }\r
+\r
+  return Status;\r
 }\r
 \r
 /**\r