[host] service: pass CREATE_UNICODE_ENVIRONMENT unconditionally

According to MSDN documentation for CreateEnvironmentBlock, "[i]f the
environment block is passed to CreateProcessAsUser, you must also
specify the CREATE_UNICODE_ENVIRONMENT flag."

Also pass DETACHED_PROCESS because the host is a GUI application and
doesn't use the console.
This commit is contained in:
Quantum 2021-07-19 07:07:56 -04:00 committed by Geoffrey McRae
parent ebda52b18b
commit b4dc021381

View File

@ -221,9 +221,7 @@ void Launch(void)
goto fail_token;
}
DWORD flags = CREATE_NEW_CONSOLE | HIGH_PRIORITY_CLASS;
if (!pEnvironment)
flags |= CREATE_UNICODE_ENVIRONMENT;
DWORD flags = DETACHED_PROCESS | HIGH_PRIORITY_CLASS | CREATE_UNICODE_ENVIRONMENT;
PROCESS_INFORMATION pi = {0};
STARTUPINFO si =