TianoCore EDK2 master
|
#include "UnitTestUefiBootServicesTableLib.h"
Go to the source code of this file.
Functions | |
EFI_STATUS EFIAPI | UnitTestLoadImage (IN BOOLEAN BootPolicy, IN EFI_HANDLE ParentImageHandle, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN VOID *SourceBuffer OPTIONAL, IN UINTN SourceSize, OUT EFI_HANDLE *ImageHandle) |
EFI_STATUS EFIAPI | UnitTestStartImage (IN EFI_HANDLE ImageHandle, OUT UINTN *ExitDataSize, OUT CHAR16 **ExitData OPTIONAL) |
EFI_STATUS EFIAPI | UnitTestExit (IN EFI_HANDLE ImageHandle, IN EFI_STATUS Status, IN UINTN ExitDataSize, IN CHAR16 *ExitData OPTIONAL) |
EFI_STATUS EFIAPI | UnitTestUnloadImage (IN EFI_HANDLE ImageHandle) |
EFI_STATUS EFIAPI | UnitTestExitBootServices (IN EFI_HANDLE ImageHandle, IN UINTN MapKey) |
Implementation of image related services in the UEFI Boot Services table for use in unit tests.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestExit | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_STATUS | Status, | ||
IN UINTN | ExitDataSize, | ||
IN CHAR16 *ExitData | OPTIONAL | ||
) |
Terminates the currently loaded EFI image and returns control to boot services.
ImageHandle | Handle that identifies the image. This parameter is passed to the image on entry. |
Status | The image's exit code. |
ExitDataSize | The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS. |
ExitData | Pointer to a data buffer that includes a Null-terminated Unicode string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for the image's exit. |
EFI_INVALID_PARAMETER | Image handle is NULL or it is not current image. |
EFI_SUCCESS | Successfully terminates the currently loaded EFI image. |
EFI_ACCESS_DENIED | Should never reach there. |
EFI_OUT_OF_RESOURCES | Could not allocate pool |
Definition at line 114 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestExitBootServices | ( | IN EFI_HANDLE | ImageHandle, |
IN UINTN | MapKey | ||
) |
Terminates all boot services.
ImageHandle | Handle that identifies the exiting image. |
MapKey | Key to the latest memory map. |
EFI_SUCCESS | Boot Services terminated |
EFI_INVALID_PARAMETER | MapKey is incorrect. |
Definition at line 157 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestLoadImage | ( | IN BOOLEAN | BootPolicy, |
IN EFI_HANDLE | ParentImageHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, | ||
IN VOID *SourceBuffer | OPTIONAL, | ||
IN UINTN | SourceSize, | ||
OUT EFI_HANDLE * | ImageHandle | ||
) |
Loads an EFI image into memory and returns a handle to the image.
BootPolicy | If TRUE, indicates that the request originates from the boot manager, and that the boot manager is attempting to load FilePath as a boot selection. |
ParentImageHandle | The caller's image handle. |
FilePath | The specific file path from which the image is loaded. |
SourceBuffer | If not NULL, a pointer to the memory location containing a copy of the image to be loaded. |
SourceSize | The size in bytes of SourceBuffer. |
ImageHandle | Pointer to the returned image handle that is created when the image is successfully loaded. |
EFI_SUCCESS | The image was loaded into memory. |
EFI_NOT_FOUND | The FilePath was not found. |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
EFI_UNSUPPORTED | The image type is not supported, or the device path cannot be parsed to locate the proper protocol for loading the file. |
EFI_OUT_OF_RESOURCES | Image was not loaded due to insufficient resources. |
EFI_LOAD_ERROR | Image was not loaded because the image format was corrupt or not understood. |
EFI_DEVICE_ERROR | Image was not loaded because the device returned a read error. |
EFI_ACCESS_DENIED | Image was not loaded because the platform policy prohibits the image from being loaded. NULL is returned in *ImageHandle. |
EFI_SECURITY_VIOLATION | Image was loaded and an ImageHandle was created with a valid EFI_LOADED_IMAGE_PROTOCOL. However, the current platform policy specifies that the image should not be started. |
Definition at line 47 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestStartImage | ( | IN EFI_HANDLE | ImageHandle, |
OUT UINTN * | ExitDataSize, | ||
OUT CHAR16 **ExitData | OPTIONAL | ||
) |
Transfer control to a loaded image's entry point.
ImageHandle | Handle of image to be started. |
ExitDataSize | Pointer of the size to ExitData |
ExitData | Pointer to a pointer to a data buffer that includes a Null-terminated string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for the image's exit. |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_OUT_OF_RESOURCES | No enough buffer to allocate |
EFI_SECURITY_VIOLATION | The current platform policy specifies that the image should not be started. |
EFI_SUCCESS | Successfully transfer control to the image's entry point. |
Definition at line 80 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestUnloadImage | ( | IN EFI_HANDLE | ImageHandle | ) |
Unloads an image.
ImageHandle | Handle that identifies the image to be unloaded. |
EFI_SUCCESS | The image has been unloaded. |
EFI_UNSUPPORTED | The image has been started, and does not support unload. |
EFI_INVALID_PARAMPETER | ImageHandle is not a valid image handle. |
Definition at line 138 of file UnitTestUefiBootServicesTableLibImage.c.