title: How to get process id of other endpoint in inter-process communication
body: <p>Using Win32 C++ API, I would like to known which <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574%28v=vs.85%29.aspx" rel="nofollow">IPC method</a>, allows any end-point in a multi-process communication, to get the PID or HANDLE of the process which it is communicating with. In other words, if process A gets a message from process B:</p>
  
  <ul>
  <li>Can A know that B sent the message, without B (directly) giving any hint about it inside the message which was sent? How? </li>
  <li><strong>REQUIREMENT:</strong> PID of B cannot be sent to A inside an IPC message.</li>
  </ul>
  
  <p>The purpose of the communication is a simple remote procedure call. However, I don't want processes on remote systems/hosts calling the procedures offered by process running on the local host. </p>
  
  <p>Of course I have found the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa378651%28v=vs.85%29.aspx" rel="nofollow">RPC documentation on MSDN</a>. However, I'm wondering if there are better ways than RPC of achieving what I want. Or, if you think RPC is the way to go, can you please tell me why and if you know of any other good references to learn from other than MSDN?</p>