2 Data structure and functions to load and unload PeImage.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #define LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE SIGNATURE_32('l','p','e','i')
25 EFI_PE32_IMAGE_PROTOCOL Pe32Image
;
26 } LOAD_PE32_IMAGE_PRIVATE_DATA
;
28 #define LOAD_PE32_IMAGE_PRIVATE_DATA_FROM_THIS(a) \
29 CR(a, LOAD_PE32_IMAGE_PRIVATE_DATA, Pe32Image, LOAD_PE32_IMAGE_PRIVATE_DATA_SIGNATURE)
35 #define IMAGE_FILE_HANDLE_SIGNATURE SIGNATURE_32('i','m','g','f')
44 Loads an EFI image into memory and returns a handle to the image with extended parameters.
46 @param This Calling context
47 @param ParentImageHandle The caller's image handle.
48 @param FilePath The specific file path from which the image is
50 @param SourceBuffer If not NULL, a pointer to the memory location
51 containing a copy of the image to be loaded.
52 @param SourceSize The size in bytes of SourceBuffer.
53 @param DstBuffer The buffer to store the image.
54 @param NumberOfPages For input, specifies the space size of the
55 image by caller if not NULL. For output,
56 specifies the actual space size needed.
57 @param ImageHandle Image handle for output.
58 @param EntryPoint Image entry point for output.
59 @param Attribute The bit mask of attributes to set for the load
62 @retval EFI_SUCCESS The image was loaded into memory.
63 @retval EFI_NOT_FOUND The FilePath was not found.
64 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
65 @retval EFI_UNSUPPORTED The image type is not supported, or the device
66 path cannot be parsed to locate the proper
67 protocol for loading the file.
68 @retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient
70 @retval EFI_LOAD_ERROR Image was not loaded because the image format was corrupt or not
72 @retval EFI_DEVICE_ERROR Image was not loaded because the device returned a read error.
73 @retval EFI_ACCESS_DENIED Image was not loaded because the platform policy prohibits the
74 image from being loaded. NULL is returned in *ImageHandle.
75 @retval EFI_SECURITY_VIOLATION Image was loaded and an ImageHandle was created with a
76 valid EFI_LOADED_IMAGE_PROTOCOL. However, the current
77 platform policy specifies that the image should not be started.
83 IN EFI_PE32_IMAGE_PROTOCOL
*This
,
84 IN EFI_HANDLE ParentImageHandle
,
85 IN EFI_DEVICE_PATH_PROTOCOL
*FilePath
,
86 IN VOID
*SourceBuffer OPTIONAL
,
88 IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL
,
89 OUT UINTN
*NumberOfPages OPTIONAL
,
90 OUT EFI_HANDLE
*ImageHandle
,
91 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint OPTIONAL
,
97 Unload the specified image.
99 @param This Indicates the calling context.
100 @param ImageHandle The specified image handle.
102 @retval EFI_INVALID_PARAMETER Image handle is NULL.
103 @retval EFI_UNSUPPORTED Attempt to unload an unsupported image.
104 @retval EFI_SUCCESS Image successfully unloaded.
110 IN EFI_PE32_IMAGE_PROTOCOL
*This
,
111 IN EFI_HANDLE ImageHandle