I'm trying to suspend a process from windows
to Delphi
, but to no avail, I'm using the following code:
function SuspendProcess(pid:dword):boolean; // Suspende processo pelo PID
var module,module1:thandle;
SusPendProcess:TNTdllApi;
begin
result := false;
SetTokenPrivileges;
module := LoadLibrary('ntdll.dll');
@SusPendProcess := Getprocaddress(module,'NtSuspendProcess');
if @SusPendProcess <> nil then
begin
module1 := OpenProcess(PROCESS_ALL_ACCESS,FALSE,pid);
SusPendProcess(module1);
end;
end;
Where I report PID
, but nothing happens, now using the tool PC Hunter
, it suspends without any problem.
Would it be possible to use PSSuspendProcess/ZwSuspendProcess
?
Could you help me with an example? Thank you!