Commit ad8ef99f authored by Gerard Patel's avatar Gerard Patel Committed by Alexandre Julliard

Fix the cmdline argument passed to NE_CreateThread to include string

length.
parent ff1d7282
...@@ -1110,7 +1110,8 @@ HINSTANCE16 NE_StartMain( LPCSTR name, HANDLE file ) ...@@ -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 ) ...@@ -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 );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment