From 01451d7009d6551b4b70bb73272ff15111426f47 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 1 Nov 2020 16:01:45 -0800 Subject: [PATCH] A bit of cleanup --- BurnOutSharp/ProtectionFind.cs | 560 --------------------------------- BurnOutSharp/Scanner.cs | 1 - BurnOutSharp/Utilities.cs | 265 ---------------- Test/Program.cs | 2 - 4 files changed, 828 deletions(-) delete mode 100644 BurnOutSharp/ProtectionFind.cs diff --git a/BurnOutSharp/ProtectionFind.cs b/BurnOutSharp/ProtectionFind.cs deleted file mode 100644 index fa766acd..00000000 --- a/BurnOutSharp/ProtectionFind.cs +++ /dev/null @@ -1,560 +0,0 @@ -////this file is part of BurnOut -////Copyright (C)2005-2010 Gernot Knippen -////Ported code with augments Copyright (C)2018 Matt Nadareski -//// -////This program is free software; you can redistribute it and/or -////modify it under the terms of the GNU General Public License -////as published by the Free Software Foundation; either -////version 2 of the License, or (at your option) any later version. -//// -////This program is distributed in the hope that it will be useful, -////but WITHOUT ANY WARRANTY; without even the implied warranty of -////MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -////GNU General Public License for more details. -//// -////You can get a copy of the GNU General Public License -////by writing to the Free Software -////Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -//using System; -//using System.Collections.Generic; -//using System.IO; -//using System.Linq; -//using System.Threading; -//using BurnOutSharp.FileType; -//using BurnOutSharp.ProtectionType; - -//namespace BurnOutSharp -//{ -// public static class ProtectionFind -// { -// /// -// /// Progress indicator -// /// -// private static IProgress FileProgress = null; - -// /// -// /// Scan a path to find any known copy protection(s) -// /// -// /// Path to scan for protection(s) -// /// True to include scanned copy protection position, false otherwise (default) -// /// Optional progress indicator that will return a float in the range from 0 to 1 -// /// Dictionary of filename to protection mappings, if possible -// public static Dictionary Scan(string path, bool includePosition = false, IProgress progress = null) -// { -// // Set the progress indicator, if it's not set already -// if (FileProgress == null) -// FileProgress = progress; - -// // Initialize the protections dictionary -// var protections = new Dictionary(); - -// // Checkpoint -// FileProgress?.Report(new FileProtection(null, 0, null)); - -// // Temp variables for reporting -// string tempFilePath = Path.GetTempPath(); -// string tempFilePathWithGuid = Path.Combine(tempFilePath, Guid.NewGuid().ToString()); - -// // If we have a file -// if (File.Exists(path)) -// { -// // Get the reportable file name -// string reportableFileName = path; -// if (reportableFileName.StartsWith(tempFilePath)) -// reportableFileName = reportableFileName.Substring(tempFilePathWithGuid.Length); - -// // Checkpoint -// FileProgress?.Report(new FileProtection(reportableFileName, 1, "Checking file" + (path != reportableFileName ? " from archive" : string.Empty))); - -// // Try using just the file first to get protection info -// string fileProtection = ScanPath(path, false); -// if (!string.IsNullOrWhiteSpace(fileProtection)) -// protections[path] = fileProtection; - -// // Now check to see if the file contains any additional information -// string contentProtection = ScanContent(path, includePosition)?.Replace("" + (char)0x00, ""); -// if (!string.IsNullOrWhiteSpace(contentProtection)) -// { -// if (protections.ContainsKey(path)) -// protections[path] += $", {contentProtection}"; -// else -// protections[path] = contentProtection; -// } - -// // Checkpoint -// protections.TryGetValue(path, out string fullProtection); -// FileProgress?.Report(new FileProtection(reportableFileName, 1, fullProtection ?? string.Empty)); -// } -// // If we have a directory -// else if (Directory.Exists(path)) -// { -// // Get the lists of files to be used -// var files = Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories); - -// // Try using just the path first to get protection info -// string pathProtection = ScanPath(path, true); -// if (!string.IsNullOrWhiteSpace(pathProtection)) -// protections[path] = pathProtection; - -// // Loop through all files and scan their contents -// for (int i = 0; i < files.Count(); i++) -// { -// // Get the current file -// string file = files.ElementAt(i); - -// // Get the reportable file name -// string reportableFileName = file; -// if (reportableFileName.StartsWith(tempFilePath)) -// reportableFileName = reportableFileName.Substring(tempFilePathWithGuid.Length); - -// // Checkpoint -// FileProgress?.Report(new FileProtection(reportableFileName, i / (float)files.Count(), "Checking file" + (file != reportableFileName ? " from archive" : string.Empty))); - -// // Try using just the file first to get protection info -// string fileProtection = ScanPath(file, false); -// if (!string.IsNullOrWhiteSpace(fileProtection)) -// protections[file] = fileProtection; - -// // Now check to see if the file contains any additional information -// string contentProtection = ScanContent(file, includePosition)?.Replace("" + (char)0x00, ""); -// if (!string.IsNullOrWhiteSpace(contentProtection)) -// { -// if (protections.ContainsKey(file)) -// protections[file] += $", {contentProtection}"; -// else -// protections[file] = contentProtection; -// } - -// // Checkpoint -// protections.TryGetValue(file, out string fullProtection); -// FileProgress?.Report(new FileProtection(reportableFileName, (i + 1) / (float)files.Count(), fullProtection ?? string.Empty)); -// } -// } - -// // If we have an empty list, we need to take care of that -// if (protections.Count(p => !string.IsNullOrWhiteSpace(p.Value)) == 0) -// { -// protections = new Dictionary(); -// } - -// return protections; -// } - -// /// -// /// Scan a path for indications of copy protection -// /// -// /// Path to scan file and folder names -// /// True if the path is a directory, false otherwise -// /// -// public static string ScanPath(string path, bool isDirectory) -// { -// List protections = new List(); -// string protection; - -// // If we have a directory, get the files in the directory for searching -// IEnumerable files = null; -// if (isDirectory) -// files = Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories); - -// // AACS -// protection = AACS.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Alpha-DVD -// protection = AlphaDVD.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Bitpool -// protection = Bitpool.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // ByteShield -// protection = ByteShield.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Cactus Data Shield -// protection = CactusDataShield.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // CD-Cops -// protection = CDCops.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // CD-Lock -// protection = CDLock.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // CD-Protector -// protection = CDProtector.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // CD-X -// protection = CDX.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// /* -// // CopyKiller -// protection = CopyKiller.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); -// */ - -// // DiscGuard -// protection = DiscGuard.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // DVD Crypt -// protection = DVDCrypt.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // DVD-Movie-PROTECT -// protection = DVDMoviePROTECT.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // FreeLock -// protection = FreeLock.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Games for Windows - Live -// protection = GFWL.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Hexalock AutoLock -// protection = HexalockAutoLock.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Impulse Reactor -// protection = ImpulseReactor.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // IndyVCD -// protection = IndyVCD.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Key2Audio XS -// protection = Key2AudioXS.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // LaserLock -// protection = LaserLock.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // MediaCloQ -// protection = MediaCloQ.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // MediaMax CD3 -// protection = MediaMaxCD3.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Origin -// protection = Origin.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Protect DVD-Video -// protection = ProtectDVDVideo.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // SafeCast -// protection = SafeCast.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // SafeDisc -// protection = SafeDisc.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // SafeDisc Lite -// protection = SafeDiscLite.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // SafeLock -// protection = SafeLock.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // SecuROM -// protection = SecuROM.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // SmartE -// protection = SmartE.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // SoftLock -// protection = SoftLock.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // SolidShield -// protection = SolidShield.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // StarForce -// protection = StarForce.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Steam -// protection = Steam.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // TAGES -// protection = Tages.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // TZCopyProtector -// protection = TZCopyProtector.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Uplay -// protection = Uplay.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // VOB ProtectCD/DVD -// protection = VOBProtectCDDVD.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Winlock -// protection = Winlock.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // WTM CD Protect -// protection = WTMCDProtect.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // XCP -// protection = XCP.CheckPath(path, files, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Zzxzz -// protection = Zzxzz.CheckPath(path, isDirectory); -// if (!string.IsNullOrWhiteSpace(protection)) -// protections.Add(protection); - -// // Now combine any found protections, or null if empty -// if (protections.Count() == 0) -// return null; -// else -// return string.Join(", ", protections); -// } - -// /// -// /// Scan an individual file for copy protection -// /// -// /// File path for scanning -// /// True to include scanned copy protection position, false otherwise (default) -// public static string ScanContent(string file, bool includePosition = false) -// { -// try -// { -// using (FileStream fs = File.OpenRead(file)) -// { -// return ScanContent(fs, file, includePosition); -// } -// } -// catch -// { -// return null; -// } -// } - -// /// -// /// Scan an individual stream for copy protection -// /// -// /// Generic stream to scan -// /// File path to be used for name checks (optional) -// /// True to include scanned copy protection position, false otherwise (default) -// public static string ScanContent(Stream stream, string file = null, bool includePosition = false) -// { -// // Get the extension for certain checks -// string extension = Path.GetExtension(file).ToLower().TrimStart('.'); - -// // Assume the first part of the stream is the start of a file -// byte[] magic = new byte[16]; -// try -// { -// stream.Read(magic, 0, 16); -// stream.Seek(-16, SeekOrigin.Current); -// } -// catch -// { -// // We don't care what the issue was, we can't read or seek the file -// return null; -// } - -// // Files can be protected in multiple ways -// List protections = new List(); - -// #region Non-Archive Formats - -// // Executable -// if (Executable.ShouldScan(magic)) -// protections.AddRange(Executable.Scan(stream, file, includePosition)); - -// // Text-based files -// if (Textfile.ShouldScan(magic, extension)) -// protections.AddRange(Textfile.Scan(stream, includePosition)); - -// #endregion - -// #region Archive Formats - -// // 7-Zip archive -// if (SevenZip.ShouldScan(magic)) -// protections.AddRange(SevenZip.Scan(stream, includePosition)); - -// // BFPK archive -// if (BFPK.ShouldScan(magic)) -// protections.AddRange(BFPK.Scan(stream, includePosition)); - -// // BZip2 -// if (BZip2.ShouldScan(magic)) -// protections.AddRange(BZip2.Scan(stream, includePosition)); - -// // GZIP -// if (GZIP.ShouldScan(magic)) -// protections.AddRange(GZIP.Scan(stream, includePosition)); - -// // InstallShield Cabinet -// if (file != null && InstallShieldCAB.ShouldScan(magic)) -// protections.AddRange(InstallShieldCAB.Scan(file, includePosition)); - -// // Microsoft Cabinet -// if (file != null && MicrosoftCAB.ShouldScan(magic)) -// protections.AddRange(MicrosoftCAB.Scan(file, includePosition)); - -// // MSI -// if (file != null && MSI.ShouldScan(magic)) -// protections.AddRange(MSI.Scan(file, includePosition)); - -// // MPQ archive -// if (file != null && MPQ.ShouldScan(magic)) -// protections.AddRange(MPQ.Scan(file, includePosition)); - -// // PKZIP archive (and derivatives) -// if (PKZIP.ShouldScan(magic)) -// protections.AddRange(PKZIP.Scan(stream, includePosition)); - -// // RAR archive -// if (RAR.ShouldScan(magic)) -// protections.AddRange(RAR.Scan(stream, includePosition)); - -// // Tape Archive -// if (TapeArchive.ShouldScan(magic)) -// protections.AddRange(TapeArchive.Scan(stream, includePosition)); - -// // Valve archive formats -// if (file != null && Valve.ShouldScan(magic)) -// protections.AddRange(Valve.Scan(file, includePosition)); - -// // XZ -// if (XZ.ShouldScan(magic)) -// protections.AddRange(XZ.Scan(stream, includePosition)); - -// #endregion - -// // Return blank if nothing found, or comma-separated list of protections -// if (protections.Count() == 0) -// return string.Empty; -// else -// return string.Join(", ", protections); -// } - -// /// -// /// Scan a disc sector by sector for protection -// /// -// /// -// /// https://stackoverflow.com/questions/8819188/c-sharp-classes-to-undelete-files/8820157#8820157 -// /// TODO: Finish implementation -// /// -// private static string ScanSectors(char driveLetter, int sectorsize) -// { -// string fsName = Utilities.GetFileSystemName(driveLetter); - -// // Gets a handle to the physical disk -// IntPtr hDisk = Utilities.CreateFile($"\\\\.\\{driveLetter}:", -// FileAccess.Read, -// FileShare.ReadWrite, -// IntPtr.Zero, -// FileMode.Open, -// 0, -// IntPtr.Zero); - -// // If we have a good pointer -// if (hDisk.ToInt32() != -1) -// { -// // Setup vars -// byte[] buffer = new byte[sectorsize]; -// IntPtr pt = IntPtr.Zero; -// NativeOverlapped no = new NativeOverlapped(); - -// // Set initial offset -// Utilities.SetFilePointerEx( -// hDisk, -// 0, -// ref pt, -// Utilities.FileBegin); - -// // Read a whole sector -// while (true) -// { -// buffer = new byte[sectorsize]; -// Utilities.ReadFileEx( -// hDisk, -// buffer, -// (uint)sectorsize, -// ref no, -// null); - -// Utilities.SetFilePointerEx( -// hDisk, -// sectorsize, -// ref pt, -// Utilities.FileCurrent); -// } -// } - -// Utilities.CloseHandle(hDisk); - -// return null; -// } -// } -//} diff --git a/BurnOutSharp/Scanner.cs b/BurnOutSharp/Scanner.cs index 16b4274a..9d9cd125 100644 --- a/BurnOutSharp/Scanner.cs +++ b/BurnOutSharp/Scanner.cs @@ -459,7 +459,6 @@ namespace BurnOutSharp #region Archive File Types // If we're scanning archives, we have a few to try out - // TODO: All archives should prefix internal paths properly if (ScanArchives) { // 7-Zip archive diff --git a/BurnOutSharp/Utilities.cs b/BurnOutSharp/Utilities.cs index 9132bfef..a66f4e08 100644 --- a/BurnOutSharp/Utilities.cs +++ b/BurnOutSharp/Utilities.cs @@ -3,9 +3,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; namespace BurnOutSharp { @@ -235,267 +232,5 @@ namespace BurnOutSharp else return fvinfo.ProductVersion.Replace(", ", "."); } - - /// - /// Get the filesystem name for the given drive letter - /// - /// - /// http://pinvoke.net/default.aspx/kernel32/GetVolumeInformation.html - /// - public static string GetFileSystemName(char driveLetter) - { - string fsName = null; - - StringBuilder volname = new StringBuilder(261); - StringBuilder fsname = new StringBuilder(261); - - if (GetVolumeInformation($"{driveLetter}:\\", volname, volname.Capacity, out uint sernum, out uint maxlen, out FileSystemFeature flags, fsname, fsname.Capacity)) - { - // Now you know the file system of your drive - // NTFS or FAT16 or UDF for instance - fsName = fsname.ToString(); - } - - return fsName; - } - - #region P/Invoke - - // https://stackoverflow.com/questions/8819188/c-sharp-classes-to-undelete-files/8820157#8820157 - - // Move Method - public const uint FileBegin = 0; - public const uint FileCurrent = 1; - public const uint FileEnd = 2; - - // Handle Constants - public const uint INVALID_HANDLE_VALUE = 0; - public const int IOCTL_STORAGE_GET_DEVICE_NUMBER = 0x2D1080; - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern bool CloseHandle(IntPtr handle); - - [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern IntPtr CreateFile( - [MarshalAs(UnmanagedType.LPTStr)] string filename, - [MarshalAs(UnmanagedType.U4)] FileAccess access, - [MarshalAs(UnmanagedType.U4)] FileShare share, - IntPtr securityAttributes, // optional SECURITY_ATTRIBUTES struct or IntPtr.Zero - [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, - [MarshalAs(UnmanagedType.U4)] FileAttributes flagsAndAttributes, - IntPtr templateFile); - - [DllImport("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - public extern static bool GetVolumeInformation( - string rootPathName, - StringBuilder volumeNameBuffer, - int volumeNameSize, - out uint volumeSerialNumber, - out uint maximumComponentLength, - out FileSystemFeature fileSystemFlags, - StringBuilder fileSystemNameBuffer, - int nFileSystemNameSize); - - [DllImport("Kernel32.dll", SetLastError = true)] - public extern static bool DeviceIoControl( - IntPtr hDevice, - uint IoControlCode, - IntPtr InMediaRemoval, - uint InBufferSize, - IntPtr OutBuffer, - int OutBufferSize, - out int BytesReturned, - IntPtr Overlapped); - - // Used to read in a file - [DllImport("kernel32.dll")] - public static extern bool ReadFile( - IntPtr hFile, - byte[] lpBuffer, - uint nNumberOfBytesToRead, - ref uint lpNumberOfBytesRead, - IntPtr lpOverlapped); - - [DllImport("kernel32.dll")] - public static extern bool ReadFileEx( - IntPtr hFile, - [Out] byte[] lpBuffer, - uint nNumberOfBytesToRead, - [In] ref NativeOverlapped lpOverlapped, - IOCompletionCallback lpCompletionRoutine); - - // Used to set the offset in file to start reading - [DllImport("kernel32.dll")] - public static extern bool SetFilePointerEx( - IntPtr hFile, - long liDistanceToMove, - ref IntPtr lpNewFilePointer, - uint dwMoveMethod); - - [StructLayout(LayoutKind.Sequential)] - struct STORAGE_DEVICE_NUMBER - { - public int DeviceType; - public int DeviceNumber; - public int PartitionNumber; - } - - public enum MEDIA_TYPE : uint - { - Unknown, - F5_1Pt2_512, - F3_1Pt44_512, - F3_2Pt88_512, - F3_20Pt8_512, - F3_720_512, - F5_360_512, - F5_320_512, - F5_320_1024, - F5_180_512, - F5_160_512, - RemovableMedia, - FixedMedia, - F3_120M_512, - F3_640_512, - F5_640_512, - F5_720_512, - F3_1Pt2_512, - F3_1Pt23_1024, - F5_1Pt23_1024, - F3_128Mb_512, - F3_230Mb_512, - F8_256_128, - F3_200Mb_512, - F3_240M_512, - F3_32M_512 - } - - [StructLayout(LayoutKind.Sequential)] - public struct DISK_GEOMETRY - { - public long Cylinders; - public MEDIA_TYPE MediaType; - public int TracksPerCylinder; - public int SectorsPerTrack; - public int BytesPerSector; - - public long DiskSize - { - get - { - return Cylinders * (long)TracksPerCylinder * (long)SectorsPerTrack * (long)BytesPerSector; - } - } - } - - [Flags] - public enum FileSystemFeature : uint - { - /// - /// The file system preserves the case of file names when it places a name on disk. - /// - CasePreservedNames = 2, - - /// - /// The file system supports case-sensitive file names. - /// - CaseSensitiveSearch = 1, - - /// - /// The specified volume is a direct access (DAX) volume. This flag was introduced in Windows 10, version 1607. - /// - DaxVolume = 0x20000000, - - /// - /// The file system supports file-based compression. - /// - FileCompression = 0x10, - - /// - /// The file system supports named streams. - /// - NamedStreams = 0x40000, - - /// - /// The file system preserves and enforces access control lists (ACL). - /// - PersistentACLS = 8, - - /// - /// The specified volume is read-only. - /// - ReadOnlyVolume = 0x80000, - - /// - /// The volume supports a single sequential write. - /// - SequentialWriteOnce = 0x100000, - - /// - /// The file system supports the Encrypted File System (EFS). - /// - SupportsEncryption = 0x20000, - - /// - /// The specified volume supports extended attributes. An extended attribute is a piece of - /// application-specific metadata that an application can associate with a file and is not part - /// of the file's data. - /// - SupportsExtendedAttributes = 0x00800000, - - /// - /// The specified volume supports hard links. For more information, see Hard Links and Junctions. - /// - SupportsHardLinks = 0x00400000, - - /// - /// The file system supports object identifiers. - /// - SupportsObjectIDs = 0x10000, - - /// - /// The file system supports open by FileID. For more information, see FILE_ID_BOTH_DIR_INFO. - /// - SupportsOpenByFileId = 0x01000000, - - /// - /// The file system supports re-parse points. - /// - SupportsReparsePoints = 0x80, - - /// - /// The file system supports sparse files. - /// - SupportsSparseFiles = 0x40, - - /// - /// The volume supports transactions. - /// - SupportsTransactions = 0x200000, - - /// - /// The specified volume supports update sequence number (USN) journals. For more information, - /// see Change Journal Records. - /// - SupportsUsnJournal = 0x02000000, - - /// - /// The file system supports Unicode in file names as they appear on disk. - /// - UnicodeOnDisk = 4, - - /// - /// The specified volume is a compressed volume, for example, a DoubleSpace volume. - /// - VolumeIsCompressed = 0x8000, - - /// - /// The file system supports disk quotas. - /// - VolumeQuotas = 0x20 - } - - #endregion } } diff --git a/Test/Program.cs b/Test/Program.cs index 848f682d..5ea882f6 100644 --- a/Test/Program.cs +++ b/Test/Program.cs @@ -49,8 +49,6 @@ namespace Test Console.WriteLine("Press any button to close..."); Console.ReadLine(); - - //ProtectionFind.ScanSectors('D', 2048); } private static void Changed(object source, FileProtection value)