2 Load File protocol as defined in the UEFI 2.0 specification.
4 The load file protocol exists to supports the addition of new boot devices,
5 and to support booting from devices that do not map well to file system.
6 Network boot is done via a LoadFile protocol.
8 UEFI 2.0 can boot from any device that produces a LoadFile protocol.
10 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
11 SPDX-License-Identifier: BSD-2-Clause-Patent
15 #ifndef __EFI_LOAD_FILE_PROTOCOL_H__
16 #define __EFI_LOAD_FILE_PROTOCOL_H__
18 #define EFI_LOAD_FILE_PROTOCOL_GUID \
20 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
24 /// Protocol Guid defined by EFI1.1.
26 #define LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL_GUID
28 typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL
;
31 /// Backward-compatible with EFI1.1
33 typedef EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_INTERFACE
;
36 Causes the driver to load a specified file.
38 @param This Protocol instance pointer.
39 @param FilePath The device specific path of the file to load.
40 @param BootPolicy If TRUE, indicates that the request originates from the
41 boot manager is attempting to load FilePath as a boot
42 selection. If FALSE, then FilePath must match as exact file
44 @param BufferSize On input the size of Buffer in bytes. On output with a return
45 code of EFI_SUCCESS, the amount of data transferred to
46 Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,
47 the size of Buffer required to retrieve the requested file.
48 @param Buffer The memory buffer to transfer the file to. IF Buffer is NULL,
49 then the size of the requested file is returned in
52 @retval EFI_SUCCESS The file was loaded.
53 @retval EFI_UNSUPPORTED The device does not support the provided BootPolicy
54 @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or
56 @retval EFI_NO_MEDIA No medium was present to load the file.
57 @retval EFI_DEVICE_ERROR The file was not loaded due to a device error.
58 @retval EFI_NO_RESPONSE The remote system did not respond.
59 @retval EFI_NOT_FOUND The file was not found.
60 @retval EFI_ABORTED The file load process was manually cancelled.
61 @retval EFI_WARN_FILE_SYSTEM The resulting Buffer contains UEFI-compliant file system.
65 (EFIAPI
*EFI_LOAD_FILE
)(
66 IN EFI_LOAD_FILE_PROTOCOL
*This
,
67 IN EFI_DEVICE_PATH_PROTOCOL
*FilePath
,
68 IN BOOLEAN BootPolicy
,
69 IN OUT UINTN
*BufferSize
,
70 IN VOID
*Buffer OPTIONAL
74 /// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices.
76 struct _EFI_LOAD_FILE_PROTOCOL
{
77 EFI_LOAD_FILE LoadFile
;
80 extern EFI_GUID gEfiLoadFileProtocolGuid
;