From 998af35a3e587c8ce4a5f3fb130f9d942df72bda Mon Sep 17 00:00:00 2001 From: Akihiro Sagawa Date: Tue, 2 Jun 2015 01:22:09 +0900 Subject: [PATCH] mciqtz32: Watch the player thread while waiting a player task. --- dlls/mciqtz32/mciqtz.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c index 413c2f6a55e..d018a547e13 100644 --- a/dlls/mciqtz32/mciqtz.c +++ b/dlls/mciqtz32/mciqtz.c @@ -75,6 +75,8 @@ static LRESULT MCIQTZ_relayTaskMessage(DWORD_PTR dwDevID, UINT wMsg, { WINE_MCIQTZ *wma; LRESULT res; + HANDLE handles[2]; + DWORD ret; TRACE("(%08lX, %08x, %08x, %08lx)\n", dwDevID, wMsg, dwFlags, lpParms); wma = MCIQTZ_mciGetOpenDev(dwDevID); @@ -86,7 +88,11 @@ static LRESULT MCIQTZ_relayTaskMessage(DWORD_PTR dwDevID, UINT wMsg, wma->task.flags = dwFlags; wma->task.parms = lpParms; SetEvent(wma->task.notify); - if (WaitForSingleObject(wma->task.done, INFINITE) == WAIT_OBJECT_0) + handles[0] = wma->task.done; + handles[1] = wma->task.thread; + ret = WaitForMultipleObjects(sizeof(handles)/sizeof(handles[0]), handles, + FALSE, INFINITE); + if (ret == WAIT_OBJECT_0) res = wma->task.res; else res = MCIERR_INTERNAL;