Rob Shearman : ole32: Pass the OXID info to RPC_CreateClientChannel and use this to pass the server process ID to channel hooks .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Mar 28 06:41:50 CDT 2007


Module: wine
Branch: master
Commit: d6a435fc5653b890dadb3a0a8bf44a83d51f9b48
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d6a435fc5653b890dadb3a0a8bf44a83d51f9b48

Author: Rob Shearman <rob at codeweavers.com>
Date:   Tue Mar 27 18:15:41 2007 +0100

ole32: Pass the OXID info to RPC_CreateClientChannel and use this to pass the server process ID to channel hooks.

---

 dlls/ole32/compobj_private.h |    1 +
 dlls/ole32/marshal.c         |    1 +
 dlls/ole32/rpc.c             |   11 +++++++++--
 dlls/ole32/tests/marshal.c   |    6 +-----
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h
index ec51944..d99f41c 100644
--- a/dlls/ole32/compobj_private.h
+++ b/dlls/ole32/compobj_private.h
@@ -218,6 +218,7 @@ struct dispatch_params;
 
 void    RPC_StartRemoting(struct apartment *apt);
 HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid,
+                                const OXID_INFO *oxid_info,
                                 DWORD dest_context, void *dest_context_data,
                                 IRpcChannelBuffer **chan);
 HRESULT RPC_CreateServerChannel(IRpcChannelBuffer **chan);
diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c
index 0475ba5..120361a 100644
--- a/dlls/ole32/marshal.c
+++ b/dlls/ole32/marshal.c
@@ -1206,6 +1206,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->dest_context,
                                          proxy_manager->dest_context_data,
                                          &chanbuf);
diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c
index 60bd0d3..c7604b7 100644
--- a/dlls/ole32/rpc.c
+++ b/dlls/ole32/rpc.c
@@ -104,6 +104,7 @@ typedef struct
 
     RPC_BINDING_HANDLE     bind; /* handle to the remote server */
     OXID                   oxid; /* apartment in which the channel is valid */
+    DWORD                  server_pid; /* id of server process */
     DWORD                  dest_context; /* returned from GetDestCtx */
     LPVOID                 dest_context_data; /* returned from GetDestCtx */
     HANDLE                 event; /* cached event handle */
@@ -596,7 +597,7 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
     message_state->channel_hook_info.iid = *riid;
     message_state->channel_hook_info.cbSize = sizeof(message_state->channel_hook_info);
     message_state->channel_hook_info.uCausality = COM_CurrentCausalityId();
-    message_state->channel_hook_info.dwServerPid = 0; /* FIXME */
+    message_state->channel_hook_info.dwServerPid = This->server_pid;
     message_state->channel_hook_info.iMethod = msg->ProcNum;
     message_state->channel_hook_info.pObject = NULL; /* only present on server-side */
 
@@ -998,6 +999,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,
                                 DWORD dest_context, void *dest_context_data,
                                 IRpcChannelBuffer **chan)
 {
@@ -1007,7 +1009,7 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid,
     RPC_STATUS              status;
     LPWSTR                  string_binding;
 
-    /* connect to the apartment listener thread */
+    /* FIXME: get the endpoint from oxid_info->psa instead */
     get_rpc_endpoint(endpoint, oxid);
 
     TRACE("proxy pipe: connecting to endpoint: %s\n", debugstr_w(endpoint));
@@ -1052,6 +1054,7 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid,
     This->super.refs = 1;
     This->bind = bind;
     apartment_getoxid(COM_CurrentApt(), &This->oxid);
+    This->server_pid = oxid_info->dwPid;
     This->dest_context = dest_context;
     This->dest_context_data = dest_context_data;
     This->event = NULL;
@@ -1488,8 +1491,12 @@ void RPC_UnregisterInterface(REFIID riid)
     LeaveCriticalSection(&csRegIf);
 }
 
+/* get the info for an OXID, including the IPID for the rem unknown interface
+ * and the string binding */
 HRESULT RPC_ResolveOxid(OXID oxid, OXID_INFO *oxid_info)
 {
+    TRACE("%s\n", wine_dbgstr_longlong(oxid));
+
     oxid_info->dwTid = 0;
     oxid_info->dwPid = 0;
     oxid_info->dwAuthnHint = RPC_C_AUTHN_LEVEL_NONE;
diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c
index 0e588ba..c174429 100644
--- a/dlls/ole32/tests/marshal.c
+++ b/dlls/ole32/tests/marshal.c
@@ -2460,9 +2460,7 @@ static void WINAPI TestChannelHook_ClientGetSize(
     trace("\t%s method %d\n", debugstr_iid(riid), info->iMethod);
     trace("\tcid: %s\n", debugstr_iid(&info->uCausality));
     ok(info->cbSize == sizeof(*info), "info->cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info));
-    todo_wine {
     ok(info->dwServerPid == GetCurrentProcessId(), "info->dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
-    }
     ok(!info->pObject, "info->pObject should be NULL\n");
     ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n");
 
@@ -2479,9 +2477,7 @@ static void WINAPI TestChannelHook_ClientFillBuffer(
     SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid;
     trace("TestChannelHook_ClientFillBuffer\n");
     ok(info->cbSize == sizeof(*info), "info->cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info));
-    todo_wine {
     ok(info->dwServerPid == GetCurrentProcessId(), "info->dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
-    }
     ok(!info->pObject, "info->pObject should be NULL\n");
     ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n");
 
@@ -2501,8 +2497,8 @@ static void WINAPI TestChannelHook_ClientNotify(
     SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid;
     trace("TestChannelHook_ClientNotify hrFault = 0x%08x\n", hrFault);
     ok(info->cbSize == sizeof(*info), "info->cbSize was %d instead of %d\n", info->cbSize, (int)sizeof(*info));
-    todo_wine {
     ok(info->dwServerPid == GetCurrentProcessId(), "info->dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
+    todo_wine {
     ok(info->pObject != NULL, "info->pObject shouldn't be NULL\n");
     }
     ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n");




More information about the wine-cvs mailing list