Alexandre Julliard : kernel32: GetTempPath should try the USERPROFILE and the Windows directory too.

Alexandre Julliard julliard at winehq.org
Thu Sep 13 07:17:18 CDT 2007


Module: wine
Branch: master
Commit: 0a134e9e3f614dc88341c3c79f6a939216a76583
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0a134e9e3f614dc88341c3c79f6a939216a76583

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Sep 12 16:52:59 2007 +0200

kernel32: GetTempPath should try the USERPROFILE and the Windows directory too.

---

 dlls/kernel32/path.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
index 7932df0..7681880 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)
     {




More information about the wine-cvs mailing list