Changeset 436
- Timestamp:
- 10/2/2008 2:42:07 AM (5 years ago)
- Location:
- branches/eraser6
- Files:
-
- 3 edited
- 1 moved
-
Eraser/TaskDataSelectionForm.cs (modified) (1 diff)
-
Manager/DirectExecutor.cs (modified) (4 diffs)
-
Util/Util.csproj (modified) (1 diff)
-
Util/VolumeInfo.cs (moved) (moved from branches/eraser6/Util/Drive.cs) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/TaskDataSelectionForm.cs
r402 r436 55 55 56 56 //Populate the drives list 57 List<Volume > volumes = Volume.GetVolumes();58 foreach (Volume volume in volumes)57 List<VolumeInfo> volumes = VolumeInfo.GetVolumes(); 58 foreach (VolumeInfo volume in volumes) 59 59 { 60 60 DriveType driveType = volume.VolumeType; -
branches/eraser6/Manager/DirectExecutor.cs
r423 r436 398 398 399 399 //If the user is under disk quotas, log a warning message 400 if (Volume .FromMountpoint(target.Drive).HasQuota)400 if (VolumeInfo.FromMountpoint(target.Drive).HasQuota) 401 401 task.Log.Add(new LogEntry("The drive which is having its unused space erased has " + 402 402 "disk quotas active. This will prevent the complete erasure of unused space and " + … … 449 449 //Determine the total amount of data that needs to be written. 450 450 WriteStatistics statistics = new WriteStatistics(); 451 Volume volInfo = Volume.FromMountpoint(target.Drive);451 VolumeInfo volInfo = VolumeInfo.FromMountpoint(target.Drive); 452 452 long totalSize = method.CalculateEraseDataSize(null, volInfo.TotalFreeSpace); 453 453 … … 647 647 private void EraseFilesystemRecords(DirectoryInfo info, ErasureMethod method) 648 648 { 649 Volume volInfo = Volume.FromMountpoint(info.FullName);649 VolumeInfo volInfo = VolumeInfo.FromMountpoint(info.FullName); 650 650 string volFormat = volInfo.VolumeFormat; 651 651 if (volFormat == "NTFS") … … 816 816 { 817 817 StreamInfo info = new StreamInfo(filePath); 818 Volume volume = Volume.FromMountpoint(info.Directory.FullName);818 VolumeInfo volume = VolumeInfo.FromMountpoint(info.Directory.FullName); 819 819 long clusterSize = volume.ClusterSize; 820 820 return (info.Length + (clusterSize - 1)) & ~(clusterSize - 1); -
branches/eraser6/Util/Util.csproj
r365 r436 43 43 <Compile Include="KernelAPI.cs" /> 44 44 <Compile Include="File.cs" /> 45 <Compile Include=" Drive.cs" />45 <Compile Include="VolumeInfo.cs" /> 46 46 <Compile Include="NetAPI.cs" /> 47 47 <Compile Include="NTAPI.cs" /> -
branches/eraser6/Util/VolumeInfo.cs
r427 r436 31 31 namespace Eraser.Util 32 32 { 33 public class Volume 33 public class VolumeInfo 34 34 { 35 35 /// <summary> … … 37 37 /// </summary> 38 38 /// <param name="volumeID">The ID of the volume, in the form "\\?\Volume{GUID}\"</param> 39 public Volume (string volumeID)39 public VolumeInfo(string volumeID) 40 40 { 41 41 //Set the volume Id … … 109 109 /// <returns>Returns a list of volumes representing all volumes present in 110 110 /// the system.</returns> 111 public static List<Volume > GetVolumes()112 { 113 List<Volume > result = new List<Volume>();111 public static List<VolumeInfo> GetVolumes() 112 { 113 List<VolumeInfo> result = new List<VolumeInfo>(); 114 114 StringBuilder nextVolume = new StringBuilder(LongPath * sizeof(char)); 115 115 SafeHandle handle = FindFirstVolume(nextVolume, LongPath); … … 119 119 //Iterate over the volume mountpoints 120 120 do 121 result.Add(new Volume (nextVolume.ToString()));121 result.Add(new VolumeInfo(nextVolume.ToString())); 122 122 while (FindNextVolume(handle, nextVolume, LongPath)); 123 123 … … 135 135 /// <returns>The volume object if such a volume exists, or an exception 136 136 /// is thrown.</returns> 137 public static Volume FromMountpoint(string mountpoint)137 public static VolumeInfo FromMountpoint(string mountpoint) 138 138 { 139 139 DirectoryInfo mountpointDir = new DirectoryInfo(mountpoint); … … 146 146 currentDir += '\\'; 147 147 if (GetVolumeNameForVolumeMountPoint(currentDir, volumeID, 50)) 148 return new Volume (volumeID.ToString());148 return new VolumeInfo(volumeID.ToString()); 149 149 else if (Marshal.GetLastWin32Error() != 4390 /*ERROR_NOT_A_REPARSE_POINT*/) 150 150 throw new Win32Exception(Marshal.GetLastWin32Error()); … … 293 293 /// contains volume mountpoints. 294 294 /// </summary> 295 public List<Volume > MountedVolumes296 { 297 get 298 { 299 List<Volume > result = new List<Volume>();295 public List<VolumeInfo> MountedVolumes 296 { 297 get 298 { 299 List<VolumeInfo> result = new List<VolumeInfo>(); 300 300 StringBuilder nextMountpoint = new StringBuilder(LongPath * sizeof(char)); 301 301 … … 307 307 //Iterate over the volume mountpoints 308 308 while (FindNextVolumeMountPoint(handle, nextMountpoint, LongPath)) 309 result.Add(new Volume (nextMountpoint.ToString()));309 result.Add(new VolumeInfo(nextMountpoint.ToString())); 310 310 311 311 //Close the handle
Note: See TracChangeset
for help on using the changeset viewer.
