Commit df6b7324 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ole32: Use queried interface destination context for marshaling RemQueryInterface result.

parent d1a480a2
...@@ -73,7 +73,8 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s ...@@ -73,7 +73,8 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s
struct ifstub *stub; struct ifstub *stub;
HRESULT hr; HRESULT hr;
TRACE("oid=%s, stubbuffer=%p, iid=%s\n", wine_dbgstr_longlong(m->oid), sb, debugstr_guid(iid)); TRACE("oid=%s, stubbuffer=%p, iid=%s, dest_context=%x\n", wine_dbgstr_longlong(m->oid), sb,
debugstr_guid(iid), dest_context);
stub = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct ifstub)); stub = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct ifstub));
if (!stub) return NULL; if (!stub) return NULL;
...@@ -704,18 +705,23 @@ static HRESULT WINAPI RemUnknown_RemQueryInterface(IRemUnknown *iface, ...@@ -704,18 +705,23 @@ static HRESULT WINAPI RemUnknown_RemQueryInterface(IRemUnknown *iface,
USHORT successful_qis = 0; USHORT successful_qis = 0;
APARTMENT *apt; APARTMENT *apt;
struct stub_manager *stubmgr; struct stub_manager *stubmgr;
struct ifstub *ifstub;
DWORD dest_context;
void *dest_context_data;
TRACE("(%p)->(%s, %d, %d, %p, %p)\n", iface, debugstr_guid(ripid), cRefs, cIids, iids, ppQIResults); TRACE("(%p)->(%s, %d, %d, %p, %p)\n", iface, debugstr_guid(ripid), cRefs, cIids, iids, ppQIResults);
hr = ipid_to_stub_manager(ripid, &apt, &stubmgr); hr = ipid_to_ifstub(ripid, &apt, &stubmgr, &ifstub);
if (hr != S_OK) return hr; if (hr != S_OK) return hr;
IRpcChannelBuffer_GetDestCtx(ifstub->chan, &dest_context, &dest_context_data);
*ppQIResults = CoTaskMemAlloc(sizeof(REMQIRESULT) * cIids); *ppQIResults = CoTaskMemAlloc(sizeof(REMQIRESULT) * cIids);
for (i = 0; i < cIids; i++) for (i = 0; i < cIids; i++)
{ {
HRESULT hrobj = marshal_object(apt, &(*ppQIResults)[i].std, &iids[i], HRESULT hrobj = marshal_object(apt, &(*ppQIResults)[i].std, &iids[i],
stubmgr->object, MSHCTX_DIFFERENTMACHINE, NULL, MSHLFLAGS_NORMAL); stubmgr->object, dest_context, dest_context_data, MSHLFLAGS_NORMAL);
if (hrobj == S_OK) if (hrobj == S_OK)
successful_qis++; successful_qis++;
(*ppQIResults)[i].hResult = hrobj; (*ppQIResults)[i].hResult = hrobj;
......
...@@ -449,7 +449,6 @@ static HRESULT WINAPI RpcStubBuffer_Invoke(IRpcStubBuffer *iface, RPCOLEMESSAGE ...@@ -449,7 +449,6 @@ static HRESULT WINAPI RpcStubBuffer_Invoke(IRpcStubBuffer *iface, RPCOLEMESSAGE
hr = IRpcChannelBuffer_GetDestCtx(_pRpcChannelBuffer, &dest_context, &dest_context_data); hr = IRpcChannelBuffer_GetDestCtx(_pRpcChannelBuffer, &dest_context, &dest_context_data);
ok(hr == S_OK, "GetDestCtx failed: %08x\n", hr); ok(hr == S_OK, "GetDestCtx failed: %08x\n", hr);
todo_wine
ok(dest_context == MSHCTX_INPROC, "desc_context = %x\n", dest_context); ok(dest_context == MSHCTX_INPROC, "desc_context = %x\n", dest_context);
ok(!dest_context_data, "desc_context_data = %p\n", dest_context_data); ok(!dest_context_data, "desc_context_data = %p\n", dest_context_data);
...@@ -1295,9 +1294,7 @@ static void test_marshal_channel_buffer(void) ...@@ -1295,9 +1294,7 @@ static void test_marshal_channel_buffer(void)
SET_EXPECT(Invoke); SET_EXPECT(Invoke);
SET_EXPECT(GetWindow); SET_EXPECT(GetWindow);
hr = IOleWindow_GetWindow(ole_window, &hwnd); hr = IOleWindow_GetWindow(ole_window, &hwnd);
todo_wine
ok(hr == S_OK, "GetWindow failed: %08x\n", hr); ok(hr == S_OK, "GetWindow failed: %08x\n", hr);
todo_wine
ok(hwnd == (HWND)0xdeadbeef, "hwnd = %p\n", hwnd); ok(hwnd == (HWND)0xdeadbeef, "hwnd = %p\n", hwnd);
CHECK_CALLED(Invoke); CHECK_CALLED(Invoke);
CHECK_CALLED(GetWindow); CHECK_CALLED(GetWindow);
......
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