Hi
I want to protect my process from getting terminated by any other process for Vista sp1 and later versions of WOS.
For the purpose I used ObRegisterCallbacks and registered a callback for process handle creation. In the PreOperation I am removing the PROCESS_TERMINATE and other necessary access rights(DesiredAccess). This works fine for OpenProcess function and the process handle is not given the PROCESS_TERMINATE access. (Checked from PostOperation, GrantedAccess)
But if in kernel mode I get the handle by using (I saw this Process Hacker)
i) PsLookupProcessByProcessId (get EPROCESS from PID)
ii) ObOpenObjectByPointer (get handle from EPROCESS)
it is given the PROCESS_TERMINATE access. Why? How to avoid this?
Thanks and Regards
Utsav
I want to protect my process from getting terminated by any other process for Vista sp1 and later versions of WOS.
For the purpose I used ObRegisterCallbacks and registered a callback for process handle creation. In the PreOperation I am removing the PROCESS_TERMINATE and other necessary access rights(DesiredAccess). This works fine for OpenProcess function and the process handle is not given the PROCESS_TERMINATE access. (Checked from PostOperation, GrantedAccess)
But if in kernel mode I get the handle by using (I saw this Process Hacker)
i) PsLookupProcessByProcessId (get EPROCESS from PID)
ii) ObOpenObjectByPointer (get handle from EPROCESS)
it is given the PROCESS_TERMINATE access. Why? How to avoid this?
Thanks and Regards
Utsav