Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to kill NT-Service?

Status
Not open for further replies.

ZakiMaksyutov

Programmer
Feb 28, 2001
87
RU
I write NT-Service.
Now It works not well.
So It hangs down sometimes. After this of course I can't stop it from "Services". And also I can't stop it via taskmanager.
Thanks for any help.
 
There are two functions, TerminateProcess and TerminateJobObject. They aer declared in winbase.h, so you have to include windows.h. If you don't have right to terminate them, functons will fail. Win95/95 don't support theese functions. John Fill
1c.bmp


ivfmd@mail.md
 
I can get handle of service process, but I can't terminate it by TeminateProcess because I don't have rights: service Log On As LocalSystem and I don't.
I overcame this restriction by following way: I wrote another service which have one interface with one method.
I can invoke this method from client and then my service terminate another service. In this case all is ok because my service also log on as LocalSystem.

But my question is: how to write program which logging on as LocalSystem and terminate another service. In other words do the same without creating auxiliary service?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top