]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / SecurityStubDxe / Defer3rdPartyImageLoad.h
CommitLineData
8be37a5c
RN
1/** @file\r
2 Implement defer image load services for user identification in UEFI2.2.\r
3\r
4Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
9d510e61 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
8be37a5c
RN
6\r
7**/\r
8\r
9#ifndef _DEFER_3RD_PARTY_IMAGE_LOAD_H_\r
10#define _DEFER_3RD_PARTY_IMAGE_LOAD_H_\r
11\r
e048823f 12#include <PiDxe.h>\r
8be37a5c
RN
13#include <Guid/EventGroup.h>\r
14#include <Protocol/DeferredImageLoad.h>\r
15#include <Protocol/FirmwareVolume2.h>\r
e048823f 16#include <Protocol/DxeSmmReadyToLock.h>\r
8be37a5c
RN
17\r
18#include <Library/UefiBootServicesTableLib.h>\r
19#include <Library/BaseMemoryLib.h>\r
20#include <Library/MemoryAllocationLib.h>\r
21#include <Library/DevicePathLib.h>\r
22#include <Library/DebugLib.h>\r
e048823f
RN
23#include <Library/UefiLib.h>\r
24#include <Library/ReportStatusCodeLib.h>\r
8be37a5c
RN
25\r
26/**\r
27 Returns information about a deferred image.\r
28\r
29 This function returns information about a single deferred image. The deferred images are\r
30 numbered consecutively, starting with 0. If there is no image which corresponds to\r
31 ImageIndex, then EFI_NOT_FOUND is returned. All deferred images may be returned by\r
32 iteratively calling this function until EFI_NOT_FOUND is returned.\r
33 Image may be NULL and ImageSize set to 0 if the decision to defer execution was made\r
34 because of the location of the executable image, rather than its actual contents.\r
35\r
36 @param[in] This Points to this instance of the EFI_DEFERRED_IMAGE_LOAD_PROTOCOL.\r
37 @param[in] ImageIndex Zero-based index of the deferred index.\r
38 @param[out] ImageDevicePath On return, points to a pointer to the device path of the image.\r
39 The device path should not be freed by the caller.\r
40 @param[out] Image On return, points to the first byte of the image or NULL if the\r
41 image is not available. The image should not be freed by the caller\r
42 unless LoadImage() has been successfully called.\r
43 @param[out] ImageSize On return, the size of the image, or 0 if the image is not available.\r
44 @param[out] BootOption On return, points to TRUE if the image was intended as a boot option\r
45 or FALSE if it was not intended as a boot option.\r
46\r
47 @retval EFI_SUCCESS Image information returned successfully.\r
48 @retval EFI_NOT_FOUND ImageIndex does not refer to a valid image.\r
49 @retval EFI_INVALID_PARAMETER ImageDevicePath is NULL or Image is NULL or ImageSize is NULL or\r
50 BootOption is NULL.\r
51\r
52**/\r
53EFI_STATUS\r
54EFIAPI\r
55GetDefferedImageInfo (\r
56 IN EFI_DEFERRED_IMAGE_LOAD_PROTOCOL *This,\r
57 IN UINTN ImageIndex,\r
58 OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,\r
59 OUT VOID **Image,\r
60 OUT UINTN *ImageSize,\r
61 OUT BOOLEAN *BootOption\r
62 );\r
63\r
64/**\r
65 Defer the 3rd party image load and installs Deferred Image Load Protocol.\r
66\r
67 @param[in] File This is a pointer to the device path of the file that\r
68 is being dispatched. This will optionally be used for\r
69 logging.\r
70 @param[in] BootPolicy A boot policy that was used to call LoadImage() UEFI service.\r
71\r
72 @retval EFI_SUCCESS The file is not 3rd party image and can be loaded immediately.\r
73 @retval EFI_ACCESS_DENIED The file is 3rd party image and needs deferred.\r
74**/\r
75EFI_STATUS\r
76Defer3rdPartyImageLoad (\r
77 IN CONST EFI_DEVICE_PATH_PROTOCOL *File,\r
78 IN BOOLEAN BootPolicy\r
79 );\r
80\r
81/**\r
82 Installs DeferredImageLoad Protocol and listens EndOfDxe event.\r
83**/\r
84VOID\r
85Defer3rdPartyImageLoadInitialize (\r
86 VOID\r
87 );\r
88\r
89#endif\r