开发者

How to disallow a windows service stop

I have some security开发者_如何学Go related service running on my machine (start type = automatic) In the service control manager, the stop/restart commands are grayed out.

I was wondering how can I develop such service for which the stop operation is disallowed.

Note that I am logged in as an administrator


All you need is to disallow your service to recieve stop requests.

  • If you are writing service in C/C++ you should not specify SERVICE_ACCEPT_STOP flag when calling SetServiceStatus (see SERVICE_STATUS for details).

  • If your are using .NET, set ServiceBase.CanStop to false.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜