public void Cleanup(string fileName, DokanFileInfo info) { LayeredContext context = info.Context as LayeredContext; if (info != null) { if (info.DeleteOnClose) { context.Delete(); } context.Dispose(); } }
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); } }
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); } }