diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index e29a7ae0df8..026390f6120 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -1185,6 +1185,13 @@ xCall(LPVOID retptr, int method, TMProxyImpl *tpinfo /*, args */) return E_FAIL; } + if (!tpinfo->chanbuf) + { + WARN("Tried to use disconnected proxy\n"); + LeaveCriticalSection(&tpinfo->crit); + return RPC_E_DISCONNECTED; + } + if (relaydeb) { TRACE_(olerelay)("->"); if (iname) diff --git a/dlls/rpcrt4/ndr_midl.c b/dlls/rpcrt4/ndr_midl.c index a1822f543d5..1aa6aae7d3b 100644 --- a/dlls/rpcrt4/ndr_midl.c +++ b/dlls/rpcrt4/ndr_midl.c @@ -100,6 +100,13 @@ void WINAPI NdrProxySendReceive(void *This, HRESULT hr; TRACE("(%p,%p)\n", This, pStubMsg); + + if (!pStubMsg->pRpcChannelBuffer) + { + WARN("Trying to use disconnected proxy %p\n", This); + RpcRaiseException(RPC_E_DISCONNECTED); + } + pStubMsg->dwStubPhase = PROXY_SENDRECEIVE; hr = IRpcChannelBuffer_SendReceive(pStubMsg->pRpcChannelBuffer, (RPCOLEMESSAGE*)pStubMsg->RpcMsg,