ole32: Track the pending call count so that the correct call type can be passed to the message filter HandleInComingCall function.

oldstable
Rob Shearman 2006-12-23 15:49:47 +00:00 committed by Alexandre Julliard
parent d3217872b3
commit aca17cd120
2 changed files with 8 additions and 1 deletions

View File

@ -169,6 +169,7 @@ struct oletls
IUnknown *state; /* see CoSetState */
DWORD inits; /* number of times CoInitializeEx called */
GUID causality_id; /* unique identifier for each COM call */
LONG pending_call_count; /* number of calls pending */
};

View File

@ -983,10 +983,14 @@ void RPC_ExecuteCall(struct dispatch_params *params)
interface_info.pUnk = params->iface;
interface_info.iid = params->iid;
interface_info.wMethod = msg->ProcNum;
if (IsEqualGUID(&orpcthis.cid, &COM_CurrentInfo()->causality_id))
calltype = CALLTYPE_NESTED;
else /* FIXME: also detect CALLTYPE_TOPLEVEL_CALLPENDING */
else if (COM_CurrentInfo()->pending_call_count == 0)
calltype = CALLTYPE_TOPLEVEL;
else
calltype = CALLTYPE_TOPLEVEL_CALLPENDING;
handlecall = IMessageFilter_HandleInComingCall(COM_CurrentApt()->filter,
calltype,
(HTASK)GetCurrentProcessId(),
@ -1019,7 +1023,9 @@ void RPC_ExecuteCall(struct dispatch_params *params)
* this call - this should be checked with what Windows does */
old_causality_id = COM_CurrentInfo()->causality_id;
COM_CurrentInfo()->causality_id = orpcthis.cid;
COM_CurrentInfo()->pending_call_count++;
params->hr = IRpcStubBuffer_Invoke(params->stub, params->msg, params->chan);
COM_CurrentInfo()->pending_call_count--;
COM_CurrentInfo()->causality_id = old_causality_id;
message_state = (struct message_state *)msg->Handle;