]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/PeCoffLib.h
1. UINTN & INTN issue for EBC architecture:
[mirror_edk2.git] / MdePkg / Include / Library / PeCoffLib.h
index 08e8195a8a2c8991ecd3f2f279d61b0750a5df67..0a68ae640f146811d35bc6346730ee4d23214beb 100644 (file)
@@ -75,15 +75,22 @@ typedef struct {
 \r
 \r
 /**\r
-       Retrieves information on a PE/COFF image\r
+  Retrieves information about a PE/COFF image.\r
 \r
-       @param  ImageContext The context of the image being loaded\r
+  Computes the PeCoffHeaderOffset, ImageAddress, ImageSize, DestinationAddress, CodeView,\r
+  PdbPointer, RelocationsStripped, SectionAlignment, SizeOfHeaders, and DebugDirectoryEntryRva\r
+  fields of the ImageContext structure.  If ImageContext is NULL, then return RETURN_INVALID_PARAMETER.\r
+  If the PE/COFF image accessed through the ImageRead service in the ImageContext structure is not\r
+  a supported PE/COFF image type, then return RETURN_UNSUPPORTED.  If any errors occur while\r
+  computing the fields of ImageContext, then the error status is returned in the ImageError field of\r
+  ImageContext. \r
 \r
-       @retval EFI_SUCCESS The information on the PE/COFF image was collected.\r
-       @retval EFI_INVALID_PARAMETER ImageContext is NULL.\r
-       @retval EFI_UNSUPPORTED The PE/COFF image is not supported.\r
-       @retval Otherwise The error status from reading the PE/COFF image using the\r
-       ImageContext->ImageRead() function\r
+  @param  ImageContext              Pointer to the image context structure that describes the PE/COFF\r
+                                    image that needs to be examined by this function.\r
+\r
+  @retval RETURN_SUCCESS            The information on the PE/COFF image was collected.\r
+  @retval RETURN_INVALID_PARAMETER  ImageContext is NULL.\r
+  @retval RETURN_UNSUPPORTED        The PE/COFF image is not supported.\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -94,13 +101,23 @@ PeCoffLoaderGetImageInfo (
 ;\r
 \r
 /**\r
-       Relocates a PE/COFF image in memory\r
+  Applies relocation fixups to a PE/COFF image that was loaded with PeCoffLoaderLoadImage().\r
+\r
+  If the DestinationAddress field of ImageContext is 0, then use the ImageAddress field of\r
+  ImageContext as the relocation base address.  Otherwise, use the DestinationAddress field\r
+  of ImageContext as the relocation base address.  The caller must allocate the relocation\r
+  fixup log buffer and fill in the FixupData field of ImageContext prior to calling this function.  \r
+  If ImageContext is NULL, then ASSERT().\r
 \r
-       @param  ImageContext Contains information on the loaded image to relocate\r
+  @param  ImageContext        Pointer to the image context structure that describes the PE/COFF\r
+                              image that is being relocated.\r
 \r
-       @retval EFI_SUCCESS      if the PE/COFF image was relocated\r
-       @retval EFI_LOAD_ERROR   if the image is not a valid PE/COFF image\r
-       @retval EFI_UNSUPPORTED  not support\r
+  @retval RETURN_SUCCESS      The PE/COFF image was relocated.\r
+                              Extended status information is in the ImageError field of ImageContext.\r
+  @retval RETURN_LOAD_ERROR   The image in not a valid PE/COFF image.\r
+                              Extended status information is in the ImageError field of ImageContext.\r
+  @retval RETURN_UNSUPPORTED  A relocation record type is not supported.\r
+                              Extended status information is in the ImageError field of ImageContext.\r
 \r
 **/\r
 RETURN_STATUS\r
@@ -111,14 +128,26 @@ PeCoffLoaderRelocateImage (
 ;\r
 \r
 /**\r
-       Loads a PE/COFF image into memory\r
-\r
-       @param  ImageContext Contains information on image to load into memory\r
-\r
-       @retval EFI_SUCCESS            if the PE/COFF image was loaded\r
-       @retval EFI_BUFFER_TOO_SMALL   if the caller did not provide a large enough buffer\r
-       @retval EFI_LOAD_ERROR         if the image is a runtime driver with no relocations\r
-       @retval EFI_INVALID_PARAMETER  if the image address is invalid\r
+  Loads a PE/COFF image into memory.\r
+\r
+  Loads the PE/COFF image accessed through the ImageRead service of ImageContext into the buffer\r
+  specified by the ImageAddress and ImageSize fields of ImageContext.  The caller must allocate\r
+  the load buffer and fill in the ImageAddress and ImageSize fields prior to calling this function.\r
+  The EntryPoint, FixupDataSize, CodeView, and PdbPointer fields of ImageContext are computed.\r
+  If ImageContext is NULL, then ASSERT().\r
+\r
+  @param  ImageContext              Pointer to the image context structure that describes the PE/COFF\r
+                                    image that is being loaded.\r
+\r
+  @retval RETURN_SUCCESS            The PE/COFF image was loaded into the buffer specified by\r
+                                    the ImageAddress and ImageSize fields of ImageContext.\r
+                                    Extended status information is in the ImageError field of ImageContext.\r
+  @retval RETURN_BUFFER_TOO_SMALL   The caller did not provide a large enough buffer.\r
+                                    Extended status information is in the ImageError field of ImageContext.\r
+  @retval RETURN_LOAD_ERROR         The PE/COFF image is an EFI Runtime image with no relocations.\r
+                                    Extended status information is in the ImageError field of ImageContext.\r
+  @retval RETURN_INVALID_PARAMETER  The image address is invalid.\r
+                                    Extended status information is in the ImageError field of ImageContext.\r
 \r
 **/\r
 RETURN_STATUS\r