Allow Windows Service to Interact with Desktop

Allow service to interact with desktop - Windows Service to communicate with OPC Server

CreateService will report that error if the service type parameter is not set correctly:

If you specify either SERVICE_WIN32_OWN_PROCESS or
SERVICE_WIN32_SHARE_PROCESS, and the service is running in the context
of the LocalSystem account, you can also specify the following value:
SERVICE_INTERACTIVE_PROCESS

Alternative to Allow service to interact with desktop ?

If you are using Vista and later and you don't really need any interaction with the user, but have an interactive exe to execute, the Session 0 isolation feature should help alleviate some of the concerns about the 'bad practice' on having a service interact with the desktop (which in Session 0 has no physical console).

This Session 0 isolation would prevent unprivileged users from performing Shatter Attacks on your service as they get their interactive desktops in different sessions. Shatter attacks are the main reason why this 'interaction with desktop' was considered bad practice and if you are using Vista or later, it should be ok if you cannot avoid it (or will have to spend too much effort to do it).

So, if things are working fine as they are, you are probably ok.

Of course, after an OS update, things might just stop working, so it is probably better to prepare to move the dependency on interactivity out, as you don't really need it.



Related Topics



Leave a reply



Submit