Quote Originally Posted by Shaitan00 View Post
this all works perfectly fine right now, using Windows 2000 and XP - but will this cause problem when migrating to VISTA and Windows7?
Listen, how can we tell without seeing your app? Why don't you compile it and run it on Vista and see for yourself? Then if you can't figure it out, isolate the code chunk that's causing the issue and post it here.

From my personal experience, simply assuming that something will run under Vista/Win7 is a gross underestimation (otherwise Microsoft wouldn't lose a good portion of its followers to Apple). To be honest with you none of my "serious" coding projects worked smoothly under Vista when I first ported them from XP.

As for a service to be able to run under Vista, it probably will, (and this is my generalization only) since it will still be running under session 0, and as long as it doesn't rely on interacting with a desktop (uses SERVICE_INTERACTIVE_PROCESS flag during its creation, or sends messages to windows) it will probably still run. Read more here.

The problem usually happens with a client app, that doesn't run under session 0 anymore, like it used to under XP, and you may start having problems with it performing some administrative tasks, that should've been moved to a service in the first place, or, most certainly in a way it communicates with the service if you opted to use any method other than the one recommended by MSDN (i.e. named pipes, COM, maybe some others, like mail slots and sockets).

As for ControlService(), it will probably work if you manage to get a handle to the service. For that make sure you specify the minimum required access flags when you call OpenSCManager() and OpenService().

One very rough way to see if your app will work under Vista (if you just happen to live in a place where Vista is totally inaccessible) is to run it under a Guest account in XP. If it doesn't work there, then expect some problems under Vista/Win7.