Correct the PeImage Source file to be measured by TCG.
authorlgao4 <lgao4@de2fecce-e211-0410-80a6-f3fac2684e05>
Tue, 4 Mar 2008 09:32:41 +0000 (09:32 +0000)
committerlgao4 <lgao4@de2fecce-e211-0410-80a6-f3fac2684e05>
Tue, 4 Mar 2008 09:32:41 +0000 (09:32 +0000)
git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@4787 de2fecce-e211-0410-80a6-f3fac2684e05

edk2/MdeModulePkg/Core/Dxe/Image/Image.c

index 125134d..3587460 100644 (file)
@@ -208,7 +208,9 @@ Returns:
   UINTN                     Size;\r
   UINTN                     LinkTimeBase;\r
   EFI_TCG_PLATFORM_PROTOCOL *TcgPlatformProtocol;\r
+  IMAGE_FILE_HANDLE         *FHandle;\r
 \r
+  FHandle = NULL;\r
   ZeroMem (&Image->ImageContext, sizeof (Image->ImageContext));\r
 \r
   Image->ImageContext.Handle    = Pe32Handle;\r
@@ -362,17 +364,18 @@ Returns:
              NULL,\r
              (VOID **) &TcgPlatformProtocol\r
              );\r
-  if (!EFI_ERROR (Status)) {    \r
+  if (!EFI_ERROR (Status)) {\r
+    FHandle = (IMAGE_FILE_HANDLE *) Image->ImageContext.Handle;\r
     Status = TcgPlatformProtocol->MeasurePeImage (\r
                                     BootPolicy,\r
-                                    Image->ImageContext.ImageAddress,\r
-                                    (UINTN) Image->ImageContext.ImageSize,\r
+                                    (EFI_PHYSICAL_ADDRESS) (UINTN) FHandle->Source,\r
+                                    FHandle->SourceSize,\r
                                     LinkTimeBase,\r
                                     Image->ImageContext.ImageType,\r
                                     Image->Info.DeviceHandle,\r
                                     Image->Info.FilePath\r
                                     );\r
-    \r
+\r
     ASSERT_EFI_ERROR (Status);\r
   }\r
 \r