]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Protocol/LoadPe32Image.h
remedy the comment of EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / LoadPe32Image.h
CommitLineData
504214c4 1/** @file\r
d8a43975 2\r
346cf9ac 3 Load Pe32 Image protocol provides capability to load and unload EFI image into memory and execute it.\r
d8a43975 4\r
346cf9ac
LG
5 This protocol supports the additional new boot devices that do not map well to file system.\r
6 UEFI can boot from any device (including Network boot) that produces a LoadFile protocol.\r
d8a43975 7\r
504214c4
LG
8Copyright (c) 2006 - 2008, Intel Corporation\r
9All rights reserved. This program and the accompanying materials\r
10are licensed and made available under the terms and conditions of the BSD License\r
11which accompanies this distribution. The full text of the license may be found at\r
12http://opensource.org/licenses/bsd-license.php\r
13\r
14THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16\r
17**/\r
d8a43975 18\r
19#ifndef __LOAD_PE32_IMAGE_H__\r
20#define __LOAD_PE32_IMAGE_H__\r
21\r
22#define PE32_IMAGE_PROTOCOL_GUID \\r
23 {0x5cb5c776,0x60d5,0x45ee,{0x88,0x3c,0x45,0x27,0x8,0xcd,0x74,0x3f }}\r
24\r
25#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_NONE 0x00\r
26#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION 0x01\r
27#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION 0x02\r
28\r
29typedef struct _EFI_PE32_IMAGE_PROTOCOL EFI_PE32_IMAGE_PROTOCOL;\r
30\r
504214c4
LG
31/**\r
32\r
33 Loads an EFI image into memory and returns a handle to the image with extended parameters.\r
34\r
346cf9ac 35 @param This Pointer to the LoadPe32Image protocol instance\r
504214c4
LG
36 @param ParentImageHandle The caller's image handle.\r
37 @param FilePath The specific file path from which the image is loaded.\r
38 @param SourceBuffer If not NULL, a pointer to the memory location containing a copy of\r
39 the image to be loaded.\r
40 @param SourceSize The size in bytes of SourceBuffer.\r
41 @param DstBuffer The buffer to store the image.\r
42 @param NumberOfPages For input, specifies the space size of the image by caller if not NULL.\r
43 For output, specifies the actual space size needed.\r
44 @param ImageHandle Image handle for output.\r
45 @param EntryPoint Image entry point for output.\r
46 @param Attribute The bit mask of attributes to set for the load PE image.\r
47\r
48 @retval EFI_SUCCESS The image was loaded into memory.\r
49 @retval EFI_NOT_FOUND The FilePath was not found.\r
50 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
51 @retval EFI_UNSUPPORTED The image type is not supported, or the device path cannot be\r
52 parsed to locate the proper protocol for loading the file.\r
346cf9ac 53 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient memory resources.\r
504214c4 54**/\r
d8a43975 55typedef\r
56EFI_STATUS\r
7d839888 57(EFIAPI *LOAD_PE_IMAGE)(\r
d8a43975 58 IN EFI_PE32_IMAGE_PROTOCOL *This,\r
59 IN EFI_HANDLE ParentImageHandle,\r
60 IN EFI_DEVICE_PATH_PROTOCOL *FilePath,\r
61 IN VOID *SourceBuffer OPTIONAL,\r
62 IN UINTN SourceSize,\r
63 IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL,\r
64 OUT UINTN *NumberOfPages OPTIONAL,\r
65 OUT EFI_HANDLE *ImageHandle,\r
66 OUT EFI_PHYSICAL_ADDRESS *EntryPoint OPTIONAL,\r
67 IN UINT32 Attribute\r
68 );\r
69\r
504214c4
LG
70/**\r
71\r
72 Unload the specified image.\r
73\r
346cf9ac
LG
74 @param This Pointer to the LoadPe32Image protocol instance\r
75 @param ImageHandle The specified image handle to be unloaded.\r
504214c4
LG
76\r
77 @retval EFI_INVALID_PARAMETER Image handle is NULL.\r
78 @retval EFI_UNSUPPORTED Attempt to unload an unsupported image.\r
346cf9ac 79 @retval EFI_SUCCESS Image is successfully unloaded.\r
504214c4
LG
80\r
81--*/\r
d8a43975 82typedef\r
83EFI_STATUS\r
7d839888 84(EFIAPI *UNLOAD_PE_IMAGE)(\r
d8a43975 85 IN EFI_PE32_IMAGE_PROTOCOL *This,\r
86 IN EFI_HANDLE ImageHandle\r
87 );\r
88\r
89struct _EFI_PE32_IMAGE_PROTOCOL {\r
90 LOAD_PE_IMAGE LoadPeImage;\r
346cf9ac 91 UNLOAD_PE_IMAGE UnLoadPeImage;\r
d8a43975 92};\r
93\r
94extern EFI_GUID gEfiLoadPeImageProtocolGuid;\r
95\r
96#endif\r
97\r