https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2d47c3be2987662333573…
commit 2d47c3be2987662333573b65051f498f92d90dc3
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sat Oct 13 00:20:58 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Oct 13 20:30:07 2018 +0200
[CRT] spawn: define a unicode environment when needed
CORE-9182
---
sdk/lib/crt/process/process.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/sdk/lib/crt/process/process.c b/sdk/lib/crt/process/process.c
index f607c2eed3..ef6ad4d8fa 100644
--- a/sdk/lib/crt/process/process.c
+++ b/sdk/lib/crt/process/process.c
@@ -203,6 +203,7 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const
_TCHAR* env
BOOL bResult;
DWORD dwExitCode;
DWORD dwError;
+ DWORD dwFlags = 0;
TRACE(MK_STR(do_spawnT)"(%i,'%"sT"','%"sT"','%"sT"')",mode,cmdname,args,envp);
@@ -286,12 +287,20 @@ do_spawnT(int mode, const _TCHAR* cmdname, const _TCHAR* args, const
_TCHAR* env
create_io_inherit_block(&StartupInfo.cbReserved2, &StartupInfo.lpReserved2);
+ if (mode == _P_DETACH)
+ {
+ dwFlags |= DETACHED_PROCESS;
+ }
+#ifdef _UNICODE
+ dwFlags |= CREATE_UNICODE_ENVIRONMENT;
+#endif
+
bResult = CreateProcess((_TCHAR *)cmdname,
(_TCHAR *)args,
NULL,
NULL,
TRUE,
- mode == _P_DETACH ? DETACHED_PROCESS : 0,
+ dwFlags,
(LPVOID)envp,
NULL,
&StartupInfo,