From 152af594ccbbc581f3c807b609d4ff53dc47f64e Mon Sep 17 00:00:00 2001 From: eric_tian Date: Tue, 22 Apr 2008 08:38:30 +0000 Subject: [Description] 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'MdeModulePkg/Core/Dxe') diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 094d837f3c..95528b8996 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -612,9 +612,9 @@ Arguments: the image to be loaded. SourceSize - The size in bytes of SourceBuffer. DstBuffer - The buffer to store the image - NumberOfPages - If not NULL, a pointer to the image's page number, if this number - is not enough, return EFI_BUFFER_TOO_SMALL and this parameter contain - the required number. + NumberOfPages - If not NULL, it inputs a pointer to the page number of DstBuffer and outputs + a pointer to the page number of the image. If this number is not enough, + return EFI_BUFFER_TOO_SMALL and this parameter contains the required number. ImageHandle - Pointer to the returned image handle that is created when the image is successfully loaded. EntryPoint - A pointer to the entry point @@ -760,6 +760,10 @@ Returns: goto Done; } + if (NumberOfPages != NULL) { + *NumberOfPages = Image->NumberOfPages; + } + // // Register the image in the Debug Image Info Table if the attribute is set // -- cgit v1.2.3