• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Dokan.DOKAN_FILE_INFO类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: FindFilesWithPatternProxy

        public int FindFilesWithPatternProxy(
            IntPtr rawFileName,
			IntPtr rawSearchPattern,
            IntPtr rawFillFindData, // function pointer
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            try
            {
                string file = GetFileName(rawFileName);
                string searchPattern = GetFileName(rawSearchPattern);
                var files = operations_.FindFilesWithPattern(file, searchPattern, GetFileInfo(ref rawFileInfo));

                FILL_FIND_DATA fill = (FILL_FIND_DATA)Marshal.GetDelegateForFunctionPointer(
                    rawFillFindData, typeof(FILL_FIND_DATA));

                foreach (var fi in files)
                {
                    var data = new WIN32_FIND_DATA();
                    //ZeroMemory(&data, sizeof(WIN32_FIND_DATAW));

                    data.dwFileAttributes = fi.Attributes;

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

                    data.cFileName = fi.FileName;

                    fill(ref data, ref rawFileInfo);
                }

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


示例17: GetFileInformationProxy

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

                FileInformation fi = new FileInformation();

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

                if (ret == 0)
                {
                    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 ret;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }

        }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:49,代码来源:Proxy.cs


示例18: SetFileSecurity

 public int SetFileSecurity(
     IntPtr rawFileName,
     ref SECURITY_INFORMATION rawSecurityInformation,
     ref SECURITY_DESCRIPTOR rawSecurityDescriptor,
     ref uint rawSecurityDescriptorLengthNeeded,
     ref DOKAN_FILE_INFO rawFileInfo)
 {
     return -1;
 }
开发者ID:soywiz,项目名称:dokan-ramdisk,代码行数:9,代码来源:Proxy.cs


示例19: FindFilesProxy

        public int FindFilesProxy(
            IntPtr rawFileName,
            IntPtr rawFillFindData, // function pointer
            ref DOKAN_FILE_INFO rawFileInfo)
        {
            String S;
            try
            {
                string file = GetFileName(rawFileName);

                ArrayList files = new ArrayList();
                int ret = operations_.FindFiles(file, files, GetFileInfo(ref rawFileInfo));

                FILL_FIND_DATA fill = (FILL_FIND_DATA)Marshal.GetDelegateForFunctionPointer(
                    rawFillFindData, typeof(FILL_FIND_DATA));

                if (ret == 0)
                {
                    IEnumerator entry = files.GetEnumerator();
                    while (entry.MoveNext())
                    {
                        FileInformation fi = (FileInformation)(entry.Current);
                        S = fi.FileName;
                        WIN32_FIND_DATA data = new WIN32_FIND_DATA();
                        //ZeroMemory(&data, sizeof(WIN32_FIND_DATAW));

                        data.dwFileAttributes = fi.Attributes;

                        data.ftCreationTime.dwHighDateTime =
                            (int)(fi.CreationTime.ToFileTime() >> 32);
                        data.ftCreationTime.dwLowDateTime =
                            (int)(fi.CreationTime.ToFileTime() & 0xffffffff);

                        data.ftLastAccessTime.dwHighDateTime =
                            (int)(fi.LastAccessTime.ToFileTime() >> 32);
                        data.ftLastAccessTime.dwLowDateTime =
                            (int)(fi.LastAccessTime.ToFileTime() & 0xffffffff);

                        data.ftLastWriteTime.dwHighDateTime =
                            (int)(fi.LastWriteTime.ToFileTime() >> 32);
                        data.ftLastWriteTime.dwLowDateTime =
                            (int)(fi.LastWriteTime.ToFileTime() & 0xffffffff);

                        data.nFileSizeLow =
                            (uint)(fi.Length & 0xffffffff);
                        data.nFileSizeHigh =
                            (uint)(fi.Length >> 32);

                        data.cFileName = fi.FileName;

                        fill(ref data, ref rawFileInfo);
                    }

                }
                return ret;

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                return -1;
            }

        }
开发者ID:cristhiand3,项目名称:mssqlfs,代码行数:64,代码来源:Proxy.cs


示例20: DeleteDirectoryProxy

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

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Dokan.DokanFileInfo类代码示例发布时间:2022-05-24
下一篇:
C# Validation.ValidationContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap