Kwakkelflap: tools for the IT pro

Tuesday, April 17, 2007

HOWTO: Interactive service in Windows Vista

In previous Windows versions, all services run in the same session as the first user who logs on. This session is called session 0. Running services and user applications together in session 0 poses a security risk. In Windows Vista, only system processes and services run in session 0. Vista isolates services in session 0 and makes session 0 noninteractive. The user logs on to session 1, and runs applications in this session. Please refer to this article for a detailed explanation of services and session 0.

The result of this change is that an interactive service is not visible for a user. The service will be running, but you will not see the GUI. However, the user can switch to the session 0 desktop and interact with the service by using the following dialog:



When you click on "Show me the message" you will switch to session 0. Here you can see your interactive service:



Switch back by clicking "Return now".

Note that the "Interactive Services Detection Service" (UI0Detect) has to run before you can see this dialog, so make sure this service is running. The easiest way to do this, is to put this service in your service dependencies. Your service will not start if this service isn't running. Also, change the startup type for this service from 'Manual' to 'Automatic'.

Of course, you can't do much in session 0, so you might want to create a desktop for this session. Create a new interactive service in Service - O - Matic, and use "C:\Windows\Explorer.exe" as the program.



You might want to create a load order group for this service, so other interactive services will start this service automatically.



In your other service, change the service dependencies. Use "UI0Detect" as a service dependency, and the load order group created above as a service group dependency.



If you start your service, you can see the same message as before, but you will have a functioning desktop in session 0.

Labels: ,

2 Comments:

  • Good tutorial, thank you very much.

    On the other hand it didn't completely fix my problem. I'm trying to run Voicent Gateway, and the service is running fine. The problem is that it will not load the System tray icon for it. I'm thinking that it is using Interactive functions and that's why it's not coming up. If you have any suggestions please give it a try :)

    Cheers!

    By Blogger wil-, at 1:12 PM  

  • You should see the System tray icon in session 0 where you can have the user interface. You can see this in the last screenshot: Watchdog - O - Matic has it's system tray icon.

    By Blogger Wouter Dhondt, at 7:44 PM  

Post a Comment

<< Home