Re: Kill remote Process(service)
- From: "Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx>
- Date: Wed, 9 Aug 2006 10:02:21 +0200
Did you allow your service to interact with desktop ( through services admin
tool ) , just a hint ?
Arkady
"Anton" <akhodakivskiy@xxxxxxxxx> wrote in message
news:1155051207.842862.223630@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Here is my code:
schSCManager = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS );
if (schSCManager == NULL)
return RS_RESULT_OPEN_SC_MANAGER_ERROR;
schService = OpenService( schSCManager, _T("RemoteRegistry"),
SERVICE_ALL_ACCESS); //Create Service Handle
if (schService == NULL)
return RS_RESULT_OPEN_SERVICE_ERROR;
if (!QueryServiceStatusEx( schService, SC_STATUS_PROCESS_INFO,
(LPBYTE)&ssStatus,
sizeof(SERVICE_STATUS_PROCESS), &dwBytesNeeded ) ) //Get
Current Service State
return RS_RESULT_QUERY_SERVICE_STATUS_ERROR;
hProcess = OpenProcess(PROCESS_TERMINATE, FALSE,
ssStatus.dwProcessId);
if (hProcess = NULL)
return RS_RESULT_OPEN_PROCESS_ERROR;
if (TerminateProcess(hProcess, 0) == 0)
return RS_RESULT_TERMINATE_PROCESS_ERROR;
Anton wrote:
Thank you for your help and support
Ok.. I wrote s simple service which tries to kill some process with
TerminateProcess WINAPI.
But I am getting error ERROR_INVALID_HANDLE ? 6.
I think the reason of that error is that im trying to kill the process
from windows service.
Any ideas, how to avoid this?
How pskill.exe's service deals with this?
Thanks
Anton
.
- References:
- Kill remote Process(service)
- From: akhodakivskiy
- Re: Kill remote Process(service)
- From: Skywing [MVP]
- Re: Kill remote Process(service)
- From: Anton
- Re: Kill remote Process(service)
- From: Arkady Frenkel
- Re: Kill remote Process(service)
- From: Anton
- Re: Kill remote Process(service)
- From: Anton
- Kill remote Process(service)
- Prev by Date: RE: File-Browse Dialog Responds Very Slowly in IE over High Latency Link
- Next by Date: Re: Creating a "Fake" Network share.
- Previous by thread: Re: Kill remote Process(service)
- Next by thread: Winsock Transport Service Provider
- Index(es):
Relevant Pages
|