From 038c8e642a8871e9454fc7b709d1bd00b5a36d6b Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Sat, 23 Dec 2006 15:50:07 +0000 Subject: [PATCH] ole32: Call the MessagePending function for message filters. --- dlls/ole32/compobj.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 4a88390dfa7..81236c78365 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -34,8 +34,6 @@ * - Implement the OXID resolver so we don't need magic endpoint names for * clients and servers to meet up * - * - Call IMessageFilter functions. - * * - Make all ole interface marshaling use NDR to be wire compatible with * native DCOM * - Use & interpret ORPCTHIS & ORPCTHAT. @@ -2720,9 +2718,6 @@ HRESULT WINAPI CoRegisterMessageFilter( else if (lpOldMessageFilter) IMessageFilter_Release(lpOldMessageFilter); - if (lpMessageFilter) - FIXME("message filter has been registered, but will not be used\n"); - return S_OK; } @@ -3191,6 +3186,32 @@ HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout, { MSG msg; + /* call message filter */ + + if (COM_CurrentApt()->filter) + { + DWORD be_handled = IMessageFilter_MessagePending( + COM_CurrentApt()->filter, 0 /* FIXME */, + now - start_time, + COM_CurrentInfo()->pending_call_count ? PENDINGTYPE_NESTED : PENDINGTYPE_TOPLEVEL); + TRACE("IMessageFilter_MessagePending returned %d\n", be_handled); + switch (be_handled) + { + case PENDINGMSG_CANCELCALL: + WARN("call canceled\n"); + hr = RPC_E_CALL_CANCELED; + break; + case PENDINGMSG_WAITNOPROCESS: + case PENDINGMSG_WAITDEFPROCESS: + default: + /* FIXME: MSDN is very vague about the difference + * between WAITNOPROCESS and WAITDEFPROCESS - there + * appears to be none, so it is possibly a left-over + * from the 16-bit world. */ + break; + } + } + /* note: using "if" here instead of "while" might seem less * efficient, but only if we are optimising for quick delivery * of pending messages, rather than quick completion of the