Fix the cmdline argument passed to NE_CreateThread to include string
length.
This commit is contained in:
parent
ff1d7282e4
commit
ad8ef99f57
|
@ -1110,7 +1110,8 @@ HINSTANCE16 NE_StartMain( LPCSTR name, HANDLE file )
|
||||||
STARTUPINFOA info;
|
STARTUPINFOA info;
|
||||||
HMODULE16 hModule;
|
HMODULE16 hModule;
|
||||||
NE_MODULE *pModule;
|
NE_MODULE *pModule;
|
||||||
LPSTR cmdline = GetCommandLineA();
|
INT len;
|
||||||
|
LPSTR pCmdLine, cmdline = GetCommandLineA();
|
||||||
|
|
||||||
if ((hModule = NE_LoadExeHeader( file, name )) < 32) return hModule;
|
if ((hModule = NE_LoadExeHeader( file, name )) < 32) return hModule;
|
||||||
|
|
||||||
|
@ -1123,10 +1124,17 @@ HINSTANCE16 NE_StartMain( LPCSTR name, HANDLE file )
|
||||||
|
|
||||||
while (*cmdline && *cmdline != ' ') cmdline++;
|
while (*cmdline && *cmdline != ' ') cmdline++;
|
||||||
if (*cmdline) cmdline++;
|
if (*cmdline) cmdline++;
|
||||||
|
len = strlen(cmdline);
|
||||||
|
pCmdLine = HeapAlloc(GetProcessHeap(), 0, len+2);
|
||||||
|
if (pCmdLine)
|
||||||
|
{
|
||||||
|
strcpy(pCmdLine+1, cmdline);
|
||||||
|
*pCmdLine = len;
|
||||||
|
}
|
||||||
GetStartupInfoA( &info );
|
GetStartupInfoA( &info );
|
||||||
if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = 1;
|
if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = 1;
|
||||||
|
|
||||||
return NE_CreateThread( pModule, info.wShowWindow, cmdline );
|
return NE_CreateThread( pModule, info.wShowWindow, pCmdLine );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue