Refer to: Determine the Process ID of the Client Process communicating with a COM RPC Server
I think you cannot get the identifier of the process.
Geting the ProcessID of the client that makes COM call running as dllSurrogate?
I am kind of new to COM and had a query. We have registered a COM DLL as DLLSurrogate to run under default dllhost.exe.
We have an app/3rd party app that is consuming this COM, and when we try to get the current process id it is returning the process id of dllhost.exe and not the app.
Is there a way to get the process id of the client that made the COM call (app)?
2 answers
Sort by: Most helpful
-
Song Zhu - MSFT 906 Reputation points
2021-04-16T07:18:15.97+00:00 -
RLWA32 40,656 Reputation points
2021-04-17T17:21:02.537+00:00 An out-of-process COM server handling an incoming call from a COM client can use the RpcServerInqCallAttributes function and request RPC_QUERY_CLIENT_PID in the RPC_CALL_ATTRIBUTES_V2 struct that is passed to the function.