TianoCore EDK2 master
Loading...
Searching...
No Matches
PeCoffLib.h
Go to the documentation of this file.
1
13#ifndef __BASE_PE_COFF_LIB_H__
14#define __BASE_PE_COFF_LIB_H__
15
17//
18// Return status codes from the PE/COFF Loader services
19//
20#define IMAGE_ERROR_SUCCESS 0
21#define IMAGE_ERROR_IMAGE_READ 1
22#define IMAGE_ERROR_INVALID_PE_HEADER_SIGNATURE 2
23#define IMAGE_ERROR_INVALID_MACHINE_TYPE 3
24#define IMAGE_ERROR_INVALID_SUBSYSTEM 4
25#define IMAGE_ERROR_INVALID_IMAGE_ADDRESS 5
26#define IMAGE_ERROR_INVALID_IMAGE_SIZE 6
27#define IMAGE_ERROR_INVALID_SECTION_ALIGNMENT 7
28#define IMAGE_ERROR_SECTION_NOT_LOADED 8
29#define IMAGE_ERROR_FAILED_RELOCATION 9
30#define IMAGE_ERROR_FAILED_ICACHE_FLUSH 10
31#define IMAGE_ERROR_UNSUPPORTED 11
32
63typedef
64RETURN_STATUS
66 IN VOID *FileHandle,
67 IN UINTN FileOffset,
68 IN OUT UINTN *ReadSize,
69 OUT VOID *Buffer
70 );
71
75typedef struct {
79 PHYSICAL_ADDRESS ImageAddress;
84 UINT64 ImageSize;
91 PHYSICAL_ADDRESS DestinationAddress;
95 PHYSICAL_ADDRESS EntryPoint;
104 VOID *Handle;
131 VOID *CodeView;
168 UINT16 Machine;
172 UINT16 ImageType;
178 UINT32 DllCharacteristicsEx;
189 BOOLEAN IsTeImage;
195 PHYSICAL_ADDRESS HiiResourceData;
199 UINT64 Context;
201
226RETURN_STATUS
227EFIAPI
230 );
231
262RETURN_STATUS
263EFIAPI
266 );
267
299RETURN_STATUS
300EFIAPI
303 );
304
328RETURN_STATUS
329EFIAPI
331 IN VOID *FileHandle,
332 IN UINTN FileOffset,
333 IN OUT UINTN *ReadSize,
334 OUT VOID *Buffer
335 );
336
360VOID
361EFIAPI
363 IN PHYSICAL_ADDRESS ImageBase,
364 IN PHYSICAL_ADDRESS VirtImageBase,
365 IN UINTN ImageSize,
366 IN VOID *RelocationData
367 );
368
385RETURN_STATUS
386EFIAPI
389 );
390
391#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFIAPI PeCoffLoaderLoadImage(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
Definition: BasePeCoff.c:1244
RETURN_STATUS EFIAPI PeCoffLoaderRelocateImage(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
Definition: BasePeCoff.c:956
VOID EFIAPI PeCoffLoaderRelocateImageForRuntime(IN PHYSICAL_ADDRESS ImageBase, IN PHYSICAL_ADDRESS VirtImageBase, IN UINTN ImageSize, IN VOID *RelocationData)
Definition: BasePeCoff.c:1742
RETURN_STATUS EFIAPI PeCoffLoaderUnloadImage(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
Definition: BasePeCoff.c:2025
RETURN_STATUS(EFIAPI * PE_COFF_LOADER_READ_FILE)(IN VOID *FileHandle, IN UINTN FileOffset, IN OUT UINTN *ReadSize, OUT VOID *Buffer)
Definition: PeCoffLib.h:65
RETURN_STATUS EFIAPI PeCoffLoaderGetImageInfo(IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext)
Definition: BasePeCoff.c:577
RETURN_STATUS EFIAPI PeCoffLoaderImageReadFromMemory(IN VOID *FileHandle, IN UINTN FileOffset, IN OUT UINTN *ReadSize, OUT VOID *Buffer)
Definition: BasePeCoff.c:1992
PHYSICAL_ADDRESS DestinationAddress
Definition: PeCoffLib.h:91
PE_COFF_LOADER_READ_FILE ImageRead
Definition: PeCoffLib.h:100
PHYSICAL_ADDRESS EntryPoint
Definition: PeCoffLib.h:95
PHYSICAL_ADDRESS HiiResourceData
Definition: PeCoffLib.h:195
PHYSICAL_ADDRESS ImageAddress
Definition: PeCoffLib.h:79