j00ru
October 14th, 2009, 09:44
Hi,
I would like to know, whether some of you know any legitimate way of intercepting the application termination process, in its early phases, from the Kernel-Mode?
By legitimate I mean possibilities that are documented and allowed to be used, by Microsoft itself. This indicates that things like kernel hooks are not an option (I would probably like the solution to work on 64 bit platforms in the future).
The first thing one would probably think of is the PsSetCreateProcessNotifyRoutine (http://msdn.microsoft.com/en-us/library/ms802952.aspx) function. The real problem is - as the documentation states:
To be more exact, the routine is called at the very end of process uninitialization, when hardly any threads are left, and most of the process-related kernel information is gone, too.
Because of the above function's behavior, I'm unable to perform some operations on the process in consideration. Hence, I'm searching for a similar interface, though launched a little earlier than the aforementioned one (when, at least, none of the threads have already been killed).
Thanks in advance!
I would like to know, whether some of you know any legitimate way of intercepting the application termination process, in its early phases, from the Kernel-Mode?
By legitimate I mean possibilities that are documented and allowed to be used, by Microsoft itself. This indicates that things like kernel hooks are not an option (I would probably like the solution to work on 64 bit platforms in the future).
The first thing one would probably think of is the PsSetCreateProcessNotifyRoutine (http://msdn.microsoft.com/en-us/library/ms802952.aspx) function. The real problem is - as the documentation states:
Quote:
A driver's process-notify routine is also called with Create set to FALSE, typically when the last thread within a process has terminated and the process address space is about to be deleted. |
Because of the above function's behavior, I'm unable to perform some operations on the process in consideration. Hence, I'm searching for a similar interface, though launched a little earlier than the aforementioned one (when, at least, none of the threads have already been killed).
Thanks in advance!