[3/5] ole32: Store destination context data in channel buffer

Nikolay Sivov nsivov at codeweavers.com
Mon Oct 15 06:47:35 CDT 2012


Store destination context data in channel buffer
-------------- next part --------------
>From 225fd013f171efd6bf716f2e13bc92eb2f137ed3 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sun, 14 Oct 2012 10:50:05 -0400
Subject: [PATCH 4/6] Store destination context data in channel buffer

---
 dlls/ole32/rpc.c |   25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c
index 12c6bb0..9fd863d 100644
--- a/dlls/ole32/rpc.c
+++ b/dlls/ole32/rpc.c
@@ -96,6 +96,9 @@ typedef struct
 {
     IRpcChannelBuffer IRpcChannelBuffer_iface;
     LONG refs;
+
+    DWORD dest_context; /* returned from GetDestCtx */
+    void *dest_context_data; /* returned from GetDestCtx */
 } RpcChannelBuffer;
 
 typedef struct
@@ -105,8 +108,6 @@ 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 */
 } ClientRpcChannelBuffer;
 
@@ -1041,20 +1042,22 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetDestCtx(LPRPCCHANNELBUFFER iface
 
     TRACE("(%p,%p)\n", pdwDestContext, ppvDestContext);
 
-    *pdwDestContext = This->dest_context;
-    *ppvDestContext = This->dest_context_data;
+    *pdwDestContext = This->super.dest_context;
+    *ppvDestContext = This->super.dest_context_data;
 
     return S_OK;
 }
 
-static HRESULT WINAPI ServerRpcChannelBuffer_GetDestCtx(LPRPCCHANNELBUFFER iface, DWORD* pdwDestContext, void** ppvDestContext)
+static HRESULT WINAPI ServerRpcChannelBuffer_GetDestCtx(LPRPCCHANNELBUFFER iface, DWORD* dest_context, void** dest_context_data)
 {
-    WARN("(%p,%p), stub!\n", pdwDestContext, ppvDestContext);
+    RpcChannelBuffer *This = (RpcChannelBuffer *)iface;
+
+    WARN("(%p,%p), stub!\n", dest_context, dest_context_data);
 
     /* FIXME: implement this by storing the dwDestContext and pvDestContext
      * values passed into IMarshal_MarshalInterface and returning them here */
-    *pdwDestContext = MSHCTX_DIFFERENTMACHINE;
-    *ppvDestContext = NULL;
+    *dest_context = This->dest_context;
+    *dest_context_data = This->dest_context_data;
     return S_OK;
 }
 
@@ -1144,11 +1147,11 @@ HRESULT RPC_CreateClientChannel(const OXID *oxid, const IPID *ipid,
 
     This->super.IRpcChannelBuffer_iface.lpVtbl = &ClientRpcChannelBufferVtbl;
     This->super.refs = 1;
+    This->super.dest_context = dest_context;
+    This->super.dest_context_data = dest_context_data;
     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;
 
     *chan = &This->super.IRpcChannelBuffer_iface;
@@ -1164,6 +1167,8 @@ HRESULT RPC_CreateServerChannel(IRpcChannelBuffer **chan)
 
     This->IRpcChannelBuffer_iface.lpVtbl = &ServerRpcChannelBufferVtbl;
     This->refs = 1;
+    This->dest_context = MSHCTX_DIFFERENTMACHINE;
+    This->dest_context_data = NULL;
     
     *chan = &This->IRpcChannelBuffer_iface;
 
-- 
1.7.10.4




More information about the wine-patches mailing list