TianoCore EDK2 master
Loading...
Searching...
No Matches
PrmPeCoffLib.h File Reference
#include <Base.h>
#include <PrmExportDescriptor.h>
#include <IndustryStandard/PeImage.h>
#include <Library/PeCoffLib.h>

Go to the source code of this file.

Functions

EFI_STATUS GetPrmModuleExportDescriptorTable (IN EFI_IMAGE_EXPORT_DIRECTORY *ImageExportDirectory, IN PE_COFF_LOADER_IMAGE_CONTEXT *PeCoffLoaderImageContext, OUT PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT **ExportDescriptor)
 
EFI_STATUS GetExportDirectoryInPeCoffImage (IN VOID *Image, IN PE_COFF_LOADER_IMAGE_CONTEXT *PeCoffLoaderImageContext, OUT EFI_IMAGE_EXPORT_DIRECTORY **ImageExportDirectory)
 
EFI_STATUS GetImageVersionInPeCoffImage (IN VOID *Image, IN PE_COFF_LOADER_IMAGE_CONTEXT *PeCoffLoaderImageContext, OUT UINT16 *ImageMajorVersion, OUT UINT16 *ImageMinorVersion)
 
EFI_STATUS GetExportEntryAddress (IN CONST CHAR8 *ExportName, IN EFI_PHYSICAL_ADDRESS ImageBaseAddress, IN EFI_IMAGE_EXPORT_DIRECTORY *ImageExportDirectory, OUT EFI_PHYSICAL_ADDRESS *ExportPhysicalAddress)
 

Detailed Description

The PRM PE/COFF library provides functionality to support additional PE/COFF functionality needed to use Platform Runtime Mechanism (PRM) modules.

Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PrmPeCoffLib.h.

Function Documentation

◆ GetExportDirectoryInPeCoffImage()

EFI_STATUS GetExportDirectoryInPeCoffImage ( IN VOID *  Image,
IN PE_COFF_LOADER_IMAGE_CONTEXT PeCoffLoaderImageContext,
OUT EFI_IMAGE_EXPORT_DIRECTORY **  ImageExportDirectory 
)

Gets a pointer to the export directory in a given PE/COFF image.

Parameters
[in]ImageA pointer to a PE32/COFF image base address that is loaded into memory and already relocated to the memory base address. RVAs in the image given should be valid.
[in]PeCoffLoaderImageContextA pointer to a PE_COFF_LOADER_IMAGE_CONTEXT structure that contains the PE/COFF image context for the Image given.
[out]ImageExportDirectoryA pointer to a pointer to the export directory found in the Image given.
Return values
EFI_SUCCESSThe export directory was found successfully.
EFI_INVALID_PARAMETERA required parameter is NULL.
EFI_UNSUPPORTEDThe PE/COFF image given is not supported as a PRM Module.
EFI_NOT_FOUNDThe image export directory could not be found for this image.

Definition at line 151 of file DxePrmPeCoffLib.c.

◆ GetExportEntryAddress()

EFI_STATUS GetExportEntryAddress ( IN CONST CHAR8 *  ExportName,
IN EFI_PHYSICAL_ADDRESS  ImageBaseAddress,
IN EFI_IMAGE_EXPORT_DIRECTORY ImageExportDirectory,
OUT EFI_PHYSICAL_ADDRESS ExportPhysicalAddress 
)

Gets the address of an entry in an image export table by ASCII name.

Parameters
[in]ExportNameA pointer to an ASCII name string of the entry name.
[in]ImageBaseAddressThe base address of the PE/COFF image.
[in]ImageExportDirectoryA pointer to the export directory in the image.
[out]ExportPhysicalAddressA pointer that will be updated with the address of the address of the export entry if found.
Return values
EFI_SUCCESSThe export entry was found successfully.
EFI_INVALID_PARAMETERA required pointer argument is NULL.
EFI_NOT_FOUNDAn entry with the given ExportName was not found.

Definition at line 375 of file DxePrmPeCoffLib.c.

◆ GetImageVersionInPeCoffImage()

EFI_STATUS GetImageVersionInPeCoffImage ( IN VOID *  Image,
IN PE_COFF_LOADER_IMAGE_CONTEXT PeCoffLoaderImageContext,
OUT UINT16 *  ImageMajorVersion,
OUT UINT16 *  ImageMinorVersion 
)

Returns the image major and image minor version in a given PE/COFF image.

Parameters
[in]ImageA pointer to a PE32/COFF image base address that is loaded into memory and already relocated to the memory base address. RVAs in the image given should be valid.
[in]PeCoffLoaderImageContextA pointer to a PE_COFF_LOADER_IMAGE_CONTEXT structure that contains the PE/COFF image context for the Image given.
[out]ImageMajorVersionA pointer to a UINT16 buffer to hold the image major version.
[out]ImageMinorVersionA pointer to a UINT16 buffer to hold the image minor version.
Return values
EFI_SUCCESSThe image version was read successfully.
EFI_INVALID_PARAMETERA required parameter is NULL.
EFI_UNSUPPORTEDThe PE/COFF image given is not supported.

Definition at line 280 of file DxePrmPeCoffLib.c.

◆ GetPrmModuleExportDescriptorTable()

EFI_STATUS GetPrmModuleExportDescriptorTable ( IN EFI_IMAGE_EXPORT_DIRECTORY ImageExportDirectory,
IN PE_COFF_LOADER_IMAGE_CONTEXT PeCoffLoaderImageContext,
OUT PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT **  ExportDescriptor 
)

Gets a pointer to the export directory in a given PE/COFF image.

Parameters
[in]ImageExportDirectoryA pointer to an export directory table in a PE/COFF image.
[in]PeCoffLoaderImageContextA pointer to a PE_COFF_LOADER_IMAGE_CONTEXT structure that contains the PE/COFF image context for the Image containing the PRM Module Export Descriptor table.
[out]ExportDescriptorA pointer to a pointer to the PRM Module Export Descriptor table found in the ImageExportDirectory given.
Return values
EFI_SUCCESSThe PRM Module Export Descriptor table was found successfully.
EFI_INVALID_PARAMETERA required parameter is NULL.
EFI_NOT_FOUNDThe PRM Module Export Descriptor table was not found in the given ImageExportDirectory.

Definition at line 39 of file DxePrmPeCoffLib.c.