Beispiel #1
0
 public RamFile(string FName)
 {
     Info.FileAttributes = (uint)FileAttributes.Normal;
     Info.ChangeTime     = WinFsp.GetFileTime();
     Info.CreationTime   = WinFsp.GetFileTime();
     Info.LastAccessTime = WinFsp.GetFileTime();
     Info.LastWriteTime  = WinFsp.GetFileTime();
     FileData            = new MemoryStream();
     FileName            = FName;
 }
Beispiel #2
0
 public RamDir(string FName)
 {
     Info.FileAttributes = MemFsSharp.FileAttirutes.FILE_ATTRIBUTE_DIRECTORY;
     Childeren           = new ConcurrentDictionary <string, FileObject>(StringComparer.OrdinalIgnoreCase);
     FileName            = FName;
     Info.ChangeTime     = WinFsp.GetFileTime();
     Info.CreationTime   = WinFsp.GetFileTime();
     Info.LastAccessTime = WinFsp.GetFileTime();
     Info.LastWriteTime  = WinFsp.GetFileTime();
 }
Beispiel #3
0
        public uint Overwrite(WinFspFileSystem FileSystem, FileOpenContext Context, uint FileAttributes, bool ReplaceFileAttributes)
        {
            if (Context.Node.UserContext == null)
            {
                return(NtStatus.STATUS_INVALID_PARAMETER);
            }
            var file = Context.Node.UserContext as FileObject;

            Trace.WriteLine($"Overwrite FileName {file.FileName} fileFound {file != null}");

            file.Info.FileSize       = 0;
            file.Info.LastAccessTime = file.Info.LastWriteTime = WinFsp.GetFileTime();
            return(NtStatus.STATUS_SUCCESS);
        }