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

前端 未结 3 1497
鱼传尺愫
鱼传尺愫 2021-01-02 03:54

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

相关标签:
3条回答
  • 2021-01-02 04:17

    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.

    0 讨论(0)
  • 2021-01-02 04:28

    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.

    0 讨论(0)
  • 2021-01-02 04:40

    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

    0 讨论(0)
提交回复
热议问题