当前位置: 首页>>代码示例>>C#>>正文


C# Dokan.DOKAN_FILE_INFO类代码示例

本文整理汇总了C#中Dokan.DOKAN_FILE_INFO的典型用法代码示例。如果您正苦于以下问题:C# DOKAN_FILE_INFO类的具体用法?C# DOKAN_FILE_INFO怎么用?C# DOKAN_FILE_INFO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DOKAN_FILE_INFO类属于Dokan命名空间,在下文中一共展示了DOKAN_FILE_INFO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConvertFileInfo

 private void ConvertFileInfo(ref DOKAN_FILE_INFO rawInfo, DokanFileInfo info)
 {
     info.IsDirectory = rawInfo.IsDirectory == 1;
     info.ProcessId = rawInfo.ProcessId;
     info.PagingIo = rawInfo.PagingIo == 1;
     info.DeleteOnClose = rawInfo.DeleteOnClose == 1;
     info.SynchronousIo = rawInfo.SynchronousIo == 1;
     info.Nocache = rawInfo.Nocache == 1;
     info.WriteToEndOfFile = rawInfo.WriteToEndOfFile == 1;
 }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:10,代码来源:Proxy.cs

示例2: GetNewFileInfo

        private DokanFileInfo GetNewFileInfo(ref DOKAN_FILE_INFO rawFileInfo)
        {
            DokanFileInfo fileInfo = new DokanFileInfo(rawFileInfo.DokanContext);

            lock (infoTableLock_)
            {
                fileInfo.InfoId = ++infoId_;

                rawFileInfo.Context = fileInfo.InfoId;
                ConvertFileInfo(ref rawFileInfo, fileInfo);
                // to avoid GC
                infoTable_[fileInfo.InfoId] = fileInfo;
            }
            return fileInfo;
        }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:15,代码来源:Proxy.cs

示例3: GetFileInfo

        private DokanFileInfo GetFileInfo(ref DOKAN_FILE_INFO rawFileInfo)
        {
            DokanFileInfo fileInfo = null;
            lock (infoTableLock_)
            {
                if (rawFileInfo.Context != 0)
                {
                    infoTable_.TryGetValue(rawFileInfo.Context, out fileInfo);
                }

                if (fileInfo == null)
                {
                    // bug?
                    fileInfo = new DokanFileInfo(rawFileInfo.DokanContext);
                }
                ConvertFileInfo(ref rawFileInfo, fileInfo);
            }
            return fileInfo;
        }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:19,代码来源:Proxy.cs

示例4: WriteFileProxy

        public int WriteFileProxy(
            IntPtr rawFileName,
            IntPtr rawBuffer,
            uint rawNumberOfBytesToWrite,
            ref uint rawNumberOfBytesWritten,
            long rawOffset,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);

                Byte[] buf = new Byte[rawNumberOfBytesToWrite];
                Marshal.Copy(rawBuffer, buf, 0, (int)rawNumberOfBytesToWrite);

                uint bytesWritten = 0;
                int ret = operations_.WriteFile(
                    file, buf, ref bytesWritten, rawOffset, GetFileInfo(ref rawFileInfo));
                if (ret == 0)
                    rawNumberOfBytesWritten = bytesWritten;
                return ret;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:29,代码来源:Proxy.cs

示例5: FlushFileBuffersProxy

        public int FlushFileBuffersProxy(
            IntPtr rawFileName,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);
                int ret = operations_.FlushFileBuffers(file, GetFileInfo(ref rawFileInfo));
                return ret;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:17,代码来源:Proxy.cs

示例6: GetVolumeInformationProxy

        public int GetVolumeInformationProxy(
            IntPtr rawVolumeNameBuffer,
            uint rawVolumeNameSize,
            ref uint rawVolumeSerialNumber,
            ref uint rawMaximumComponentLength,
            ref uint rawFileSystemFlags,
            IntPtr rawFileSystemNameBuffer,
            uint rawFileSystemNameSize,
            ref DOKAN_FILE_INFO FileInfo)
        {
            byte[] volume = System.Text.Encoding.Unicode.GetBytes(options_.VolumeLabel);
            Marshal.Copy(volume, 0, rawVolumeNameBuffer, Math.Min((int)rawVolumeNameSize, volume.Length));
            rawVolumeSerialNumber = 0x19831116;
            rawMaximumComponentLength = 256;

            // FILE_CASE_SENSITIVE_SEARCH | 
            // FILE_CASE_PRESERVED_NAMES |
            // FILE_UNICODE_ON_DISK
            rawFileSystemFlags = 7;

            byte[] sys = System.Text.Encoding.Unicode.GetBytes("DOKAN");
            Marshal.Copy(sys, 0, rawFileSystemNameBuffer, Math.Min((int)rawFileSystemNameSize, sys.Length));
            return DokanNet.DOKAN_SUCCESS;
        }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:24,代码来源:Proxy.cs

示例7: DokanResetTimeout

 public static extern bool DokanResetTimeout(uint timeout, ref DOKAN_FILE_INFO rawFileInfo);
开发者ID:soywiz,项目名称:csharputils,代码行数:1,代码来源:DokanNet.cs

示例8: SetFileTimeProxy

        public int SetFileTimeProxy(
            IntPtr rawFileName,
            ref ComTypes.FILETIME rawCreationTime,
            ref ComTypes.FILETIME rawLastAccessTime,
            ref ComTypes.FILETIME rawLastWriteTime,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);

                long time;

                time = ((long)rawCreationTime.dwHighDateTime << 32) + (uint)rawCreationTime.dwLowDateTime;
                DateTime ctime = DateTime.FromFileTime(time);
                
                if (time == 0)
                    ctime = DateTime.MinValue;

                time = ((long)rawLastAccessTime.dwHighDateTime << 32) + (uint)rawLastAccessTime.dwLowDateTime;
                DateTime atime = DateTime.FromFileTime(time);

                if (time == 0)
                    atime = DateTime.MinValue;

                time = ((long)rawLastWriteTime.dwHighDateTime << 32) + (uint)rawLastWriteTime.dwLowDateTime;
                DateTime mtime = DateTime.FromFileTime(time);

                if (time == 0)
                    mtime = DateTime.MinValue;

                return operations_.SetFileTime(
                    file, ctime, atime, mtime, GetFileInfo(ref rawFileInfo));

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:41,代码来源:Proxy.cs

示例9: DeleteDirectoryProxy

 public int DeleteDirectoryProxy(
     IntPtr rawFileName,
     ref DOKAN_FILE_INFO rawFileInfo)
 {
     var FileInfo = GetFileInfo(ref rawFileInfo);
     return HandleExceptions(() =>
     {
         string file = GetFileName(rawFileName);
         operations_.DeleteDirectory(file, FileInfo);
     });
 }
开发者ID:soywiz,项目名称:dokan-ramdisk,代码行数:11,代码来源:Proxy.cs

示例10: SetAllocationSizeProxy

        public int SetAllocationSizeProxy(IntPtr rawFileName, long rawLength, ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);

                operations_.SetAllocationSize(file, rawLength, GetFileInfo(ref rawFileInfo));
                return 0;
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:soywiz,项目名称:dokan-ramdisk,代码行数:15,代码来源:Proxy.cs

示例11: CleanupProxy

        public int CleanupProxy(
            IntPtr rawFileName,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);
                operations_.Cleanup(file, GetFileInfo(ref rawFileInfo));
                return 0;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:soywiz,项目名称:dokan-ramdisk,代码行数:17,代码来源:Proxy.cs

示例12: OpenDirectoryProxy

        public int OpenDirectoryProxy(
            IntPtr rawFileName,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);

                DokanFileInfo info = GetNewFileInfo(ref rawFileInfo);
                operations_.OpenDirectory(file, info);

                return 0;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:soywiz,项目名称:dokan-ramdisk,代码行数:20,代码来源:Proxy.cs

示例13: ReadFileProxy

        public int ReadFileProxy(
            IntPtr rawFileName,
            IntPtr rawBuffer,
            uint rawBufferLength,
            ref uint rawReadLength,
            long rawOffset,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);

                byte[] buf = new Byte[rawBufferLength];

                var Stream = ((IDokanFile)(GetFileInfo(ref rawFileInfo).Context)).Stream;

                Stream.Position = rawOffset;
                rawReadLength = (uint)Stream.Read(buf, 0, (int)rawBufferLength);
                Marshal.Copy(buf, 0, rawBuffer, (int)rawBufferLength);
                return 0;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:soywiz,项目名称:dokan-ramdisk,代码行数:28,代码来源:Proxy.cs

示例14: GetFileInformationProxy

        public int GetFileInformationProxy(
            IntPtr rawFileName,
            ref BY_HANDLE_FILE_INFORMATION rawHandleFileInformation,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);

                var fi = operations_.GetFileInformation(file, GetFileInfo(ref rawFileInfo));

                rawHandleFileInformation.dwFileAttributes = (uint)fi.Attributes;

                rawHandleFileInformation.ftCreationTime.dwHighDateTime = (int)(fi.CreationTime.ToFileTime() >> 32);
                rawHandleFileInformation.ftCreationTime.dwLowDateTime = (int)(fi.CreationTime.ToFileTime() & 0xffffffff);
                rawHandleFileInformation.ftLastAccessTime.dwHighDateTime = (int)(fi.LastAccessTime.ToFileTime() >> 32);
                rawHandleFileInformation.ftLastAccessTime.dwLowDateTime = (int)(fi.LastAccessTime.ToFileTime() & 0xffffffff);
                rawHandleFileInformation.ftLastWriteTime.dwHighDateTime = (int)(fi.LastWriteTime.ToFileTime() >> 32);
                rawHandleFileInformation.ftLastWriteTime.dwLowDateTime = (int)(fi.LastWriteTime.ToFileTime() & 0xffffffff);
                rawHandleFileInformation.nFileSizeLow = (uint)(fi.Length & 0xffffffff);
                rawHandleFileInformation.nFileSizeHigh = (uint)(fi.Length >> 32);

                return 0;

            }
            catch (FileNotFoundException e)
            {
                return DokanNet.ERROR_FILE_NOT_FOUND;
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:soywiz,项目名称:dokan-ramdisk,代码行数:35,代码来源:Proxy.cs

示例15: FlushFileBuffersProxy

        public int FlushFileBuffersProxy(
            IntPtr rawFileName,
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);
                ((IDokanFile)GetFileInfo(ref rawFileInfo).Context).Stream.Flush();
                return 0;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }
        }
开发者ID:soywiz,项目名称:dokan-ramdisk,代码行数:17,代码来源:Proxy.cs


注:本文中的Dokan.DOKAN_FILE_INFO类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。