internal static FileRecord GetFileRecord(string volume)
        {
            string volLetter = volume.Split('\\')[3];
            ulong  index     = IndexEntry.Get(volLetter + "\\$Extend\\$UsnJrnl").RecordNumber;

            return(new FileRecord(FileRecord.GetRecordBytes(volume, (int)index), volume, true));
        }
        public static AttrDef[] GetInstances(string path)
        {
            string     volume = "\\\\.\\" + path.Split('\\')[0];
            IndexEntry indx   = IndexEntry.Get(path);

            return(AttrDef.GetInstances(new FileRecord(FileRecord.GetRecordBytes(volume, (int)indx.RecordNumber), volume).GetBytes()));
        }
Exemple #3
0
        protected override void ProcessRecord()
        {
            if (this.MyInvocation.BoundParameters.ContainsKey("Index"))
            {
                NativeMethods.getVolumeName(ref volume);

                if (asbytes)
                {
                    WriteObject(FileRecord.GetRecordBytes(volume, indexNumber));
                }
                else
                {
                    WriteObject(new FileRecord(FileRecord.GetRecordBytes(volume, indexNumber), volume));
                }
            }
            else if (this.MyInvocation.BoundParameters.ContainsKey("Path"))
            {
                string volume = NativeMethods.getVolumeName(ref path.Split(':')[0]);

                IndexEntry entry = IndexEntry.Get(path);

                if (asbytes)
                {
                    WriteObject(FileRecord.GetRecordBytes(volume, (int)entry.RecordNumber));
                }
                else
                {
                    WriteObject(new FileRecord(FileRecord.GetRecordBytes(volume, (int)entry.RecordNumber), volume));
                }
            }
            else
            {
                NativeMethods.getVolumeName(ref volume);

                WriteObject(FileRecord.GetInstances(volume), true);
            }
        } // ProcessRecord
 protected override void ProcessRecord()
 {
     WriteObject(IndexEntry.Get(path).RecordNumber);
 } // ProcessRecord