mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
Core: Fixed various issues with unicode characters in commandline
git-svn-id: svn://ultimatepp.org/upp/trunk@12288 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
12135c17d3
commit
b5a9f67519
5 changed files with 67 additions and 59 deletions
|
|
@ -204,23 +204,11 @@ void LocalHost::Launch(const char *_cmdline, bool console)
|
|||
#ifdef PLATFORM_WIN32
|
||||
if(console)
|
||||
cmdline = GetExeFilePath() + " ! " + cmdline;
|
||||
int n = cmdline.GetLength() + 1;
|
||||
Buffer<char> cmd(n);
|
||||
memcpy(cmd, cmdline, n);
|
||||
SECURITY_ATTRIBUTES sa;
|
||||
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
|
||||
sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = TRUE;
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFO si;
|
||||
ZeroMemory(&si, sizeof(STARTUPINFO));
|
||||
si.cb = sizeof(STARTUPINFO);
|
||||
String ev = ToSystemCharset(environment);
|
||||
Buffer<char> env(ev.GetCount() + 1);
|
||||
memcpy(env, ev, ev.GetCount() + 1);
|
||||
if(CreateProcess(NULL, cmd, &sa, &sa, TRUE,
|
||||
NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE,
|
||||
~env, NULL, &si, &pi)) {
|
||||
STARTUPINFOW si;
|
||||
ZeroMemory(&si, sizeof(STARTUPINFOW));
|
||||
si.cb = sizeof(STARTUPINFOW);
|
||||
if(Win32CreateProcess(cmdline, ~environment, si, pi)) {
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue