Specifications

Version 2.0
43
EFI_SHELL_PROTOCOL.ReadFile()
Summary
Reads data from the file.
Prototype
typedef
EFI_STATUS
(EFIAPI *EFI_SHELL_READ_FILE) (
IN EFI_FILE_HANDLE FileHandle,
IN OUT UINTN *ReadSize,
OUT VOID *Buffer
);
Parameters
FileHandle
The opened file handle for read
ReadSize
On input, the size of Buffer, in bytes. On output, the amount of data read.
Buffer
The buffer in which data is read.
Description
If FileHandle is not a directory, the function reads the requested number of bytes
from the file at the file’s current position and returns them in Buffer. If the read goes
beyond the end of the file, the read length is truncated to the end of the file. The file’s
current position is increased by the number of bytes returned.
If FileHandle is a directory, then an error is returned.
Status Codes Returned
EFI_SUCCESS Data was read.
EFI_NO_MEDIA The device has no media
EFI_DEVICE_ERROR The device reported an error
EFI_VOLUME_CORRUPTED The file system structures are corrupted
EFI_BUFFER_TO_SMALL Buffer is too small. ReadSize contains required size