]> git.proxmox.com Git - mirror_edk2.git/commitdiff
[Description]
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Apr 2008 08:38:30 +0000 (08:38 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 22 Apr 2008 08:38:30 +0000 (08:38 +0000)
modify the value pointed by NumberOfPages to accordance with IN&OUT modifier's syntax.
[Impaction]
add comments for NumberOfPages parameter and assign a correct value to it.
[Reference Info]
NumberOfPages is only updated inside the if statement on line 725. If buffer is big enough the actual number of pages occupied by the image is not returned

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5112 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Image/Image.c

index 094d837f3ccb4fa9b8aa02311367052673867577..95528b89961e2808a20f9e1c98bb181fd878c384 100644 (file)
@@ -612,9 +612,9 @@ Arguments:
                         the image to be loaded.\r
   SourceSize          - The size in bytes of SourceBuffer.\r
   DstBuffer           - The buffer to store the image\r
-  NumberOfPages       - If not NULL, a pointer to the image's page number, if this number\r
-                        is not enough, return EFI_BUFFER_TOO_SMALL and this parameter contain\r
-                        the required number.\r
+  NumberOfPages       - If not NULL, it inputs a pointer to the page number of DstBuffer and outputs\r
+                        a pointer to the page number of the image. If this number is not enough, \r
+                        return EFI_BUFFER_TOO_SMALL and this parameter contains the required number.\r
   ImageHandle         - Pointer to the returned image handle that is created when the image\r
                         is successfully loaded.\r
   EntryPoint          - A pointer to the entry point\r
@@ -760,6 +760,10 @@ Returns:
     goto Done;\r
   }\r
 \r
+  if (NumberOfPages != NULL) {\r
+    *NumberOfPages = Image->NumberOfPages;\r
+  }  \r
+\r
   //\r
   // Register the image in the Debug Image Info Table if the attribute is set\r
   //\r