1 /** 2 Based on Protocol/LoadFile2.h, original notice: 3 4 Load File protocol as defined in the UEFI 2.0 specification. 5 6 Load file protocol exists to supports the addition of new boot devices, 7 and to support booting from devices that do not map well to file system. 8 Network boot is done via a LoadFile protocol. 9 10 UEFI 2.0 can boot from any device that produces a LoadFile protocol. 11 12 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved. 13 This program and the accompanying materials 14 are licensed and made available under the terms and conditions of the BSD License 15 which accompanies this distribution. The full text of the license may be found at 16 http://opensource.org/licenses/bsd-license.php 17 18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 20 21 **/ 22 module uefi.protocols.loadfile2; 23 import uefi.base; 24 import uefi.base_type; 25 import uefi.protocols.devicepath; 26 27 public: 28 extern (C): 29 enum EFI_GUID EFI_LOAD_FILE2_PROTOCOL_GUID = EFI_GUID(0x4006c0c1, 0xfcb3, 30 0x403e, [0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d]); 31 /// Protocol Guid defined by UEFI2.1. 32 enum LOAD_FILE2_PROTOCOL = EFI_LOAD_FILE2_PROTOCOL_GUID; 33 alias EFI_LOAD_FILE2_PROTOCOL = _EFI_LOAD_FILE2_PROTOCOL; 34 /** 35 Causes the driver to load a specified file. 36 37 @param This Protocol instance pointer. 38 @param FilePath The device specific path of the file to load. 39 @param BootPolicy Should always be FALSE. 40 @param BufferSize On input the size of Buffer in bytes. On output with a return 41 code of EFI_SUCCESS, the amount of data transferred to 42 Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL, 43 the size of Buffer required to retrieve the requested file. 44 @param Buffer The memory buffer to transfer the file to. IF Buffer is NULL, 45 then no the size of the requested file is returned in 46 BufferSize. 47 48 @retval EFI_SUCCESS The file was loaded. 49 @retval EFI_UNSUPPORTED BootPolicy is TRUE. 50 @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or 51 BufferSize is NULL. 52 @retval EFI_NO_MEDIA No medium was present to load the file. 53 @retval EFI_DEVICE_ERROR The file was not loaded due to a device error. 54 @retval EFI_NO_RESPONSE The remote system did not respond. 55 @retval EFI_NOT_FOUND The file was not found 56 @retval EFI_ABORTED The file load process was manually canceled. 57 @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small to read the current 58 directory entry. BufferSize has been updated with 59 the size needed to complete the request. 60 61 62 **/ 63 alias EFI_LOAD_FILE2 = EFI_STATUS function(EFI_LOAD_FILE2_PROTOCOL* This, 64 EFI_DEVICE_PATH_PROTOCOL* FilePath, BOOLEAN BootPolicy, UINTN* BufferSize, void* Buffer) @nogc nothrow; 65 /// The EFI_LOAD_FILE_PROTOCOL is a simple protocol used to obtain files from arbitrary devices. 66 struct _EFI_LOAD_FILE2_PROTOCOL 67 { 68 EFI_LOAD_FILE2 LoadFile; 69 70 }