From: Jacek Caban jacek@codeweavers.com
--- tools/tools.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/tools.h b/tools/tools.h index 39441cb0ea6..69c976df0bf 100644 --- a/tools/tools.h +++ b/tools/tools.h @@ -56,6 +56,8 @@ # define strncasecmp _strnicmp # define strcasecmp _stricmp # endif +# include <windef.h> +# include <winbase.h> #else extern char **environ; # include <spawn.h> @@ -706,7 +708,10 @@ static inline char *get_bindir( const char *argv0 ) if (!dir && !(dir = realpath( argv0, NULL ))) return NULL; return get_dirname( dir ); #else - return get_dirname( argv0 ); + char path[MAX_PATH], *p; + GetModuleFileNameA( NULL, path, ARRAYSIZE(path) ); + for (p = path; *p; p++) if (*p == '\') *p = '/'; + return get_dirname( path ); #endif }