/* Implements Simple File System Protocol interface function OpenVolume(). */
EFI_STATUS EFIAPI FatOpenVolume(IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **File)
/* Implements Simple File System Protocol interface function OpenVolume(). */
EFI_STATUS EFIAPI FatOpenVolume(IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **File)
{
  EFI_STATUS  Status;
  FAT_VOLUME  *Volume;
  FAT_IFILE   *IFile;
  Volume = VOLUME_FROM_VOL_INTERFACE (This);
  FatAcquireLock ();
  Status = FatOpenDirEnt (NULL, &Volume->RootDirEnt);
  if (EFI_ERROR (Status)) {
    goto Done;
  }
  Status = FatAllocateIFile (Volume->Root, &IFile);
  if (!EFI_ERROR (Status)) {
    *File = &IFile->Handle;
  }
Done:
  Status = FatCleanupVolume (Volume, Volume->Root, Status, NULL);
  FatReleaseLock ();
  return Status;
}