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