DokanError IDokanOperations.OpenDirectory(string fileName, DokanFileInfo info) { SftpDrive drive = this.GetDriveByMountPoint(fileName, out fileName); LogFSActionInit("OpenDir", fileName, drive, ""); if (drive != null) { lastActiveSubsytem = drive; IDokanOperations ops = GetSubSystemOperations(drive); if (ops == null) { LogFSActionError("OpenDir", fileName, drive, "Cannot open, mount failed?"); return(DokanError.ErrorAccessDenied); } LogFSActionSuccess("OpenDir", fileName, drive, "Found, subsytem"); return(ops.OpenDirectory(fileName, info)); } lastActiveSubsytem = null; info.IsDirectory = true; if (fileName.Length == 1) //root dir { LogFSActionSuccess("OpenDir", fileName, drive, "Found, VFS root"); return(DokanError.ErrorSuccess); } string path = fileName.Substring(1);//cut leading \ foreach (SftpDrive subdrive in _subsytems) { string mp = subdrive.MountPoint; // mp1 || mp1\mp2 ... if (path == mp) { info.Context = subdrive; LogFSActionSuccess("OpenDir", fileName, drive, "Found, final mountpoint"); return(DokanError.ErrorSuccess); } if (mp.IndexOf(path + '\\') == 0) { //path is part of mount point info.Context = subdrive; LogFSActionSuccess("OpenDir", fileName, drive, "Found, part of mountpoint"); return(DokanError.ErrorSuccess); } } LogFSActionError("OpenDir", fileName, drive, "Path not found"); return(DokanError.ErrorPathNotFound); }
//// public int OpenDirectoryProxy(string rawFileName, DokanFileInfo rawFileInfo) { try { return((int)_operations.OpenDirectory(rawFileName, rawFileInfo)); } catch { #if DEBUG throw; #endif return(ERROR_INVALID_FUNCTION); } }
public DokanError OpenDirectory(string filename, DokanFileInfo info) { DokanError ret = 0; CacheEntry entry = cache_.Lookup(filename); if (entry.OpenDirectoryRet == DokanError.Undefined) { ret = ope_.OpenDirectory(filename, info); entry.OpenDirectoryRet = ret; } else { ret = entry.OpenDirectoryRet; } return(ret); }
public int OpenDirectoryProxy(IntPtr rawFileName, ref DOKAN_FILE_INFO rawFileInfo) { try { string file = GetFileName(rawFileName); DokanFileInfo info = ConvertFileInfo(ref rawFileInfo); int ret = operations.OpenDirectory(file, info); rawFileInfo.Context = info.refFileHandleContext; rawFileInfo.IsDirectory = Convert.ToByte(info.IsDirectory); return(ret); } catch (Exception ex) { Log.ErrorException("OpenDirectoryProxy threw:", ex); return(-1); } }
//// public NtStatus OpenDirectoryProxy(string rawFileName, DokanFileInfo rawFileInfo) { try { Trace("\nOpenDirectoryProxy : " + rawFileName); Trace("\tContext\t" + ToTrace(rawFileInfo)); NtStatus result = operations.OpenDirectory(rawFileName, rawFileInfo); Trace("OpenDirectoryProxy : " + rawFileName + " Return : " + result); return(result); } #pragma warning disable 0168 catch (Exception ex) #pragma warning restore 0168 { Trace("OpenDirectoryProxy : " + rawFileName + " Throw : " + ex.Message); return(DokanResult.InvalidParameter); } }