Changeset 2149
- Timestamp:
- 5/16/2010 11:14:29 AM (3 years ago)
- Location:
- trunk/eraser
- Files:
-
- 8 edited
-
Eraser.DefaultPlugins/ErasureTargets/FileSystemObjectErasureTarget.cs (modified) (5 diffs)
-
Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTarget.cs (modified) (2 diffs)
-
Eraser.DefaultPlugins/ErasureTargets/UnusedSpaceErasureTargetConfigurer.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/FileSystems/Ntfs.cs (modified) (1 diff)
-
Eraser.DefaultPlugins/FileSystems/Windows.cs (modified) (4 diffs)
-
Eraser.Util.Native/OpenHandle.cpp (modified) (1 diff)
-
Eraser.Util/VolumeInfo.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FileSystemObjectErasureTarget.cs
r2144 r2149 123 123 try 124 124 { 125 //Get the ADS names 126 IList<string> adses = file.GetADSes(); 127 StreamInfo[] result = new StreamInfo[adses.Count]; 128 129 //Then prepend the path. 130 for (int i = 0; i < adses.Count; ++i) 131 { 132 StreamInfo info = new StreamInfo(file.FullName + ':' + adses[i]); 133 result[i] = info; 134 } 125 return file.GetADSes().ToArray(); 135 126 } 136 127 catch (FileNotFoundException) … … 150 141 processStr.AppendFormat( 151 142 System.Globalization.CultureInfo.InvariantCulture, 152 "{0}, ", (System.Diagnostics.Process.GetProcessById(handle.ProcessId)).MainModule.FileName);143 "{0}, ", handle.Process.MainModule.FileName); 153 144 } 154 145 catch (System.ComponentModel.Win32Exception) … … 156 147 processStr.AppendFormat( 157 148 System.Globalization.CultureInfo.InvariantCulture, 158 "Process ID {0}, ", handle.Process Id);149 "Process ID {0}, ", handle.Process.Id); 159 150 } 160 151 } … … 320 311 processStr.AppendFormat( 321 312 System.Globalization.CultureInfo.InvariantCulture, 322 "{0}, ", System.Diagnostics.Process.GetProcessById(handle.ProcessId).MainModule.FileName);313 "{0}, ", handle.Process.MainModule.FileName); 323 314 } 324 315 catch (System.ComponentModel.Win32Exception) … … 326 317 processStr.AppendFormat( 327 318 System.Globalization.CultureInfo.InvariantCulture, 328 "Process ID {0}, ", handle.Process Id);319 "Process ID {0}, ", handle.Process.Id); 329 320 } 330 321 } -
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/FolderErasureTarget.cs
r2143 r2149 188 188 bool isVolumeRoot = directory.Parent == null; 189 189 foreach (VolumeInfo volume in VolumeInfo.Volumes) 190 foreach ( stringmountPoint in volume.MountPoints)191 if (directory.FullName == mountPoint )190 foreach (DirectoryInfo mountPoint in volume.MountPoints) 191 if (directory.FullName == mountPoint.FullName) 192 192 isVolumeRoot = true; 193 193 -
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/SecureMoveErasureTarget.cs
r2118 r2149 159 159 { 160 160 //Compute the total size of the file on the disk (including ADSes) 161 List<StreamInfo> fileStreams = new List<StreamInfo>( 162 file.GetADSes().Select(x => new StreamInfo(file.FullName, x))); 161 List<StreamInfo> fileStreams = new List<StreamInfo>(file.GetADSes()); 163 162 fileStreams.Add(new StreamInfo(file.FullName)); 164 163 long fileSize = fileStreams.Sum(x => x.Length); … … 315 314 private void EraseFile(FileInfo info, SteppedProgressManager eraseProgress) 316 315 { 317 List<StreamInfo> streams = new List<StreamInfo>( 318 info.GetADSes().Select(x => new StreamInfo(info.FullName, x))); 316 List<StreamInfo> streams = new List<StreamInfo>(info.GetADSes()); 319 317 streams.Add(new StreamInfo(info.FullName)); 320 318 long fileSize = streams.Sum(x => x.Length); -
trunk/eraser/Eraser.DefaultPlugins/ErasureTargets/UnusedSpaceErasureTargetConfigurer.cs
r2070 r2149 84 84 85 85 DriveItem item = new DriveItem(); 86 string volumePath = volume.MountPoints[0]; 87 DirectoryInfo root = new DirectoryInfo(volumePath); 86 DirectoryInfo root = volume.MountPoints[0]; 88 87 89 item.Drive = volumePath;88 item.Drive = root.FullName; 90 89 item.Label = root.GetDescription(); 91 90 item.Icon = root.GetIcon(); -
trunk/eraser/Eraser.DefaultPlugins/FileSystems/Ntfs.cs
r1859 r2149 105 105 //Create a directory to hold all the temporary files 106 106 DirectoryInfo tempDir = new DirectoryInfo(FileSystem.GenerateRandomFileName( 107 new DirectoryInfo(info.MountPoints[0]), 32));107 info.MountPoints[0], 32)); 108 108 tempDir.Create(); 109 109 -
trunk/eraser/Eraser.DefaultPlugins/FileSystems/Windows.cs
r2032 r2149 137 137 processStr.AppendFormat( 138 138 System.Globalization.CultureInfo.InvariantCulture, 139 "{0}, ", (System.Diagnostics.Process.GetProcessById(handle.ProcessId)).MainModule.FileName);139 "{0}, ", handle.Process.MainModule.FileName); 140 140 } 141 141 catch (System.ComponentModel.Win32Exception) … … 143 143 processStr.AppendFormat( 144 144 System.Globalization.CultureInfo.InvariantCulture, 145 "Process ID {0}, ", handle.Process Id);145 "Process ID {0}, ", handle.Process.Id); 146 146 } 147 147 } … … 205 205 throw new InvalidOperationException(S._("Could not erase cluster tips in {0} " + 206 206 "as the volume is not mounted.", info.VolumeId)); 207 ListFiles( new DirectoryInfo(info.MountPoints[0]), files, searchCallback);207 ListFiles(info.MountPoints[0], files, searchCallback); 208 208 209 209 //For every file, erase the cluster tips. … … 279 279 try 280 280 { 281 foreach ( string iin file.GetADSes())282 files.Add( file.FullName + ':' + i);281 foreach (StreamInfo stream in file.GetADSes()) 282 files.Add(stream.FullName); 283 283 284 284 files.Add(file.FullName); -
trunk/eraser/Eraser.Util.Native/OpenHandle.cpp
r2032 r2149 94 94 { 95 95 //Open a handle to the owning process 96 HANDLE processHandle = OpenProcess(PROCESS_DUP_HANDLE, false, ProcessId);96 HANDLE processHandle = OpenProcess(PROCESS_DUP_HANDLE, false, processId); 97 97 98 98 //Forcibly close the handle -
trunk/eraser/Eraser.Util/VolumeInfo.cs
r2148 r2149 714 714 public override string ToString() 715 715 { 716 ReadOnlyCollection<string> mountPoints = MountPoints;717 return mountPoints.Count == 0 ? VolumeId : mountPoints[0] ;716 IList<DirectoryInfo> mountPoints = MountPoints; 717 return mountPoints.Count == 0 ? VolumeId : mountPoints[0].FullName; 718 718 } 719 719
Note: See TracChangeset
for help on using the changeset viewer.
