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
.
精彩评论