5 #include "../Common/StringConvert.h"
\r
13 namespace NWindows {
\r
15 static UString GetQuotedString(const UString &s)
\r
17 return UString(L'\"') + s + UString(L'\"');
\r
20 WRes CProcess::Create(LPCWSTR imageName, const UString ¶ms, LPCWSTR curDir)
\r
23 const UString params2 =
\r
25 GetQuotedString(imageName) + L' ' +
\r
33 PROCESS_INFORMATION pi;
\r
49 curDirA = GetSystemString(curDir);
\r
50 result = ::CreateProcessA(NULL, (LPSTR)(LPCSTR)GetSystemString(params2),
\r
51 NULL, NULL, FALSE, 0, NULL, ((curDir != 0) ? (LPCSTR)curDirA: 0), &si, &pi);
\r
65 result = CreateProcessW(imageName, (LPWSTR)(LPCWSTR)params2,
\r
66 NULL, NULL, FALSE, 0, NULL, (LPWSTR)curDir, &si, &pi);
\r
69 return ::GetLastError();
\r
70 ::CloseHandle(pi.hThread);
\r
71 _handle = pi.hProcess;
\r
75 WRes MyCreateProcess(LPCWSTR imageName, const UString ¶ms)
\r
78 return process.Create(imageName, params, 0);
\r