From 636725f2f02027bf6282f35035b4c2abc5ef97c4 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Fri, 7 Mar 2003 20:34:55 +0000 Subject: [PATCH] Fixed regression in sub-process creation. --- programs/wineconsole/wineconsole.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index 60e0fe0de94..08781956d5f 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -658,6 +658,9 @@ static BOOL WINECON_Spawn(struct inner_data* data, LPWSTR cmdLine) CloseHandle(startup.hStdOutput); CloseHandle(startup.hStdError); + CloseHandle(info.hProcess); + CloseHandle(info.hThread); + return done; } @@ -742,14 +745,9 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, INT nCmdSh break; case from_process_name: { - const char* src; - LPWSTR dst; WCHAR buffer[256]; - src = wci.ptr; dst = buffer; - while (*src && *src != ' ' && (dst - buffer < sizeof(buffer) / sizeof(WCHAR) - 1)) - *dst++ = *src++; - *dst = 0; + MultiByteToWideChar(CP_ACP, 0, wci.ptr, -1, buffer, sizeof(buffer) / sizeof(buffer[0])); if (!(data = WINECON_Init(hInst, GetCurrentProcessId(), buffer, wci.backend))) return 0;