Tuesday 15 May 2012

windows - Prevent Process Kill From Task Manager, Reversed -


I use the code below to prevent the user from hitting my program from Task Manager (I have it somewhere And found):

  Stop function process kill: integer; Var H: Process: Thandel; EmptyDacl: TACL; PETDDACL: PACL; DwErr: DWORD; Start H processing: GetCurrentProcess (); Zomaryori (@EptidDacile, SizeOff (TACL)); PEmptyDacl: = @EmptyDacl; If (InitializeAcl (EmptyDacl, sizeof (tACL, 2)) then dwErr: = GetLastError () and dwErr: = SetSecurityInfo (hProcess, SE_KERNEL_OBJECT, DACL_SECURITY_INFORMATION, zero, zero, @ExtyDacl, zero); Results: = dwErr; End;   

It works great, but at some point in my program I need to revert the effect and have permission to stop from the Task Manager. Any ideas?

When you call SetSecurityInfo, then you are modifying the DACL, so before you It's called GetSecurityInfo and keep in mind the original process DACL when the time comes, call again SECTIENFOE to reset it.

Keep in mind that a fixed user can do this so that you can not stop them from killing the process. You're just making it a bit weird

No comments:

Post a Comment