loadfil.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*++
  2. Copyright (c) 2014 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. loadfil.h
  5. Abstract:
  6. This header contains the definition of the EFI Load File Protocol.
  7. Author:
  8. Evan Green 13-Mar-2014
  9. --*/
  10. //
  11. // ------------------------------------------------------------------- Includes
  12. //
  13. //
  14. // ---------------------------------------------------------------- Definitions
  15. //
  16. #define EFI_LOAD_FILE_PROTOCOL_GUID \
  17. { \
  18. 0x56EC3091, 0x954C, 0x11D2, \
  19. {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} \
  20. }
  21. //
  22. // Protocol GUID as defined by EFI1.1
  23. //
  24. #define LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL_GUID
  25. //
  26. // ------------------------------------------------------ Data Type Definitions
  27. //
  28. typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL;
  29. //
  30. // EFI1.1 type definition
  31. //
  32. typedef EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_INTERFACE;
  33. //
  34. // -------------------------------------------------------------------- Globals
  35. //
  36. typedef
  37. EFI_STATUS
  38. (EFIAPI *EFI_LOAD_FILE)(
  39. EFI_LOAD_FILE_PROTOCOL *This,
  40. EFI_DEVICE_PATH_PROTOCOL *FilePath,
  41. BOOLEAN BootPolicy,
  42. UINTN *BufferSize,
  43. VOID *Buffer
  44. );
  45. /*++
  46. Routine Description:
  47. This routine loads an EFI file into memory.
  48. Arguments:
  49. This - Supplies the protocol instance.
  50. FilePath - Supplies a pointer to the device path of the file to load.
  51. BootPolity - Supplies a boolean indicating whether or not the request
  52. originates from the boot manager and is attempting to load a boot
  53. selection. If FALSE, then the file path must match as the exact file
  54. to be loaded.
  55. BufferSize - Supplies a pointer that on input contains the size of the
  56. supplied buffer. On output, returns the size of the file buffer.
  57. Buffer - Supplies the buffer to load the file contents into.
  58. Return Value:
  59. EFI_SUCCESS if a file was loaded.
  60. EFI_UNSUPPORTED if the device does not support the provided boot policy.
  61. EFI_INVALID_PARAMETER if the file path is not a valid device path, or the
  62. buffer size was NULL.
  63. EFI_NO_MEDIA if no medium was present.
  64. EFI_NO_RESPONSE if the remote system did not respond.
  65. EFI_NOT_FOUND if the file was not found.
  66. EFI_ABORTED if the file load process was manually cancel.ed.
  67. --*/
  68. /*++
  69. Structure Description:
  70. This structure defines the EFI load file protocol. It is used to obtain
  71. files from arbitrary devices.
  72. Members:
  73. LoadFile - Stores a pointer to a function used to load a file from the
  74. device.
  75. --*/
  76. struct _EFI_LOAD_FILE_PROTOCOL {
  77. EFI_LOAD_FILE LoadFile;
  78. };
  79. //
  80. // -------------------------------------------------------- Function Prototypes
  81. //