mirror of
https://github.com/ReneLergner/WPinternals.git
synced 2026-06-20 06:10:15 +10:00
Code cleanup
This commit is contained in:
@@ -27,25 +27,25 @@ namespace DiscUtils.Ntfs
|
||||
|
||||
internal enum AttributeCollationRule : int
|
||||
{
|
||||
Binary = 0x00000000,
|
||||
Filename = 0x00000001,
|
||||
UnicodeString = 0x00000002,
|
||||
UnsignedLong = 0x00000010,
|
||||
Sid = 0x00000011,
|
||||
SecurityHash = 0x00000012,
|
||||
Binary = 0x00000000,
|
||||
Filename = 0x00000001,
|
||||
UnicodeString = 0x00000002,
|
||||
UnsignedLong = 0x00000010,
|
||||
Sid = 0x00000011,
|
||||
SecurityHash = 0x00000012,
|
||||
MultipleUnsignedLongs = 0x00000013
|
||||
}
|
||||
|
||||
[Flags]
|
||||
internal enum AttributeTypeFlags : int
|
||||
{
|
||||
None = 0x00,
|
||||
Indexed = 0x02,
|
||||
Multiple = 0x04,
|
||||
NotZero = 0x08,
|
||||
IndexedUnique = 0x10,
|
||||
NamedUnique = 0x20,
|
||||
MustBeResident = 0x40,
|
||||
None = 0x00,
|
||||
Indexed = 0x02,
|
||||
Multiple = 0x04,
|
||||
NotZero = 0x08,
|
||||
IndexedUnique = 0x10,
|
||||
NamedUnique = 0x20,
|
||||
MustBeResident = 0x40,
|
||||
CanBeNonResident = 0x80
|
||||
}
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using DiscUtils.Compression;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using DiscUtils.Compression;
|
||||
|
||||
internal sealed class CompressedClusterStream : ClusterStream
|
||||
{
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
internal class CookedDataRun
|
||||
{
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
internal class DataRun
|
||||
{
|
||||
|
||||
@@ -809,7 +809,7 @@ namespace DiscUtils.Ntfs
|
||||
|
||||
return SplitAttribute(record, (NonResidentAttributeRecord)record.FirstAttribute, false);
|
||||
}
|
||||
|
||||
|
||||
private bool SplitAttribute(FileRecord record, NonResidentAttributeRecord targetAttr, bool atStart)
|
||||
{
|
||||
if (targetAttr.DataRuns.Count <= 1)
|
||||
|
||||
@@ -24,7 +24,6 @@ namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
|
||||
[Flags]
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System.IO;
|
||||
using DiscUtils.Vfs;
|
||||
using System.IO;
|
||||
|
||||
[VfsFileSystemFactory]
|
||||
internal class FileSystemFactory : VfsFileSystemFactory
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
internal abstract class FixupRecordBase
|
||||
|
||||
@@ -474,7 +474,7 @@ namespace DiscUtils.Ntfs
|
||||
{
|
||||
writer.WriteLine(prefix + " " + EntryAsString(entry, _file.BestName, _name));
|
||||
}
|
||||
|
||||
|
||||
if ((entry.Flags & IndexEntryFlags.Node) != 0)
|
||||
{
|
||||
NodeAsString(writer, prefix + " ", GetSubBlock(entry).Node, ":i" + entry.ChildrenVirtualCluster);
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
internal class IndexBlock : FixupRecordBase
|
||||
|
||||
@@ -404,7 +404,7 @@ namespace DiscUtils.Ntfs
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IndexEntry PopulateEnd()
|
||||
{
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
namespace DiscUtils.Ntfs.Internals
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
public sealed class MasterFileTableAttribute
|
||||
{
|
||||
}
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
|
||||
namespace DiscUtils.Ntfs.Internals
|
||||
{
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
public sealed class MasterFileTableRecord
|
||||
{
|
||||
private FileRecord _fileRecord;
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
|
||||
namespace DiscUtils.Ntfs.Internals
|
||||
{
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// The known NTFS namespaces.
|
||||
/// </summary>
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using DiscUtils.Compression;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Implementation of the LZNT1 algorithm used for compressing NTFS files.
|
||||
|
||||
@@ -25,7 +25,6 @@ namespace DiscUtils.Ntfs
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using DiscUtils.Compression;
|
||||
|
||||
internal class NonResidentDataBuffer : DiscUtils.Buffer, IMappedBuffer
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
@@ -1097,7 +1097,7 @@ namespace DiscUtils.Ntfs
|
||||
}
|
||||
}
|
||||
|
||||
UpdateStandardInformation(dirEntry, file, delegate(StandardInformation si) { si.FileAttributes = FileNameRecord.SetAttributes(newValue, si.FileAttributes); });
|
||||
UpdateStandardInformation(dirEntry, file, delegate (StandardInformation si) { si.FileAttributes = FileNameRecord.SetAttributes(newValue, si.FileAttributes); });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1131,7 +1131,7 @@ namespace DiscUtils.Ntfs
|
||||
{
|
||||
using (new NtfsTransaction())
|
||||
{
|
||||
UpdateStandardInformation(path, delegate(StandardInformation si) { si.CreationTime = newTime; });
|
||||
UpdateStandardInformation(path, delegate (StandardInformation si) { si.CreationTime = newTime; });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1165,7 +1165,7 @@ namespace DiscUtils.Ntfs
|
||||
{
|
||||
using (new NtfsTransaction())
|
||||
{
|
||||
UpdateStandardInformation(path, delegate(StandardInformation si) { si.LastAccessTime = newTime; });
|
||||
UpdateStandardInformation(path, delegate (StandardInformation si) { si.LastAccessTime = newTime; });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1199,7 +1199,7 @@ namespace DiscUtils.Ntfs
|
||||
{
|
||||
using (new NtfsTransaction())
|
||||
{
|
||||
UpdateStandardInformation(path, delegate(StandardInformation si) { si.ModificationTime = newTime; });
|
||||
UpdateStandardInformation(path, delegate (StandardInformation si) { si.ModificationTime = newTime; });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1763,7 +1763,7 @@ namespace DiscUtils.Ntfs
|
||||
{
|
||||
UpdateStandardInformation(
|
||||
path,
|
||||
delegate(StandardInformation si)
|
||||
delegate (StandardInformation si)
|
||||
{
|
||||
si.CreationTime = info.CreationTime;
|
||||
si.LastAccessTime = info.LastAccessTime;
|
||||
@@ -1813,7 +1813,7 @@ namespace DiscUtils.Ntfs
|
||||
DirectoryEntry dirEntry = GetDirectoryEntry(path);
|
||||
if (dirEntry == null)
|
||||
{
|
||||
throw new FileNotFoundException("File not found", path);
|
||||
throw new FileNotFoundException("File not found", path);
|
||||
}
|
||||
|
||||
File file = GetFile(dirEntry.Reference);
|
||||
|
||||
@@ -137,8 +137,8 @@ namespace DiscUtils.Ntfs
|
||||
SetSecurityAttribute(volumeFile, "O:" + localAdminString + "G:BAD:(A;;0x12019f;;;SY)(A;;0x12019f;;;BA)");
|
||||
volumeFile.UpdateRecordInMft();
|
||||
|
||||
_context.GetFileByIndex = delegate(long index) { return new File(_context, _context.Mft.GetRecord(index, false)); };
|
||||
_context.AllocateFile = delegate(FileRecordFlags frf) { return new File(_context, _context.Mft.AllocateRecord(frf, false)); };
|
||||
_context.GetFileByIndex = delegate (long index) { return new File(_context, _context.Mft.GetRecord(index, false)); };
|
||||
_context.AllocateFile = delegate (FileRecordFlags frf) { return new File(_context, _context.Mft.AllocateRecord(frf, false)); };
|
||||
|
||||
File attrDefFile = CreateSystemFile(MasterFileTable.AttrDefIndex);
|
||||
_context.AttributeDefinitions.WriteTo(attrDefFile);
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
@@ -70,7 +69,7 @@ namespace DiscUtils.Ntfs
|
||||
value.ReadFrom(buffer, 0);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the content of a stream.
|
||||
/// </summary>
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
internal sealed class NtfsTransaction : IDisposable
|
||||
{
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using DiscUtils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using DiscUtils;
|
||||
|
||||
/// <summary>
|
||||
/// Low-level non-resident attribute operations.
|
||||
|
||||
@@ -22,10 +22,8 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Security.AccessControl;
|
||||
using System.Security.Principal;
|
||||
|
||||
internal sealed class SecurityDescriptor : IByteArraySerializable, IDiagnosticTraceable
|
||||
{
|
||||
|
||||
@@ -22,10 +22,6 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
/// <summary>
|
||||
/// Controls whether short file names are created automatically.
|
||||
/// </summary>
|
||||
|
||||
@@ -93,9 +93,9 @@ namespace DiscUtils.Ntfs
|
||||
{
|
||||
using (Stream s = Open(FileAccess.Read))
|
||||
{
|
||||
byte[] buffer = Utilities.ReadFully(s, (int)Length);
|
||||
_structure.ReadFrom(buffer, 0);
|
||||
_hasContent = s.Length != 0;
|
||||
byte[] buffer = Utilities.ReadFully(s, (int)Length);
|
||||
_structure.ReadFrom(buffer, 0);
|
||||
_hasContent = s.Length != 0;
|
||||
}
|
||||
|
||||
_initialized = true;
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
internal sealed class VolumeInformation : IByteArraySerializable, IDiagnosticTraceable
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
namespace DiscUtils.Ntfs
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user