removed command line limit

This commit is contained in:
mrexodia 2017-04-20 10:58:43 +02:00
parent 0f7e664a4a
commit 239df37a5e
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 7 additions and 3 deletions

View File

@ -61,6 +61,7 @@ __declspec(dllexport) void* TITCALL InitDebugW(wchar_t* szFileName, wchar_t* szC
} }
wchar_t* szFileNameCreateProcess; wchar_t* szFileNameCreateProcess;
wchar_t* szCommandLineCreateProcess; wchar_t* szCommandLineCreateProcess;
std::wstring createWithCmdLine;
if(szCommandLine == NULL || !lstrlenW(szCommandLine)) if(szCommandLine == NULL || !lstrlenW(szCommandLine))
{ {
szCommandLineCreateProcess = 0; szCommandLineCreateProcess = 0;
@ -68,9 +69,12 @@ __declspec(dllexport) void* TITCALL InitDebugW(wchar_t* szFileName, wchar_t* szC
} }
else else
{ {
wchar_t szCreateWithCmdLine[1024]; createWithCmdLine.push_back('\"');
wsprintfW(szCreateWithCmdLine, L"\"%s\" %s", szFileName, szCommandLine); createWithCmdLine.append(szFileName);
szCommandLineCreateProcess = szCreateWithCmdLine; createWithCmdLine.push_back('\"');
createWithCmdLine.push_back(' ');
createWithCmdLine.append(szCommandLine);
szCommandLineCreateProcess = (wchar_t*)createWithCmdLine.c_str();
szFileNameCreateProcess = 0; szFileNameCreateProcess = 0;
} }
if(CreateProcessW(szFileNameCreateProcess, szCommandLineCreateProcess, NULL, NULL, false, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS | DebugConsoleFlag | CREATE_NEW_CONSOLE, NULL, szCurrentFolder, &dbgStartupInfo, &dbgProcessInformation)) if(CreateProcessW(szFileNameCreateProcess, szCommandLineCreateProcess, NULL, NULL, false, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS | DebugConsoleFlag | CREATE_NEW_CONSOLE, NULL, szCurrentFolder, &dbgStartupInfo, &dbgProcessInformation))