0

I have the following situation: my application, a service, instantiates a DCOM server (exe) using CoInitialize and CreateInstance in order to get its interface pointer, it is working fine on XP but since this server creates a GUI it doesn't work on Windows 7 because a service (session 0) doesn't have permission to access the user's screen.

So, my question is how can I change my code to start the COM server as the logged user?

I was thinking on instead using CreateInstance I could use CreateProcessAsUser to start the DCOM server as the logged user, but I have no idea how I could get the interface pointer from the created process. Do you have any idea? Thanks!

  • I don't believe you can - that would defeat the point of session 0 isolation. Besides, there ain't no such thing as **the** logged user - there may be none, or more than one. – Igor Tandetnik Apr 17 '14 at 23:22
  • Server is started the way it is set up with system, which can be "Interactive User". This is unlikely to resolve your problem (with session 0 and UI) though. You might want to `CoCreateInstance` an in-process server, which is going to have normal UI access, and then internally it will communicate to service server for non-UI data requests. – Roman R. Apr 21 '14 at 07:14

0 Answers0