Changeset 2555


Ignore:
Timestamp:
3/20/2012 1:37:37 AM (3 years ago)
Author:
lowjoel
Message:

Forward-port from Eraser 6.0: Supplements r2551: Support direct volume reparse points, similar to what would occur before the code change.

Location:
trunk/eraser
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser

  • trunk/eraser/Eraser.Util/ExtensionMethods/PathUtil.cs

    r2551 r2555  
    214214 
    215215                    //Is it a directory? If it is, we need to add a trailing \ 
    216                     if (Directory.Exists(path)) 
     216                    if (Directory.Exists(path) && !result.EndsWith("\\")) 
    217217                        result += '\\'; 
    218218                    return result; 
  • trunk/eraser/Eraser.Util/Strings.en.resx

    r2512 r2555  
    145145    <value>Session ended</value> 
    146146  </data> 
     147  <data name="The path provided includes a reparse point which references another volume." xml:space="preserve"> 
     148    <value>The path provided includes a reparse point which references another volume.</value> 
     149  </data> 
    147150</root> 
  • trunk/eraser/Eraser.Util/Strings.it.resx

    r2512 r2555  
    145145    <value>(Untranslated)</value> 
    146146  </data> 
     147  <data name="The path provided includes a reparse point which references another volume." xml:space="preserve"> 
     148    <value>(Untranslated)</value> 
     149  </data> 
    147150</root> 
  • trunk/eraser/Eraser.Util/Strings.nl.resx

    r2512 r2555  
    145145    <value>(Untranslated)</value> 
    146146  </data> 
     147  <data name="The path provided includes a reparse point which references another volume." xml:space="preserve"> 
     148    <value>(Untranslated)</value> 
     149  </data> 
    147150</root> 
  • trunk/eraser/Eraser.Util/Strings.pl.resx

    r2512 r2555  
    145145    <value>(Untranslated)</value> 
    146146  </data> 
     147  <data name="The path provided includes a reparse point which references another volume." xml:space="preserve"> 
     148    <value>(Untranslated)</value> 
     149  </data> 
    147150</root> 
  • trunk/eraser/Eraser.Util/Strings.resx

    r2512 r2555  
    145145    <value>Session ended</value> 
    146146  </data> 
     147  <data name="The path provided includes a reparse point which references another volume." xml:space="preserve"> 
     148    <value>The path provided includes a reparse point which references another volume.</value> 
     149  </data> 
    147150</root> 
  • trunk/eraser/Eraser.Util/VolumeInfo.cs

    r2549 r2555  
    3030using Microsoft.Win32.SafeHandles; 
    3131using System.Collections.ObjectModel; 
     32using System.Globalization; 
    3233 
    3334namespace Eraser.Util 
     
    311312                        currentDir = ExtensionMethods.PathUtil.ResolveReparsePoint(currentDir); 
    312313 
     314                        //If we get a volume identifier, we need to see if it is the only thing 
     315                        //in the path. If it is, we found our volume GUID and we won't have to 
     316                        //call GetVolumeNameForVolumeMountPoint. 
     317                        if (currentDir.StartsWith("\\??\\Volume{")) 
     318                        { 
     319                            if (currentDir.Length == 49 && currentDir.EndsWith("}\\")) 
     320                                return new VolumeInfo(string.Format(CultureInfo.InvariantCulture, 
     321                                    "\\\\?\\Volume{{{0}}}\\", currentDir.Substring(11, 36))); 
     322                            else 
     323                                throw new ArgumentException(S._("The path provided includes a " + 
     324                                    "reparse point which references another volume.")); 
     325                        } 
     326 
    313327                        //Strip the NT namespace bit 
    314                         if (currentDir.StartsWith("\\??\\Volume")) 
    315                             throw new ArgumentException(S._("The path provided includes a reparse" + 
    316                                 "point which references another volume.")); 
    317328                        else 
    318329                            currentDir = currentDir.Substring(4); 
Note: See TracChangeset for help on using the changeset viewer.