Example #1
0
        public void Cleanup(string fileName, DokanFileInfo info)
        {
            LayeredContext context = info.Context as LayeredContext;

            if (info != null)
            {
                if (info.DeleteOnClose)
                {
                    context.Delete();
                }

                context.Dispose();
            }
        }
Example #2
0
        public NtStatus GetFileInformation(string fileName, out FileInformation fileInfo, DokanFileInfo info)
        {
            LayeredContext context = info.Context as LayeredContext;

            if (context == null)
            {
                fileInfo = new FileInformation();
                return(DokanResult.InvalidHandle);
            }
            else
            {
                fileInfo = context.GetFileInformation();
                // fileInfo.FileName = Path.GetFileName(fileName);
                fileInfo.FileName = fileName;
                return(DokanResult.Success);
            }
        }
Example #3
0
        public NtStatus GetFileSecurity(string fileName, out FileSystemSecurity security, AccessControlSections sections, DokanFileInfo info)
        {
            security = null;

            LayeredContext context = info.Context as LayeredContext;

            if (context == null)
            {
                return(DokanResult.InvalidHandle);
            }

            try
            {
                security = context.GetFileSystemSecurity();
                return(DokanResult.Success);
            }
            catch (UnauthorizedAccessException)
            {
                return(DokanResult.AccessDenied);
            }
        }