[PATCH] [Kernel32]: properly handle the case where wineconsole isn't properly started
Eric Pouech
eric.pouech at orange.fr
Sat Aug 29 07:42:13 CDT 2009
(used to hang indefinitely)
A+
---
dlls/kernel32/console.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 34994af..48bcfa4 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -1162,10 +1162,17 @@ static BOOL start_console_renderer_helper(const char* appname, STARTUPINFOA*
CreateProcessA(NULL, buffer, NULL, NULL, TRUE, DETACHED_PROCESS,
NULL, NULL, si, &pi))
{
+ HANDLE wh[2];
+ DWORD ret;
+
+ wh[0] = hEvent;
+ wh[1] = pi.hProcess;
+ ret = WaitForMultipleObjects(2, wh, FALSE, INFINITE);
+
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
- if (WaitForSingleObject(hEvent, INFINITE) != WAIT_OBJECT_0) return FALSE;
+ if (ret != WAIT_OBJECT_0) return FALSE;
TRACE("Started wineconsole pid=%08x tid=%08x\n",
pi.dwProcessId, pi.dwThreadId);
More information about the wine-patches
mailing list