I can't find documentation for how to do it, which makes me think I'm not supposed to do it.
+3
A:
No, svchost.exe is undocumented and only supported for services that are part of Windows.
Part of the reason is reliability - a crash in a 3rd party service should have no effect on a critical Windows service.
Why do you want to use svchost? Do you have several services that you want to combine together? Creating your own exe to host multiple services is pretty straightforward.
Michael
2009-05-11 19:19:07
True, but its not because of reliability, because you can host different services in separate instances of svchost.exe (MS does this).
DSO
2009-05-11 22:01:37
The presumption is that 3rd party code may be less reliability that Windows provided services.
Michael
2009-05-11 22:13:03
One thing to consider: Because svchost is internal to Windows, the API contract for hosted services can (and has) changed without warning. Your app WILL break if you choose to go down this route. You'd be better off writing your own service host.
Larry Osterman
2009-05-12 01:33:55
+1
A:
You can download the windows NT resource kit (http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en), and follow these instructions to create a service out of anything: http://support.microsoft.com/kb/137890
Kevlar
2009-05-11 19:45:09