From fff6db62f389f4e6bf974b67926409b84d762faa Mon Sep 17 00:00:00 2001 From: "Kirill K. Smirnov" Date: Wed, 25 Apr 2007 11:39:02 +0400 Subject: [PATCH] kernel32: Add partial stub for NeedCurrentDirectoryForExePath. --- dlls/kernel32/kernel32.spec | 2 ++ dlls/kernel32/path.c | 37 +++++++++++++++++++++++++++++++++++++ include/winbase.h | 3 +++ 3 files changed, 42 insertions(+) diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index a675386e0c1..4d3d083908d 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -799,6 +799,8 @@ @ stdcall MoveFileWithProgressW(wstr wstr ptr ptr long) @ stdcall MulDiv(long long long) @ stdcall MultiByteToWideChar(long long str long ptr long) +@ stdcall NeedCurrentDirectoryForExePathA(str) +@ stdcall NeedCurrentDirectoryForExePathW(wstr) # @ stub NlsConvertIntegerToString # @ stub NlsGetCacheUpdateCount # @ stub NlsResetProcessLocale diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index b195435f521..eb752f0c326 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -1510,6 +1510,43 @@ UINT WINAPI GetSystemWow64DirectoryA( LPSTR lpBuffer, UINT uSize ) } +/*********************************************************************** + * NeedCurrentDirectoryForExePathW (KERNEL32.@) + */ +BOOL WINAPI NeedCurrentDirectoryForExePathW( LPCWSTR name ) +{ + static const WCHAR env_name[] = {'N','o','D','e','f','a','u','l','t', + 'C','u','r','r','e','n','t', + 'D','i','r','e','c','t','o','r','y', + 'I','n','E','x','e','P','a','t','h',0}; + WCHAR env_val; + + /* MSDN mentions some 'registry location'. We do not use registry. */ + FIXME("(%s): partial stub\n", debugstr_w(name)); + + if (strchrW(name, '\\')) + return TRUE; + + /* Check the existence of the variable, not value */ + if (!GetEnvironmentVariableW( env_name, &env_val, 1 )) + return TRUE; + + return FALSE; +} + + +/*********************************************************************** + * NeedCurrentDirectoryForExePathA (KERNEL32.@) + */ +BOOL WINAPI NeedCurrentDirectoryForExePathA( LPCSTR name ) +{ + WCHAR *nameW; + + if (!(nameW = FILE_name_AtoW( name, FALSE ))) return TRUE; + return NeedCurrentDirectoryForExePathW( nameW ); +} + + /*********************************************************************** * wine_get_unix_file_name (KERNEL32.@) Not a Windows API * diff --git a/include/winbase.h b/include/winbase.h index 59e7718cee8..da9c547bacd 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -1839,6 +1839,9 @@ BOOL WINAPI MoveFileWithProgressA(LPCSTR,LPCSTR,LPPROGRESS_ROUTINE,LPVOID BOOL WINAPI MoveFileWithProgressW(LPCWSTR,LPCWSTR,LPPROGRESS_ROUTINE,LPVOID,DWORD); #define MoveFileWithProgress WINELIB_NAME_AW(MoveFileWithProgress) INT WINAPI MulDiv(INT,INT,INT); +BOOL WINAPI NeedCurrentDirectoryForExePathA(LPCSTR); +BOOL WINAPI NeedCurrentDirectoryForExePathW(LPCWSTR); +#define NeedCurrentDirectoryForExePath WINELIB_NAME_AW(NeedCurrentDirectoryForExePath) BOOL WINAPI NotifyChangeEventLog(HANDLE,HANDLE); BOOL WINAPI ObjectCloseAuditAlarmA(LPCSTR,LPVOID,BOOL); BOOL WINAPI ObjectCloseAuditAlarmW(LPCWSTR,LPVOID,BOOL);