flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > I want TerminateProcess for NsCpuCNMiner.exe\HostXmrig.exe

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 343
I want TerminateProcess for NsCpuCNMiner.exe\HostXmrig.exe
Windows 7.
I write my program. Program close fine notepad(i do it for test my prog).
Finds but not closed NsCpuCNMiner.exe\HostXmrig.exe

I use OpenProcess,PROCESS_ALL_ACCESS and TerminateProcess,eax, 0


Last edited by Roman on 15 Nov 2017, 08:22; edited 2 times in total
Post 15 Nov 2017, 08:18
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 343
I write this http://www.betamaster.us/blog/?p=657
But not help me.
Post 15 Nov 2017, 08:20
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15312
Location: Bigweld Industries
Check the error code returned by TerminateProcess. That should tell you why it failed. Don't simply assume all API calls will succeed.
Post 15 Nov 2017, 08:30
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 343
ERROR_INVALID_HANDLE
6
The handle is invalid.
Post 15 Nov 2017, 09:06
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15312
Location: Bigweld Industries
What is the error code returned by OpenProcess?
Post 15 Nov 2017, 09:56
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 343
ERROR_ACCESS_DENIED
5 (0x5)
Access is denied.
Post 15 Nov 2017, 12:38
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 343
How i understood i must do
AdjustProcessPrivilege(GetCurrentProcess(), _T("SeDebugPrivilege"), TRUE)

Or AdjustTokenPrivileges
Post 15 Nov 2017, 12:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15312
Location: Bigweld Industries
Yes, you must enable the privilege to perform certain actions. On current versions of Windows even if you are logged in as an administrator you must still do this.
Post 15 Nov 2017, 13:31
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.