mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 08:49:15 +00:00
wineconsole: Do not truncate argument strings larger than 256 bytes.
This commit is contained in:
parent
69047ed4f7
commit
0516d969eb
1 changed files with 13 additions and 2 deletions
|
@ -830,13 +830,24 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh
|
|||
break;
|
||||
case from_process_name:
|
||||
{
|
||||
WCHAR buffer[256];
|
||||
int len;
|
||||
WCHAR *buffer;
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, wci.ptr, -1, buffer, sizeof(buffer) / sizeof(buffer[0]));
|
||||
len = MultiByteToWideChar(CP_ACP, 0, wci.ptr, -1, NULL, 0);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, wci.ptr, -1, buffer, len);
|
||||
|
||||
if (!(data = WINECON_Init(hInst, GetCurrentProcessId(), buffer, wci.backend, nCmdShow)))
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
return 0;
|
||||
}
|
||||
ret = WINECON_Spawn(data, buffer);
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
if (!ret)
|
||||
{
|
||||
WINECON_Delete(data);
|
||||
|
|
Loading…
Reference in a new issue