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