summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-04-14 06:17:56 +0000
committerChris Wilson <chris+github@qwirx.com>2011-04-14 06:17:56 +0000
commitaf6d0e7d543cc43be610e100f224871f4c504fd1 (patch)
treec6774338e163400e66d78a068901d377debf67b9
parentba83ce982d0d4900e92fd80fa43cbaf56c49d4fb (diff)
Support paths starting with \\?\, to fix support for backing up VSS
snapshots.
-rw-r--r--lib/win32/emu.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp
index 0afb9fa3..64858a27 100644
--- a/lib/win32/emu.cpp
+++ b/lib/win32/emu.cpp
@@ -451,7 +451,15 @@ std::string ConvertPathToAbsoluteUnicode(const char *pFileName)
return tmpStr;
}
- if (filename.length() > 2 && filename[0] == '\\' &&
+ if (filename.length() > 4 && filename[0] == '\\' &&
+ filename[1] == '\\' && filename[2] == '?' &&
+ filename[3] == '\\')
+ {
+ // File is already in absolute utf-8 format, e.g.
+ // \\?\GLOBALROOT\...
+ tmpStr = "";
+ }
+ else if (filename.length() > 2 && filename[0] == '\\' &&
filename[1] == '\\')
{
tmpStr += "UNC\\";
@@ -461,13 +469,13 @@ std::string ConvertPathToAbsoluteUnicode(const char *pFileName)
}
else if (filename.length() >= 1 && filename[0] == '\\')
{
- // root directory of current drive.
+ // starts with \, i.e. root directory of current drive.
tmpStr = wd;
tmpStr.resize(2); // drive letter and colon
}
else if (filename.length() >= 2 && filename[1] != ':')
{
- // Must be relative. We need to get the
+ // Must be a relative path. We need to get the
// current directory to make it absolute.
tmpStr += wd;
if (tmpStr[tmpStr.length()-1] != '\\')