Can I use svchost.exe to host my own services?

天涯浪子 提交于 2019-11-29 18:25:46

问题


I can't find documentation for how to do it, which makes me think I'm not supposed to do it.


回答1:


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.




回答2:


Comment in this link will help you out, its too much to cut/paste here. Source is C++ as you didn't specify a language I dont think it will matter.

The Link

EDIT: For the record, I am not saying it's a good idea.




回答3:


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



来源:https://stackoverflow.com/questions/849613/can-i-use-svchost-exe-to-host-my-own-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!