diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 7932df06b57..76818801af5 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -577,15 +577,17 @@ DWORD WINAPI GetTempPathW( DWORD count, LPWSTR path ) { static const WCHAR tmp[] = { 'T', 'M', 'P', 0 }; static const WCHAR temp[] = { 'T', 'E', 'M', 'P', 0 }; + static const WCHAR userprofile[] = { 'U','S','E','R','P','R','O','F','I','L','E',0 }; WCHAR tmp_path[MAX_PATH]; UINT ret; TRACE("%u,%p\n", count, path); - if (!(ret = GetEnvironmentVariableW( tmp, tmp_path, MAX_PATH ))) - if (!(ret = GetEnvironmentVariableW( temp, tmp_path, MAX_PATH ))) - if (!(ret = GetCurrentDirectoryW( MAX_PATH, tmp_path ))) - return 0; + if (!(ret = GetEnvironmentVariableW( tmp, tmp_path, MAX_PATH )) && + !(ret = GetEnvironmentVariableW( temp, tmp_path, MAX_PATH )) && + !(ret = GetEnvironmentVariableW( userprofile, tmp_path, MAX_PATH )) && + !(ret = GetWindowsDirectoryW( tmp_path, MAX_PATH ))) + return 0; if (ret > MAX_PATH) {