TianoCore EDK2 master
Loading...
Searching...
No Matches
EfiFileLib.h
Go to the documentation of this file.
1
32#ifndef __EFI_FILE_LIB_H__
33#define __EFI_FILE_LIB_H__
34
35#include <PiDxe.h>
38#include <Protocol/BlockIo.h>
39#include <Protocol/LoadFile.h>
40#include <Protocol/LoadFile.h>
42#include <Guid/FileInfo.h>
43#include <Guid/FileSystemInfo.h>
44
45#define MAX_PATHNAME 0x200
46
48typedef enum {
49 EfiOpenLoadFile,
50 EfiOpenMemoryBuffer,
51 EfiOpenFirmwareVolume,
52 EfiOpenFileSystem,
53 EfiOpenBlockIo,
54 EfiOpenTftp,
55 EfiOpenMaxValue
57
59typedef struct {
60 UINTN Version; // Common information
62 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
63 EFI_STATUS LastError;
64 EFI_HANDLE EfiHandle;
65 CHAR8 *DeviceName;
66 CHAR8 *FileName;
67
68 UINT64 CurrentPosition; // Information for Seek
69 UINT64 MaxPosition;
70
71 UINTN BaseOffset; // Base offset for hexdump command
72
73 UINTN Size; // Valid for all types other than l#:
74 UINT8 *Buffer; // Information valid for A#:
75
76 EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv; // Information valid for Fv#:
77 EFI_GUID FvNameGuid;
78 EFI_SECTION_TYPE FvSectionType;
79 EFI_FV_FILETYPE FvType;
80 EFI_FV_FILE_ATTRIBUTES FvAttributes;
81
83 UINTN FvSize;
84 UINTN FvHeaderSize;
85
86 EFI_FILE *FsFileHandle; // Information valid for Fs#:
88 EFI_FILE_INFO *FsFileInfo;
89 EFI_BLOCK_IO_MEDIA *FsBlockIoMedia; // Information valid for Fs#: or B#:
90 EFI_BLOCK_IO_PROTOCOL *FsBlockIo; // Information valid for Fs#: or B#:
91
92 UINTN DiskOffset; // Information valid for B#:
93
94 EFI_LOAD_FILE_PROTOCOL *LoadFile; // Information valid for l#:
95
96 EFI_IP_ADDRESS ServerIp; // Information valid for t:
97 BOOLEAN IsDirty;
98 BOOLEAN IsBufferValid;
100
102typedef enum {
103 EfiSeekStart,
104 EfiSeekCurrent,
105 EfiSeekEnd,
106 EfiSeekMax
108
130 IN CHAR8 *PathName,
131 IN CONST UINT64 OpenMode,
132 IN CONST EFI_SECTION_TYPE SectionType
133 );
134
136EfiCopyFile (
137 IN CHAR8 *DestinationFile,
138 IN CHAR8 *SourceFile
139 );
140
153 IN EFI_OPEN_FILE_TYPE DeviceType,
154 IN UINTN Index
155 );
156
169 IN EFI_OPEN_FILE *Stream
170 );
171
182UINTN
184 IN EFI_OPEN_FILE *Stream,
185 OUT UINT64 *CurrentPosition OPTIONAL
186 );
187
211 IN EFI_OPEN_FILE *Stream,
212 IN EFI_LBA Offset,
213 IN EFI_SEEK_TYPE SeekType
214 );
215
234 IN EFI_OPEN_FILE *Stream,
235 OUT VOID *Buffer,
236 OUT UINTN *BufferSize
237 );
238
260 IN EFI_OPEN_FILE *Stream,
261 OUT VOID **Buffer,
262 OUT UINTN *BufferSize
263 );
264
282 IN EFI_OPEN_FILE *Stream,
283 OUT VOID *Buffer,
284 OUT UINTN *BufferSize
285 );
286
295UINTN
298 );
299
313 IN CHAR8 *Cwd
314 );
315
327CHAR8 *
329 VOID
330 );
331
332#endif
UINT64 UINTN
EFI_SEEK_TYPE
Type of Seek to perform.
Definition: EfiFileLib.h:102
EFI_STATUS EfiSetCwd(IN CHAR8 *Cwd)
EFI_STATUS EfiRead(IN EFI_OPEN_FILE *Stream, OUT VOID *Buffer, OUT UINTN *BufferSize)
EFI_STATUS EfiReadAllocatePool(IN EFI_OPEN_FILE *Stream, OUT VOID **Buffer, OUT UINTN *BufferSize)
EFI_OPEN_FILE_TYPE
Type of the file that has been opened.
Definition: EfiFileLib.h:48
EFI_STATUS EfiWrite(IN EFI_OPEN_FILE *Stream, OUT VOID *Buffer, OUT UINTN *BufferSize)
UINTN EfiGetDeviceCounts(IN EFI_OPEN_FILE_TYPE Type)
EFI_OPEN_FILE * EfiOpen(IN CHAR8 *PathName, IN CONST UINT64 OpenMode, IN CONST EFI_SECTION_TYPE SectionType)
EFI_STATUS EfiSeek(IN EFI_OPEN_FILE *Stream, IN EFI_LBA Offset, IN EFI_SEEK_TYPE SeekType)
EFI_OPEN_FILE * EfiDeviceOpenByType(IN EFI_OPEN_FILE_TYPE DeviceType, IN UINTN Index)
EFI_STATUS EfiClose(IN EFI_OPEN_FILE *Stream)
UINTN EfiTell(IN EFI_OPEN_FILE *Stream, OUT UINT64 *CurrentPosition OPTIONAL)
CHAR8 * EfiGetCwd(VOID)
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT32 EFI_FV_FILE_ATTRIBUTES
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
UINT64 EFI_LBA
Definition: UefiBaseType.h:45
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
Public information about the open file.
Definition: EfiFileLib.h:59
Definition: Base.h:213