From 9fb82b83b5a387ea5aec58f83a67f405e0336d71 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 16 Oct 2008 17:40:39 +0000 Subject: [PATCH] ebl Fix CreateProcessW bug, still have a problem with accent and spaces git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7819 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/compat/compat.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index 7725aa27ec..f88114938b 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -1847,7 +1847,7 @@ GetApplicationName(const char *cmdline, char **pexe, const char **pargs) } /** - * Create the process with UTF8 API + * Create the process with WCHAR API */ static BOOL CreateChildProcessW(const char *comspec, const char *cmdLine, @@ -1873,11 +1873,11 @@ CreateChildProcessW(const char *comspec, const char *cmdLine, POOLMEM *cmdLine_wchar = get_pool_memory(PM_FNAME); POOLMEM *comspec_wchar = get_pool_memory(PM_FNAME); - make_win32_path_UTF8_2_wchar(&cmdLine_wchar, cmdLine); - make_win32_path_UTF8_2_wchar(&comspec_wchar, comspec); + UTF8_2_wchar(&cmdLine_wchar, cmdLine); + UTF8_2_wchar(&comspec_wchar, comspec); // Create the child process. - Dmsg2(150, "Calling CreateProcess(%s, %s, ...)\n", comspec, cmdLine); + Dmsg2(150, "Calling CreateProcess(%s, %s, ...)\n", comspec_wchar, cmdLine_wchar); // try to execute program bFuncRetn = p_CreateProcessW((WCHAR*)comspec_wchar, @@ -1890,7 +1890,6 @@ CreateChildProcessW(const char *comspec, const char *cmdLine, NULL, // use parent's current directory &siStartInfo, // STARTUPINFO pointer hProcInfo); // receives PROCESS_INFORMATION - free_pool_memory(cmdLine_wchar); free_pool_memory(comspec_wchar); @@ -1983,7 +1982,7 @@ CreateChildProcess(const char *cmdline, HANDLE in, HANDLE out, HANDLE err) free(exeFile); // New function disabled - if (false && p_CreateProcessW && p_MultiByteToWideChar) { + if (p_CreateProcessW && p_MultiByteToWideChar) { bFuncRetn = CreateChildProcessW(comspec, cmdLine.c_str(), &piProcInfo, in, out, err); } else { -- 2.39.5