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

This commit is contained in:
Rob Shearman 2007-03-27 18:15:41 +01:00 committed by Alexandre Julliard
parent 5de163f9d4
commit d6a435fc56
4 changed files with 12 additions and 7 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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");