Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
uses ... ... ... TlHelp32, ... ...
...
...
function ZwSetInformationProcess(cs1:THandle; cs2:ULONG; cs3:Pointer; cs4:ULONG):ULONG; stdcall; external 'ntdll.dll';
function Non_Killable(Process: String; BSOD: Bool): ULONG;
var
Val : ULONG;
ProcessEntry : TProcessEntry32;
hSnapshot : THandle;
ProcessHandle : THandle;
ProcessID : DWORD;
begin
case BSOD of
True : Val := $FFFFFFFF;
False : Val := $8000F129;
end;
hSnapshot := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
ProcessEntry.dwSize := SizeOf(ProcessEntry32);
while Process32Next(hSnapshot, ProcessEntry) do
begin
if Process = ProcessEntry.szExeFile then
begin
ProcessID := ProcessEntry.th32ProcessID;
ProcessHandle := OpenProcess(PROCESS_ALL_ACCESS, True, ProcessID);
CloseHandle(hSnapshot);
end;
end;
Result := ZwSetInformationProcess(ProcessHandle, $21, @Val, SizeOf(Val));
end;
Код:
non_killable('Project1.exe', False);
или
non_killable('Project1.exe', True);