Kaydet (Commit) a01a4f68 authored tarafından Enrico Tröger's avatar Enrico Tröger

Make CreateChildProcess() working with Unicode strings, e.g. directory names (closes 2972606).

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4779 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 809a37dd
2010-03-20 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/win32.c:
Make CreateChildProcess() working with Unicode strings, e.g.
directory names (closes 2972606).
2010-03-19 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/stash.c:
......
......@@ -1007,9 +1007,11 @@ gchar *win32_expand_environment_variables(const gchar *str)
static gboolean CreateChildProcess(geany_win32_spawn *gw_spawn, TCHAR *szCmdline, const TCHAR *dir, GError **error)
{
PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo;
STARTUPINFOW siStartInfo;
BOOL bFuncRetn = FALSE;
gchar *expandedCmdline;
wchar_t w_commandline[MAX_PATH];
wchar_t w_dir[MAX_PATH];
/* Set up members of the PROCESS_INFORMATION structure. */
ZeroMemory(&piProcInfo, sizeof(PROCESS_INFORMATION));
......@@ -1026,15 +1028,18 @@ static gboolean CreateChildProcess(geany_win32_spawn *gw_spawn, TCHAR *szCmdline
/* Expand environment variables like %blah%. */
expandedCmdline = win32_expand_environment_variables(szCmdline);
MultiByteToWideChar(CP_UTF8, 0, expandedCmdline, -1, w_commandline, sizeof(w_commandline));
MultiByteToWideChar(CP_UTF8, 0, dir, -1, w_dir, sizeof(w_dir));
/* Create the child process. */
bFuncRetn = CreateProcess(NULL,
expandedCmdline, /* command line */
bFuncRetn = CreateProcessW(NULL,
w_commandline, /* command line */
NULL, /* process security attributes */
NULL, /* primary thread security attributes */
TRUE, /* handles are inherited */
CREATE_NO_WINDOW, /* creation flags */
NULL, /* use parent's environment */
dir, /* use parent's current directory */
w_dir, /* use parent's current directory */
&siStartInfo, /* STARTUPINFO pointer */
&piProcInfo); /* receives PROCESS_INFORMATION */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment