From: Kevin Puetz PuetzKevinA@JohnDeere.com
windows does not call MessagePending for DDE/RPC messages, but wine does. I'm not sure how this is supposed to be distinguished, since MessagePending call is also supposed to happen before the message is pumped, so we don't actually even know what message woke up MsgWaitForMultipleObjectsEx.
This same behavior is already seen in the existing test which uses cowait_unmarshal_thread (also todo_wine, in MessageFilter_MessagePending) This additional test shows that the (mis-)behavior also affects DDE. --- dlls/ole32/tests/compobj.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index 8467e86a66f..5aeddbd809e 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -2611,6 +2611,14 @@ static DWORD CALLBACK post_message_thread(LPVOID arg) return 0; }
+static DWORD CALLBACK post_dde_later_thread(LPVOID arg) +{ + HWND hWnd = arg; + Sleep(50); + PostMessageA(hWnd, WM_DDE_FIRST, 0, 0); + return 0; +} + static const char cls_name[] = "cowait_test_class";
static UINT cowait_msgs[100], cowait_msgs_first, cowait_msgs_last; @@ -2769,6 +2777,7 @@ static DWORD CALLBACK test_CoWaitForMultipleHandles_thread(LPVOID arg) hr = CoRegisterMessageFilter(&MessageFilter, NULL); ok(hr == S_OK, "CoRegisterMessageFilter failed: %08lx\n", hr);
+ /* See todo_wine in MessageFilter_MessagePending; RPC/DDE messages shouldn't be triggering it */ thread = CreateThread(NULL, 0, cowait_unmarshal_thread, stream, 0, &tid); ok(thread != NULL, "CreateThread failed, error %lu\n", GetLastError()); hr = CoWaitForMultipleHandles(0, 50, 1, &event, &index); @@ -2778,6 +2787,14 @@ static DWORD CALLBACK test_CoWaitForMultipleHandles_thread(LPVOID arg) ok(index == WAIT_OBJECT_0, "cowait_unmarshal_thread didn't finish\n"); CloseHandle(thread);
+ thread = CreateThread(NULL, 0, post_dde_later_thread, hWnd, 0, &tid); + hr = CoWaitForMultipleHandles(0, 50, 1, &thread, &index); + ok(hr == RPC_S_CALLPENDING, "expected RPC_S_CALLPENDING, got 0x%08lx\n", hr); + hr = CoWaitForMultipleHandles(0, 200, 1, &thread, &index); + ok(hr == S_OK, "expected S_OK, got 0x%08lx\n", hr); + ok(index == WAIT_OBJECT_0, "post_dde_later_thread didn't finish\n"); + CloseHandle(thread); + hr = CoRegisterMessageFilter(NULL, NULL); ok(hr == S_OK, "CoRegisterMessageFilter failed: %08lx\n", hr);