Commit 8f690d51 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

rpcrt4: Fail with CO_E_OBJNOTCONNECTED when trying to call methods on a disconnected proxy.

parent ead21a1b
...@@ -1203,7 +1203,9 @@ static void test_marshal_proxy_apartment_shutdown(void) ...@@ -1203,7 +1203,9 @@ static void test_marshal_proxy_apartment_shutdown(void)
{ {
HRESULT hr; HRESULT hr;
IStream *pStream = NULL; IStream *pStream = NULL;
IUnknown *pProxy = NULL; IClassFactory *proxy;
IUnknown *unk;
ULONG ref;
DWORD tid; DWORD tid;
HANDLE thread; HANDLE thread;
...@@ -1218,7 +1220,7 @@ static void test_marshal_proxy_apartment_shutdown(void) ...@@ -1218,7 +1220,7 @@ static void test_marshal_proxy_apartment_shutdown(void)
ok_non_zero_external_conn(); ok_non_zero_external_conn();
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL); IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy); hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&proxy);
ok_ole_success(hr, CoUnmarshalInterface); ok_ole_success(hr, CoUnmarshalInterface);
IStream_Release(pStream); IStream_Release(pStream);
...@@ -1231,7 +1233,11 @@ static void test_marshal_proxy_apartment_shutdown(void) ...@@ -1231,7 +1233,11 @@ static void test_marshal_proxy_apartment_shutdown(void)
ok_zero_external_conn(); ok_zero_external_conn();
ok_last_release_closes(TRUE); ok_last_release_closes(TRUE);
IUnknown_Release(pProxy); hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IUnknown, (void **)&unk);
ok(hr == CO_E_OBJNOTCONNECTED, "got %#x\n", hr);
ref = IClassFactory_Release(proxy);
ok(!ref, "got %d refs\n", ref);
ok_no_locks(); ok_no_locks();
......
...@@ -458,6 +458,8 @@ void WINAPI NdrProxyInitialize(void *This, ...@@ -458,6 +458,8 @@ void WINAPI NdrProxyInitialize(void *This,
TRACE("(%p,%p,%p,%p,%d)\n", This, pRpcMsg, pStubMsg, pStubDescriptor, ProcNum); TRACE("(%p,%p,%p,%p,%d)\n", This, pRpcMsg, pStubMsg, pStubDescriptor, ProcNum);
NdrClientInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor, ProcNum); NdrClientInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor, ProcNum);
StdProxy_GetChannel(This, &pStubMsg->pRpcChannelBuffer); StdProxy_GetChannel(This, &pStubMsg->pRpcChannelBuffer);
if (!pStubMsg->pRpcChannelBuffer)
RpcRaiseException(CO_E_OBJNOTCONNECTED);
IRpcChannelBuffer_GetDestCtx(pStubMsg->pRpcChannelBuffer, IRpcChannelBuffer_GetDestCtx(pStubMsg->pRpcChannelBuffer,
&pStubMsg->dwDestContext, &pStubMsg->dwDestContext,
&pStubMsg->pvDestContext); &pStubMsg->pvDestContext);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment