(Windows) Fixed the symbolic link support.

This commit is contained in:
Leon Styhre 2021-03-15 17:18:33 +01:00
parent 9c82b6cf38
commit f35e3c2e65

View file

@ -526,22 +526,20 @@ namespace Utils
std::string resolved; std::string resolved;
#if defined(_WIN64) #if defined(_WIN64)
std::wstring resolvedW;
HANDLE hFile = CreateFileW(Utils::String::stringToWideString(path).c_str(), HANDLE hFile = CreateFileW(Utils::String::stringToWideString(path).c_str(),
FILE_READ_ATTRIBUTES, FILE_SHARE_READ, FILE_READ_ATTRIBUTES, FILE_SHARE_READ, 0,
0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0);
// TEMPORARY, will need to fix this later. if (hFile != INVALID_HANDLE_VALUE) {
// if (hFile != INVALID_HANDLE_VALUE) { resolvedW.resize(GetFinalPathNameByHandleW(hFile, nullptr, 0,
// resolved.resize(GetFinalPathNameByHandle(hFile, nullptr, 0, FILE_NAME_NORMALIZED) + 1);
// resolved.resize(GetFinalPathNameByHandle(hFile, nullptr, 0, if (GetFinalPathNameByHandleW(hFile, const_cast<LPWSTR>(resolvedW.data()),
// FILE_NAME_NORMALIZED) + 1); static_cast<DWORD>(resolvedW.size()), FILE_NAME_NORMALIZED) > 0) {
// if (GetFinalPathNameByHandle(hFile, (LPSTR)resolved.data(), resolvedW.resize(resolvedW.size() - 1);
// if (GetFinalPathNameByHandle(hFile, (LPSTR)resolved.data(), resolved = getGenericPath(Utils::String::wideStringToString(resolvedW));
// (DWORD)resolved.size(), FILE_NAME_NORMALIZED) > 0) { }
// resolved.resize(resolved.size() - 1); CloseHandle(hFile);
// resolved = getGenericPath(resolved); }
// }
// CloseHandle(hFile);
// }
#else #else
struct stat info; struct stat info;