Module: wine Branch: master Commit: df6b7324dfee383643b5913edb5bc8d544737292 URL: https://source.winehq.org/git/wine.git/?a=commit;h=df6b7324dfee383643b5913ed...
Author: Jacek Caban jacek@codeweavers.com Date: Thu May 24 13:23:29 2018 +0200
ole32: Use queried interface destination context for marshaling RemQueryInterface result.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Huw Davies huw@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ole32/stubmanager.c | 12 +++++++++--- dlls/ole32/tests/marshal.c | 3 --- 2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/ole32/stubmanager.c b/dlls/ole32/stubmanager.c index 451a58a..5f604d4 100644 --- a/dlls/ole32/stubmanager.c +++ b/dlls/ole32/stubmanager.c @@ -73,7 +73,8 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s struct ifstub *stub; 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)); if (!stub) return NULL; @@ -704,18 +705,23 @@ static HRESULT WINAPI RemUnknown_RemQueryInterface(IRemUnknown *iface, USHORT successful_qis = 0; APARTMENT *apt; 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);
- hr = ipid_to_stub_manager(ripid, &apt, &stubmgr); + hr = ipid_to_ifstub(ripid, &apt, &stubmgr, &ifstub); if (hr != S_OK) return hr;
+ IRpcChannelBuffer_GetDestCtx(ifstub->chan, &dest_context, &dest_context_data); + *ppQIResults = CoTaskMemAlloc(sizeof(REMQIRESULT) * cIids);
for (i = 0; i < cIids; 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) successful_qis++; (*ppQIResults)[i].hResult = hrobj; diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index 41d8717..e71cbdb 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -449,7 +449,6 @@ static HRESULT WINAPI RpcStubBuffer_Invoke(IRpcStubBuffer *iface, RPCOLEMESSAGE
hr = IRpcChannelBuffer_GetDestCtx(_pRpcChannelBuffer, &dest_context, &dest_context_data); 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_data, "desc_context_data = %p\n", dest_context_data);
@@ -1295,9 +1294,7 @@ static void test_marshal_channel_buffer(void) SET_EXPECT(Invoke); SET_EXPECT(GetWindow); hr = IOleWindow_GetWindow(ole_window, &hwnd); -todo_wine ok(hr == S_OK, "GetWindow failed: %08x\n", hr); -todo_wine ok(hwnd == (HWND)0xdeadbeef, "hwnd = %p\n", hwnd); CHECK_CALLED(Invoke); CHECK_CALLED(GetWindow);