Exemple #1
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();
 }
Exemple #2
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;
 }
Exemple #3
0
 private void InitFsp()
 {
     Fsp                      = new WinFsp(Config, this, null, null);
     FsVolumeInfo             = new VolInfo();
     FsVolumeInfo.FreeSize    = (ulong)1024 * 1024 * 1024 * 10;
     FsVolumeInfo.TotalSize   = (ulong)1024 * 1024 * 1024 * 10;
     FsVolumeInfo.VolumeLable = "InfyCloud";
     rootDirectory            = new RamDir("\\");
     _fileObjects.TryAdd("\\", rootDirectory);
     _fileObjects.TryAdd("", rootDirectory);
 }
Exemple #4
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);
        }