Zebediah Figura : ole32: Use the real proxy IID in ClientRpcChannelBuffer_GetBuffer().

Alexandre Julliard julliard at winehq.org
Sun Mar 3 13:21:26 CST 2019


Module: wine
Branch: oldstable
Commit: b180ddc466e93c01e6ca9def7d48b75ce91b09b1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=b180ddc466e93c01e6ca9def7d48b75ce91b09b1

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Sep 13 11:01:13 2018 -0500

ole32: Use the real proxy IID in ClientRpcChannelBuffer_GetBuffer().

Delegated proxies pass the IID of the parent interface to
NdrProxyGetBuffer(). However, this interface was never registered with ole32
on the server side, so calls to delegated methods will return
RPC_S_UNKNOWN_IF. Therefore we have ole32 ignore the passed-in parameter and
use the real proxy ID.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45673
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 904d1688a37197fe7f0c7c23f4491bc8320a79c7)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/ole32/compobj_private.h | 2 +-
 dlls/ole32/marshal.c         | 2 +-
 dlls/ole32/rpc.c             | 6 ++++--
 dlls/rpcrt4/tests/cstub.c    | 2 --
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h
index 0f10a7c..ea75330 100644
--- a/dlls/ole32/compobj_private.h
+++ b/dlls/ole32/compobj_private.h
@@ -208,7 +208,7 @@ struct dispatch_params;
 
 void    RPC_StartRemoting(struct apartment *apt) DECLSPEC_HIDDEN;
 HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid,
-                                const OXID_INFO *oxid_info,
+                                const OXID_INFO *oxid_info, const IID *iid,
                                 DWORD dest_context, void *dest_context_data,
                                 IRpcChannelBuffer **chan) DECLSPEC_HIDDEN;
 HRESULT RPC_CreateServerChannel(DWORD dest_context, void *dest_context_data, IRpcChannelBuffer **chan) DECLSPEC_HIDDEN;
diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index b39dac0..b52eea5 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -1285,7 +1285,7 @@ static HRESULT unmarshal_object(const STDOBJREF *stdobjref, APARTMENT *apt,
         {
             IRpcChannelBuffer *chanbuf;
             hr = RPC_CreateClientChannel(&stdobjref->oxid, &stdobjref->ipid,
-                                         &proxy_manager->oxid_info,
+                                         &proxy_manager->oxid_info, riid,
                                          proxy_manager->dest_context,
                                          proxy_manager->dest_context_data,
                                          &chanbuf);
diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c
index 8d8276e..2e9e694 100644
--- a/dlls/ole32/rpc.c
+++ b/dlls/ole32/rpc.c
@@ -109,6 +109,7 @@ typedef struct
     OXID                   oxid; /* apartment in which the channel is valid */
     DWORD                  server_pid; /* id of server process */
     HANDLE                 event; /* cached event handle */
+    IID                    iid; /* IID of the proxy this belongs to */
 } ClientRpcChannelBuffer;
 
 struct dispatch_params
@@ -650,7 +651,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
 
     cif->Length = sizeof(RPC_CLIENT_INTERFACE);
     /* RPC interface ID = COM interface ID */
-    cif->InterfaceId.SyntaxGUID = *riid;
+    cif->InterfaceId.SyntaxGUID = This->iid;
     /* COM objects always have a version of 0.0 */
     cif->InterfaceId.SyntaxVersion.MajorVersion = 0;
     cif->InterfaceId.SyntaxVersion.MinorVersion = 0;
@@ -1092,7 +1093,7 @@ static const IRpcChannelBufferVtbl ServerRpcChannelBufferVtbl =
 
 /* returns a channel buffer for proxies */
 HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid,
-                                const OXID_INFO *oxid_info,
+                                const OXID_INFO *oxid_info, const IID *iid,
                                 DWORD dest_context, void *dest_context_data,
                                 IRpcChannelBuffer **chan)
 {
@@ -1151,6 +1152,7 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid,
     apartment_getoxid(COM_CurrentApt(), &This->oxid);
     This->server_pid = oxid_info->dwPid;
     This->event = NULL;
+    This->iid = *iid;
 
     *chan = &This->super.IRpcChannelBuffer_iface;
 
diff --git a/dlls/rpcrt4/tests/cstub.c b/dlls/rpcrt4/tests/cstub.c
index b0a8db7..2b8026c 100644
--- a/dlls/rpcrt4/tests/cstub.c
+++ b/dlls/rpcrt4/tests/cstub.c
@@ -1403,10 +1403,8 @@ static void test_delegated_methods(void)
     ok(ret == 9, "got %d\n", ret);
 
     hr = ITest1_GetClassID(test_obj, &clsid);
-todo_wine {
     ok(hr == S_OK, "got %#x\n", hr);
     ok(IsEqualGUID(&clsid, &CLSID_test1), "got %s\n", wine_dbgstr_guid(&clsid));
-}
 
     ITest1_Release(test_obj);
 




More information about the wine-cvs mailing list