diff options
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 |