]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/PeCoffGetEntryPointLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Library / PeCoffGetEntryPointLib.h
CommitLineData
fb3df220 1/** @file\r
50a64e5b 2 Provides a service to retrieve the PE/COFF entry point from a PE/COFF image.\r
fb3df220 3\r
9095d37b 4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
fb3df220 6\r
fb3df220 7**/\r
8\r
9#ifndef __PE_COFF_GET_ENTRY_POINT_LIB_H__\r
10#define __PE_COFF_GET_ENTRY_POINT_LIB_H__\r
11\r
12/**\r
13 Retrieves and returns a pointer to the entry point to a PE/COFF image that has been loaded\r
14 into system memory with the PE/COFF Loader Library functions.\r
15\r
16 Retrieves the entry point to the PE/COFF image specified by Pe32Data and returns this entry\r
17 point in EntryPoint. If the entry point could not be retrieved from the PE/COFF image, then\r
18 return RETURN_INVALID_PARAMETER. Otherwise return RETURN_SUCCESS.\r
19 If Pe32Data is NULL, then ASSERT().\r
20 If EntryPoint is NULL, then ASSERT().\r
21\r
af2dc6a7 22 @param Pe32Data The pointer to the PE/COFF image that is loaded in system memory.\r
23 @param EntryPoint The pointer to entry point to the PE/COFF image to return.\r
fb3df220 24\r
25 @retval RETURN_SUCCESS EntryPoint was returned.\r
26 @retval RETURN_INVALID_PARAMETER The entry point could not be found in the PE/COFF image.\r
27\r
28**/\r
29RETURN_STATUS\r
30EFIAPI\r
31PeCoffLoaderGetEntryPoint (\r
32 IN VOID *Pe32Data,\r
33 OUT VOID **EntryPoint\r
34 );\r
35\r
36/**\r
37 Returns the machine type of a PE/COFF image.\r
38\r
39 Returns the machine type from the PE/COFF image specified by Pe32Data.\r
40 If Pe32Data is NULL, then ASSERT().\r
41\r
af2dc6a7 42 @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r
fb3df220 43 memory.\r
44\r
cb6cb44c 45 @return Machine type or zero if not a valid image.\r
fb3df220 46\r
47**/\r
48UINT16\r
49EFIAPI\r
50PeCoffLoaderGetMachineType (\r
51 IN VOID *Pe32Data\r
52 );\r
53\r
54/**\r
55 Returns a pointer to the PDB file name for a PE/COFF image that has been\r
9095d37b 56 loaded into system memory with the PE/COFF Loader Library functions.\r
fb3df220 57\r
58 Returns the PDB file name for the PE/COFF image specified by Pe32Data. If\r
59 the PE/COFF image specified by Pe32Data is not a valid, then NULL is\r
60 returned. If the PE/COFF image specified by Pe32Data does not contain a\r
61 debug directory entry, then NULL is returned. If the debug directory entry\r
62 in the PE/COFF image specified by Pe32Data does not contain a PDB file name,\r
63 then NULL is returned.\r
64 If Pe32Data is NULL, then ASSERT().\r
65\r
af2dc6a7 66 @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r
fb3df220 67 memory.\r
68\r
af2dc6a7 69 @return The PDB file name for the PE/COFF image specified by Pe32Data, or NULL\r
fb3df220 70 if it cannot be retrieved.\r
71\r
72**/\r
73VOID *\r
74EFIAPI\r
75PeCoffLoaderGetPdbPointer (\r
76 IN VOID *Pe32Data\r
77 );\r
78\r
225290eb
A
79/**\r
80 Returns the size of the PE/COFF headers\r
81\r
82 Returns the size of the PE/COFF header specified by Pe32Data.\r
83 If Pe32Data is NULL, then ASSERT().\r
84\r
af2dc6a7 85 @param Pe32Data The pointer to the PE/COFF image that is loaded in system\r
225290eb
A
86 memory.\r
87\r
af2dc6a7 88 @return Size of PE/COFF header in bytes, or zero if not a valid image.\r
225290eb
A
89\r
90**/\r
cb6cb44c 91UINT32\r
92EFIAPI\r
93PeCoffGetSizeOfHeaders (\r
2f88bd3a 94 IN VOID *Pe32Data\r
cb6cb44c 95 );\r
225290eb 96\r
412e9dea
JF
97/**\r
98 Returns PE/COFF image base specified by the address in this PE/COFF image.\r
99\r
100 On DEBUG build, searches the PE/COFF image base forward the address in this\r
101 PE/COFF image and returns it.\r
102\r
103 @param Address Address located in one PE/COFF image.\r
104\r
105 @retval 0 RELEASE build or cannot find the PE/COFF image base.\r
106 @retval others PE/COFF image base found.\r
107\r
108**/\r
109UINTN\r
110EFIAPI\r
9e981317 111PeCoffSearchImageBase (\r
2f88bd3a 112 IN UINTN Address\r
412e9dea
JF
113 );\r
114\r
fb3df220 115#endif\r