<div>Hi <span style="line-height: 1.5;">Sebastian,</span></div><div><span style="line-height: 1.5;"><br></span></div><div>I tested your current <span style="line-height: 1.5;">work-in-progress patch:</span></div>https://github.com/wine-compholio/wine-staging/blob/master/patches/ole32-CoWaitForMultipleHandles/0001-ole32-tests-Add-additional-tests-for-CoWaitForMultip.patch<div><div><br></div><div>I have two puzzles about these code:</div><div>>       index = 0xdeadbeef;</div><div>>       PostMessageA(hWnd, WM_DDE_FIRST, 0, 0);</div><div>>       PostQuitMessage(44);</div><div>>       thread = CreateThread(NULL, 0, post_message_thread, hWnd, 0, &tid);</div><div>>       ok(thread != NULL, "CreateThread failed, error %u\n", GetLastError());</div><div>>       hr = CoWaitForMultipleHandles(0, 100, 2, handles, &index);</div><div>>       ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08x\n", hr);</div><div>>       ok(index == 0 || broken(index == 0xdeadbeef) /* Win 8 */, "expected index 0, got %u\n", index);</div><div>>       success = PeekMessageA(&msg, hWnd, WM_DDE_FIRST, WM_DDE_FIRST, PM_REMOVE);</div><div>>       ok(success, "PeekMessageA failed, error %u\n", GetLastError());</div><div><div><br></div><div>The first, why use the PeekMessage to check if received a <span style="line-height: 1.5;">WM_DDE_FIRST </span><span style="line-height: 1.5;">message?</span></div><div>Is there an real application do like that way?</div><div><br></div><div>In fact CoWaitForMultipleHandles has a message loop, the WM_DDE_FIRST message has been</div><div>dispatched to the window's WNDPROC. So the PeekMessageA certainly failed. </div><div><br></div><div>I think the correct test should be this: </div><div>1, Define a custom WNDPROC function named cowait_test_wnd_proc .</div><div>2, Define a global int variable named g_count_of_wm_dde_first.</div><div>3, Set the value of g_count_of_wm_dde_first to zero before call CoWaitForMultipleHandles.</div><div>4, <span style="line-height: 1.5;">Increase the value of g_count_of_wm_dde_first by one, o</span><span style="line-height: 1.5;">nce received a WM_DDE_FIRST </span><span style="line-height: 1.5;">message in cowait_test_wnd_proc.</span></div><div>5, Check if the value of g_count_of_wm_dde_first is equal to 2 after<span style="line-height: 1.5;"> CoWaitForMultipleHandles returned.</span><span style="line-height: 1.5;"> </span></div><div><br></div><div>The second  is why use todo_wine ?</div><div>        todo_wine</div><div>        ok(!success, "PeekMessageA succeeded\n");</div><div>why not just write?</div><div>        ok(!success, "PeekMessageA succeeded\n"); </div></div></div><div><br></div><div>Thank you.</div><div><br></div><div><sign signid="0"><div style="color:#909090;font-family:Arial Narrow;font-size:12px"><br><br><br><br>------------------</div><div style="font-size:14px;font-family:Verdana;color:#000;"><div>Regards.</div>
</div></sign></div><div> </div><div><includetail><div> </div><div> </div><div style="font:Verdana normal 14px;color:#000;"><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div id="menu_sender"><b>From: </b> "Sebastian Lackner"<sebastian@fds-team.de>;</div><div><b>Date: </b> Fri, Dec 12, 2014 11:57 AM</div><div><b>To: </b> "Changhui Liu"<liuchanghui@linuxdeepin.com>; <wbr></div><div><b>Cc: </b> "wine-devel"<wine-devel@winehq.org>; <wbr></div><div><b>Subject: </b> Re: ole32:fix CoWaitForMultipleHandles cause RPC hang</div></div><div> </div>On 12.12.2014 04:36, Changhui Liu wrote:<br>> Hi, I modified my patch, it has passed test on <br>> https://testbot.winehq.org/JobDetails.pl?Key=10745&log_202=1#k202<br>> <br>> <br>> My test aims to reproduce the bug.<br>>  <br>>  <br><br>Sorry, but this patch is still not sufficient, it doesn't cover all situations how WM_QUIT messages are handled. As you can easily test with my current work-in-progress patch<br>https://github.com/wine-compholio/wine-staging/blob/master/patches/ole32-CoWaitForMultipleHandles/0001-ole32-tests-Add-additional-tests-for-CoWaitForMultip.patch<br>your suggested fix breaks other stuff (which was working fine before), and so is most likely not correct.<br><br>I am not even sure if the problem is really in ole32, it might also be possible that the real problem is in the user32 message handling or probably somewhere else - but the only way to find that out is to write additional tests. Just testing this specific use-case will not be enough to justify a change, which might break other apps. ;)<br><br>Regards,<br>Sebastian<br></div><!--<![endif]--></includetail></div>