Francois Gouget : kernel32: Only get the Windows directory if PROFILE_Open( ) needs it.

Alexandre Julliard julliard at winehq.org
Wed Mar 30 13:15:42 CDT 2011


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

Author: Francois Gouget <fgouget at free.fr>
Date:   Wed Mar 30 16:43:36 2011 +0200

kernel32: Only get the Windows directory if PROFILE_Open() needs it.

---

 dlls/kernel32/profile.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c
index 26c6736..a2bd5b5 100644
--- a/dlls/kernel32/profile.c
+++ b/dlls/kernel32/profile.c
@@ -734,7 +734,6 @@ static BOOL is_not_current(FILETIME * ft)
  */
 static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
 {
-    WCHAR windirW[MAX_PATH];
     WCHAR buffer[MAX_PATH];
     HANDLE hFile = INVALID_HANDLE_VALUE;
     FILETIME LastWriteTime;
@@ -757,8 +756,6 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
           ZeroMemory(&MRUProfile[i]->LastWriteTime, sizeof(FILETIME));
        }
 
-    GetWindowsDirectoryW( windirW, MAX_PATH );
-
     if (!filename)
 	filename = wininiW;
 
@@ -766,6 +763,8 @@ static BOOL PROFILE_Open( LPCWSTR filename, BOOL write_access )
         !strchrW(filename, '\\') && !strchrW(filename, '/'))
     {
         static const WCHAR wszSeparator[] = {'\\', 0};
+        WCHAR windirW[MAX_PATH];
+        GetWindowsDirectoryW( windirW, MAX_PATH );
         strcpyW(buffer, windirW);
         strcatW(buffer, wszSeparator);
         strcatW(buffer, filename);




More information about the wine-cvs mailing list