in src/main/cpp/bootstrap/utilsfuncs.cpp [34:56]
bool disableFolderVirtualization(HANDLE hProcess) {
OSVERSIONINFO osvi = {0};
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
if (GetVersionEx(&osvi) && osvi.dwMajorVersion == 6) // check it is Win VISTA
{
HANDLE hToken;
if (OpenProcessToken(hProcess, TOKEN_ALL_ACCESS, &hToken)) {
DWORD tokenInfoVal = 0;
if (!SetTokenInformation(hToken, (TOKEN_INFORMATION_CLASS) 24, &tokenInfoVal, sizeof (DWORD))) {
// invalid token information class (24) is OK, it means there is no folder virtualization on current system
if (GetLastError() != ERROR_INVALID_PARAMETER) {
logErr(true, true, "Failed to set token information.");
return false;
}
}
CloseHandle(hToken);
} else {
logErr(true, true, "Failed to open process token.");
return false;
}
}
return true;
}