/* Seek a file and read its data into memory on an UDF volume. */
EFI_STATUS ReadFileData(IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN UDF_VOLUME_INFO *Volume, IN UDF_FILE_INFO *File, IN UINT64 FileSize, IN OUT UINT64 *FilePosition, IN OUT VOID *Buffer, IN OUT UINT64 *BufferSize)
/* Seek a file and read its data into memory on an UDF volume. */
EFI_STATUS ReadFileData(IN EFI_BLOCK_IO_PROTOCOL *BlockIo, IN EFI_DISK_IO_PROTOCOL *DiskIo, IN UDF_VOLUME_INFO *Volume, IN UDF_FILE_INFO *File, IN UINT64 FileSize, IN OUT UINT64 *FilePosition, IN OUT VOID *Buffer, IN OUT UINT64 *BufferSize)
{
  EFI_STATUS          Status;
  UDF_READ_FILE_INFO  ReadFileInfo;
  ReadFileInfo.Flags        = ReadFileSeekAndRead;
  ReadFileInfo.FilePosition = *FilePosition;
  ReadFileInfo.FileData     = Buffer;
  ReadFileInfo.FileDataSize = *BufferSize;
  ReadFileInfo.FileSize     = FileSize;
  Status = ReadFile (
             BlockIo,
             DiskIo,
             Volume,
             &File->FileIdentifierDesc->Icb,
             File->FileEntry,
             &ReadFileInfo
             );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  *BufferSize   = ReadFileInfo.FileDataSize;
  *FilePosition = ReadFileInfo.FilePosition;
  return EFI_SUCCESS;
}