2 Data structure and functions to load and unload PeImage.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #define LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE SIGNATURE_32('l','p','e','i')
19 EFI_PE32_IMAGE_PROTOCOL Pe32Image
;
20 } LOAD_PE32_IMAGE_PRIVATE_DATA
;
22 #define LOAD_PE32_IMAGE_PRIVATE_DATA_FROM_THIS(a) \
23 CR(a, LOAD_PE32_IMAGE_PRIVATE_DATA, Pe32Image, LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE)
29 #define IMAGE_FILE_HANDLE_SIGNATURE SIGNATURE_32('i','m','g','f')
38 Loads an EFI image into memory and returns a handle to the image with extended parameters.
40 @param This Calling context
41 @param ParentImageHandle The caller's image handle.
42 @param FilePath The specific file path from which the image is
44 @param SourceBuffer If not NULL, a pointer to the memory location
45 containing a copy of the image to be loaded.
46 @param SourceSize The size in bytes of SourceBuffer.
47 @param DstBuffer The buffer to store the image.
48 @param NumberOfPages For input, specifies the space size of the
49 image by caller if not NULL. For output,
50 specifies the actual space size needed.
51 @param ImageHandle Image handle for output.
52 @param EntryPoint Image entry point for output.
53 @param Attribute The bit mask of attributes to set for the load
56 @retval EFI_SUCCESS The image was loaded into memory.
57 @retval EFI_NOT_FOUND The FilePath was not found.
58 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
59 @retval EFI_UNSUPPORTED The image type is not supported, or the device
60 path cannot be parsed to locate the proper
61 protocol for loading the file.
62 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient
64 @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
66 @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
67 @retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
68 image from being loaded. NULL is returned in *ImageHandle.
69 @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
70 valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
71 platform policy specifies that the image should not be started.
77 IN EFI_PE32_IMAGE_PROTOCOL
*This
,
78 IN EFI_HANDLE ParentImageHandle
,
79 IN EFI_DEVICE_PATH_PROTOCOL
*FilePath
,
80 IN VOID
*SourceBuffer OPTIONAL
,
82 IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL
,
83 OUT UINTN
*NumberOfPages OPTIONAL
,
84 OUT EFI_HANDLE
*ImageHandle
,
85 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint OPTIONAL
,
91 Unload the specified image.
93 @param This Indicates the calling context.
94 @param ImageHandle The specified image handle.
96 @retval EFI_INVALID_PARAMETER Image handle is NULL.
97 @retval EFI_UNSUPPORTED Attempt to unload an unsupported image.
98 @retval EFI_SUCCESS Image successfully unloaded.
104 IN EFI_PE32_IMAGE_PROTOCOL
*This
,
105 IN EFI_HANDLE ImageHandle