E_ACCESSDENIED exception when attaching to an event in a COM server from .NET

357 views Asked by At

I have a C++/ATL COM server that implements IConnectionPoint events. My client is a C# application that attaches to the events. When the COM server is created as a SYSTEM service, the client can properly attach to the event. When the COM server is created as a LocalService service (preferred), then I get an E_ACCESSDENIED exception when I attach to the event.

What can I do to get the events to work when the COM server is LocalService?

Thanks.

1

There are 1 answers

0
Poodlehat On

You'll need to find what user the LocalService is attemping to use, and ensure that user has access. If you can't adjust access for the whole computer, you may have to do it programatically using CoInitializeSecurity and using an identity that is known to have access.

Refer to http://msdn.microsoft.com/en-us/library/ms679760(v=VS.85).aspx for more information.