How To Initialize COM Impersonation for Surrogate Server running as different user?

413 Views Asked by At

I have an application running as a user other than the logged on user. I have a COM server in dllhost.exe that runs under the logged on user's credentials. How can I set COM security on the client so that I am able to talk to the server? I get a E_ACCESSDENIED (0x80070005) when I try to create and instance of the object. Here are the details: I have a COM component that is run under the standard surrogate (dllhost.exe) with AppID{GUID}\RunAs set to "interactive user".

The client is running as a different user and calls CCO. At this point, I can confirm that the DCOM service launches dllhost.exe and creates the server. However, due to difference in credentials of the client and server, CCO returns 0x80070005. I have also tried setting the thread (token) on which the CCO is called to the same credentials as that of the COM server (dllhost), it still fails.

I understand I can use COM cloaking to negotiate the security, however, its not very clear. I want to make sure that it only calls to this component that is impersonated and not for all COM calls in the process. Any help will be appreciated.

0

There are 0 best solutions below