diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:54:58 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:54:58 +0200 |
commit | bb807ea0fd605c486bb7ec928ad8edc819ec9c2b (patch) | |
tree | 16fdbd4d91a290d43444dd812720c42948b27754 /zen/symlink_target.h | |
parent | 6.14 (diff) | |
download | FreeFileSync-bb807ea0fd605c486bb7ec928ad8edc819ec9c2b.tar.gz FreeFileSync-bb807ea0fd605c486bb7ec928ad8edc819ec9c2b.tar.bz2 FreeFileSync-bb807ea0fd605c486bb7ec928ad8edc819ec9c2b.zip |
6.15
Diffstat (limited to 'zen/symlink_target.h')
-rw-r--r-- | zen/symlink_target.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/symlink_target.h b/zen/symlink_target.h index 1a7f45bd..9239385a 100644 --- a/zen/symlink_target.h +++ b/zen/symlink_target.h @@ -164,7 +164,7 @@ Zstring getResolvedFilePath_impl(const Zstring& linkPath) //throw FileError throw FileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtFileName(linkPath)), replaceCpy(_("Cannot find system function %x."), L"%x", L"\"GetFinalPathNameByHandleW\"")); - const HANDLE hDir = ::CreateFile(applyLongPathPrefix(linkPath).c_str(), //_In_ LPCTSTR lpFileName, + const HANDLE hFile = ::CreateFile(applyLongPathPrefix(linkPath).c_str(), //_In_ LPCTSTR lpFileName, 0, //_In_ DWORD dwDesiredAccess, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, //_In_ DWORD dwShareMode, nullptr, //_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, @@ -172,16 +172,16 @@ Zstring getResolvedFilePath_impl(const Zstring& linkPath) //throw FileError //needed to open a directory: FILE_FLAG_BACKUP_SEMANTICS, //_In_ DWORD dwFlagsAndAttributes, nullptr); //_In_opt_ HANDLE hTemplateFile - if (hDir == INVALID_HANDLE_VALUE) + if (hFile == INVALID_HANDLE_VALUE) throwFileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtFileName(linkPath)), L"CreateFile", getLastError()); - ZEN_ON_SCOPE_EXIT(::CloseHandle(hDir)); + ZEN_ON_SCOPE_EXIT(::CloseHandle(hFile)); - const DWORD bufferSize = getFinalPathNameByHandle(hDir, nullptr, 0, 0); + const DWORD bufferSize = getFinalPathNameByHandle(hFile, nullptr, 0, 0); if (bufferSize == 0) throwFileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtFileName(linkPath)), L"GetFinalPathNameByHandle", getLastError()); std::vector<wchar_t> targetPath(bufferSize); - const DWORD charsWritten = getFinalPathNameByHandle(hDir, //__in HANDLE hFile, + const DWORD charsWritten = getFinalPathNameByHandle(hFile, //__in HANDLE hFile, &targetPath[0], //__out LPTSTR lpszFilePath, bufferSize, //__in DWORD cchFilePath, 0); //__in DWORD dwFlags |