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