/* Determine if a directory has no files in it. */
BOOLEAN IsDirectoryEmpty(IN SHELL_FILE_HANDLE FileHandle)
/* Determine if a directory has no files in it. */
BOOLEAN IsDirectoryEmpty(IN SHELL_FILE_HANDLE FileHandle)
{
  EFI_STATUS     Status;
  EFI_FILE_INFO  *FileInfo;
  BOOLEAN        NoFile;
  BOOLEAN        RetVal;
  RetVal   = TRUE;
  NoFile   = FALSE;
  FileInfo = NULL;
  for (Status = FileHandleFindFirstFile (FileHandle, &FileInfo)
       ; !NoFile && !EFI_ERROR (Status)
       ; FileHandleFindNextFile (FileHandle, FileInfo, &NoFile)
       )
  {
    if (  (StrStr (FileInfo->FileName, L".") != FileInfo->FileName)
       && (StrStr (FileInfo->FileName, L"..") != FileInfo->FileName))
    {
      RetVal = FALSE;
    }
  }
  return (RetVal);
}