Problems with RPC communication

Hello together,

I´m try to get a communication between a process written in c++ and a process written in c#.
Each Processes have a RPC Server ans a RPC Client.

The following situation exists:
It´s possibel to start a correct RPC communication between 2 processen written in C++.
And it´s also possible to start a correctly RPC communication between 2 processes written in C#.

It´s not possible to start a correctly RPC communication between a process written in c++ and a process written in c#.

The error accours in the function "NdrGetBuffer(,,)".
The client use this function for getting a pointer from the RPC server to send the requiered datas.

I don´t no how shall I do now.
Is there anyting to setup in user settings?

Can someone help me?
Thank You very much.
Fujitsufan
Are the two processes on the same machine? Because trust me, it's ALWAYS DNS, or the firewall.

Is this a compile time, or runtime error?

What IS the error?
Hell Computergeek01,

sorry for my delay.

It´s a runtime error.
But why does the commucation word between 2 processes written in c#.
And why does the communication work between 2 processes written in c++.

For initialization the server in c++ and c# I use diverent dlls.
But in the dlls there are the same winapi functions using.
fRpcStatus = RpcServerRegisterIf(RpcClientWrite_ServerIfHandle, // interface to register fRpcStatus = RpcServerUseProtseqEpW( (RPC_WSTR)pszProtocolSequence, cMaxCalls, (RPC_WSTR)pszEndpoint, pszSecurity); //Parameter 4 "pszSecurity" used only for "ncacn_np" and "ncalrpc" protocol sequences fRpcStatus = RpcServerRegisterAuthInfoW((RPC_WSTR)pszNetworkAddress, RPC_C_AUTHN_GSS_NEGOTIATE, NULL, NULL);
for example.

For initialization the client the same.
lRpcStatus = RpcStringBindingComposeW(pszUuid, (RPC_WSTR)pszProtocolSequence, (RPC_WSTR)pszNetworkAddress, (RPC_WSTR)pszEndpoint, pszOptions, &pszStringBinding); lRpcStatus = RpcBindingFromStringBindingW( pszStringBinding, &hRpcClientWrite ); lRpcStatus = RpcBindingSetAuthInfoW(hRpcClientWrite, (RPC_WSTR)pszNetworkAddress, RPC_C_PROTECT_LEVEL_PKT_PRIVACY, RPC_C_AUTHN_GSS_NEGOTIATE, nullptr, NULL);

By initialization I use the same protocoll, endpoint and computer name.

No error accours.
An nothing happens.

What I can tell is that if the server is not running, the client tries to send it times out. This is not the case if the server is active.

My question is.
Is it at all possible to establish an RPC communication from a process that is written in c ++ to a process that is written in c #?

Many Thanks.
Greetings from Fujitsufan





Is it at all possible to establish an RPC communication from a process that is written in c ++ to a process that is written in c #?


Sorry about my delay. The answer here is yes and it happens everyday. I believe C# uses B_STR's by default for it's text. This will drastically change the size of the buffer that the C++ client is setting aside. If you make the buffer on the C++ client arbitrarily large and the message from the C# client very tiny, do you see a crash?
Topic archived. No new replies allowed.