/* Get a directory entry from disk for the Ofile. */
STATIC EFI_STATUS FatAccessEntry(IN FAT_OFILE *Parent, IN IO_MODE IoMode, IN UINTN EntryPos, IN OUT VOID *Entry)
/* Get a directory entry from disk for the Ofile. */
STATIC EFI_STATUS FatAccessEntry(IN FAT_OFILE *Parent, IN IO_MODE IoMode, IN UINTN EntryPos, IN OUT VOID *Entry)
{
  UINTN  Position;
  UINTN  BufferSize;
  Position = EntryPos * sizeof (FAT_DIRECTORY_ENTRY);
  if (Position >= Parent->FileSize) {
    ASSERT (IoMode == ReadData);
    ((FAT_DIRECTORY_ENTRY *)Entry)->FileName[0] = EMPTY_ENTRY_MARK;
    ((FAT_DIRECTORY_ENTRY *)Entry)->Attributes  = 0;
    return EFI_SUCCESS;
  }
  BufferSize = sizeof (FAT_DIRECTORY_ENTRY);
  return FatAccessOFile (Parent, IoMode, Position, &BufferSize, Entry, NULL);
}