コード例 #1
0
        public NtStatus GetFileInformation(Path path, out FileInformation fileInfo, IDokanFileInfo info)
        {
            fileInfo = default;
            return(path switch
            {
                // Dirs
                RootPath p => GetFileInformation(p, out fileInfo),
                DatabasePath p => GetFileInformation(p, out fileInfo),
                CollectionPath p => GetFileInformation(p, out fileInfo),
                DataDirectoryPath p => GetFileInformation(p, out fileInfo),
                QueryDirectoryPath p => GetFileInformation(p, out fileInfo),
                QueryEmptyDirectoryPath p => GetFileInformation(p, out fileInfo),

                // Files
                StatsPath p => GetFileInformation(p, out fileInfo),
                IndexesPath p => GetFileInformation(p, out fileInfo),
                CurrentOpPath p => GetFileInformation(p, out fileInfo),
                ServerStatusPath p => GetFileInformation(p, out fileInfo),
                BuildInfoPath p => GetFileInformation(p, out fileInfo),
                HostInfoPath p => GetFileInformation(p, out fileInfo),
                ListCommandsPath p => GetFileInformation(p, out fileInfo),
                DataDocumentPath p => GetFileInformation(p, out fileInfo),
                QueryDocumentPath p => GetFileInformation(p, out fileInfo),
                QueryAllDocumentsPath p => GetFileInformation(p, out fileInfo),

                var p => LogFailure(p)
            });
コード例 #2
0
 public NtStatus ReadFile(Path path, byte[] buffer, out int bytesRead, long offset, IDokanFileInfo info)
 {
     bytesRead = 0;
     return(path switch
     {
         IndexesPath p => ReadFile(p, buffer, out bytesRead, offset),
         StatsPath p => ReadFile(p, buffer, out bytesRead, offset),
         CurrentOpPath p => ReadFile(p, buffer, out bytesRead, offset),
         ServerStatusPath p => ReadFile(p, buffer, out bytesRead, offset),
         BuildInfoPath p => ReadFile(p, buffer, out bytesRead, offset),
         HostInfoPath p => ReadFile(p, buffer, out bytesRead, offset),
         ListCommandsPath p => ReadFile(p, buffer, out bytesRead, offset),
         DataDocumentPath p => ReadFile(p, buffer, out bytesRead, offset),
         QueryDocumentPath p => ReadFile(p, buffer, out bytesRead, offset),
         QueryAllDocumentsPath p => ReadFile(p, buffer, out bytesRead, offset),
         QueryDirectoryPath p => ReadFile(p, buffer, out bytesRead, offset),
         var p => LogFailure(p)
     });