Esempio n. 1
0
File: Backup.cs Progetto: 0-F/Backup
        public void Do_Backup()
        {
            Init_Volume();

            _LastJournal = Vol.Refresh();
            Vol.Map_Volume();
            Vol.Update(_LastJournal);
            var r = Vol.GetDirectory(SourcePath);

            if(r != null)
            {
                var dst = DestnationPath + "\\test_" + Increment.ToString();

                var src = "";
                if(Increment == 0)
                {
                    src = dst;
                } else
                {
                    src = DestnationPath + "\\test_" + (Increment - 1).ToString();
                }

                r.CopyTo(dst, src);
            }
            Increment += 1;
        }
Esempio n. 2
0
        public Win32Api.USN_JOURNAL_DATA Refresh()
        {
            var old = _Current_JournalState;

            _Current_JournalState = new Win32Api.USN_JOURNAL_DATA();
            NTFS_Volume.NTFS_Functions.QueryUsnJournal(_Root_Handle, ref _Current_JournalState);//need to query the jounral to get the first usn number
            return(old);
        }
Esempio n. 3
0
 public NTFSVolume(string drive, Win32Api.USN_JOURNAL_DATA lastusn)
 {
     var rootpath = new DriveInfo(drive);
     _Root_Handle = NTFS_Volume.NTFS_Functions.GetRootHandle(rootpath);
     _Root = new Volume.NTFS_File(new Win32Api.UsnEntry(rootpath.Name.Replace("\\", "")));
     Lookup = new Dictionary<ulong, Journal.Volume.NTFS_File>();
     _Current_JournalState = lastusn;
 }
Esempio n. 4
0
        public NTFSVolume(string drive, Win32Api.USN_JOURNAL_DATA lastusn)
        {
            var rootpath = new DriveInfo(drive);

            _Root_Handle          = NTFS_Volume.NTFS_Functions.GetRootHandle(rootpath);
            _Root                 = new Volume.NTFS_File(new Win32Api.UsnEntry(rootpath.Name.Replace("\\", "")));
            Lookup                = new Dictionary <ulong, Journal.Volume.NTFS_File>();
            _Current_JournalState = lastusn;
        }
Esempio n. 5
0
 public NTFSVolume(string drive)
 {
     var rootpath = new DriveInfo(drive);
     _Root_Handle = NTFS_Volume.NTFS_Functions.GetRootHandle(rootpath);
     _Root = new Volume.NTFS_File(new Win32Api.UsnEntry(rootpath.Name.Replace("\\", "")));
     _Current_JournalState = new Win32Api.USN_JOURNAL_DATA();
     Lookup = new Dictionary<ulong, Journal.Volume.NTFS_File>();
     NTFS_Volume.NTFS_Functions.QueryUsnJournal(_Root_Handle, ref _Current_JournalState);//need to query the jounral to get the first usn number
 }
Esempio n. 6
0
        public NTFSVolume(string drive)
        {
            var rootpath = new DriveInfo(drive);

            _Root_Handle          = NTFS_Volume.NTFS_Functions.GetRootHandle(rootpath);
            _Root                 = new Volume.NTFS_File(new Win32Api.UsnEntry(rootpath.Name.Replace("\\", "")));
            _Current_JournalState = new Win32Api.USN_JOURNAL_DATA();
            Lookup                = new Dictionary <ulong, Journal.Volume.NTFS_File>();
            NTFS_Volume.NTFS_Functions.QueryUsnJournal(_Root_Handle, ref _Current_JournalState);//need to query the jounral to get the first usn number
        }
Esempio n. 7
0
        public List <Journal.Volume.NTFS_File> Update(Win32Api.USN_JOURNAL_DATA last)
        {
            var files   = new List <Journal.Volume.NTFS_File>();
            var changes = NTFS_Volume.NTFS_Functions.Get_Changes(_Root_Handle, last);

            foreach (var item in changes)
            {
                Journal.Volume.NTFS_File found = null;
                Lookup.TryGetValue(item.FileReferenceNumber, out found);
                if (found != null)
                {
                    Update((Journal.Volume.NTFS_File)found, item);
                }
            }
            return(files);
        }
Esempio n. 8
0
 public Win32Api.USN_JOURNAL_DATA Refresh()
 {
     var old = _Current_JournalState;
     _Current_JournalState = new Win32Api.USN_JOURNAL_DATA();
     NTFS_Volume.NTFS_Functions.QueryUsnJournal(_Root_Handle, ref _Current_JournalState);//need to query the jounral to get the first usn number
     return old;
 }