diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
commit | a1c91f4695e208d5a8f80dc37b1818169b7829ff (patch) | |
tree | 52f5134376d17c99b6c9e53133a2eb5cf171377c /lib/shadow.cpp | |
parent | 5.16 (diff) | |
download | FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.gz FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.bz2 FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.zip |
5.17
Diffstat (limited to 'lib/shadow.cpp')
-rw-r--r-- | lib/shadow.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/shadow.cpp b/lib/shadow.cpp index 4bb299ac..1161646e 100644 --- a/lib/shadow.cpp +++ b/lib/shadow.cpp @@ -53,20 +53,20 @@ public: //VSS does not support running under WOW64 except for Windows XP and Windows Server 2003 //reference: http://msdn.microsoft.com/en-us/library/aa384627(VS.85).aspx if (runningWOW64()) - throw FileError(_("Cannot access Volume Shadow Copy Service.") + L"\n" + + throw FileError(_("Cannot access Volume Shadow Copy Service."), _("Please use FreeFileSync 64-bit version to create shadow copies on this system.")); //check if shadow copy dll was loaded correctly if (!createShadowCopy || !releaseShadowCopy || !getShadowVolume || !getLastError) - throw FileError(_("Cannot access Volume Shadow Copy Service.") + L"\n" + + throw FileError(_("Cannot access Volume Shadow Copy Service."), replaceCpy(_("Cannot load file %x."), L"%x", fmtFileName(getDllName()))); //--------------------------------------------------------------------------------------------------------- //start volume shadow copy service: backupHandle = createShadowCopy(volumeNamePf.c_str()); if (!backupHandle) - throw FileError(_("Cannot access Volume Shadow Copy Service.") + L"\n" + - getLastError() + L" Volume: " + fmtFileName(volumeNamePf)); + throw FileError(_("Cannot access Volume Shadow Copy Service."), + getLastError() + std::wstring(L" Volume: ") + fmtFileName(volumeNamePf)); shadowVolPf = appendSeparator(getShadowVolume(backupHandle)); //shadowVolName NEVER has a trailing backslash } @@ -96,7 +96,7 @@ Zstring ShadowCopy::makeShadowCopy(const Zstring& inputFile, const std::function //try to resolve symlinks and junctions: //1. symlinks: we need to retrieve the target path, else we would just return a symlink on a VSS volume while the target outside were still locked! - //2. junctions: C:\Users\<username> is a junction that may link to e.g. D:\Users\<username>, so GetVolumePathName() returns "D:\" => "Volume name %x not part of file name %y!" + //2. junctions: C:\Users\<username> is a junction that may link to e.g. D:\Users\<username>, so GetVolumePathName() returns "D:\" => "Volume name %x not part of file name %y." if (wereVistaOrLater) filenameFinal = getResolvedFilePath(inputFile); //throw FileError; requires Vista or later! //-> returns paths with \\?\ prefix! => make sure to avoid duplicate shadow copies for volume paths with/without prefix @@ -106,7 +106,7 @@ Zstring ShadowCopy::makeShadowCopy(const Zstring& inputFile, const std::function if (!::GetVolumePathName(filenameFinal.c_str(), //__in LPCTSTR lpszFileName, &volBuffer[0], //__out LPTSTR lpszVolumePathName, bufferSize)) //__in DWORD cchBufferLength - throw FileError(replaceCpy(_("Path %x does not contain a volume name."), L"%x", fmtFileName(filenameFinal))); + throw FileError(replaceCpy(_("Cannot determine volume name for %x."), L"%x", fmtFileName(filenameFinal)), formatSystemError(L"GetVolumePathName", ::GetLastError())); const Zstring volumeNamePf = appendSeparator(&volBuffer[0]); //msdn: if buffer is 1 char too short, GetVolumePathName() may skip last separator without error! @@ -114,7 +114,7 @@ Zstring ShadowCopy::makeShadowCopy(const Zstring& inputFile, const std::function const size_t pos = filenameFinal.find(volumeNamePf); //filenameFinal needs NOT to begin with volumeNamePf: consider for example \\?\ prefix! if (pos == Zstring::npos) { - std::wstring msg = _("Volume name %x not part of file name %y!"); + std::wstring msg = _("Volume name %x not part of file name %y."); replace(msg, L"%x", fmtFileName(volumeNamePf), false); replace(msg, L"%y", fmtFileName(filenameFinal), false); throw FileError(msg); |