Windows access control works on a per-object basis. If you want to protect a process object, you need to set the ACL of the process object either when creating the process (via lpProcessAttributes of CreateProcess) or later (via SetKernelObjectSecurity ). If you add the "deny all" entry to the ACL, an attempt by an attacker to open a process will fail.
Of course, the owner of the process (and therefore any malicious code executed by the user) can change the ACL back to what it was - the malicious code may not be ready for this. To effectively prevent attacks from user space, you need to start this process as a non-interactive user (for example, like LocalSystem).
No protection can prevent attacks from the kernel space, so anyone who can install drivers can also crack any process on the system.
Martin v. Löwis
source share