I need to get notification in a KMDF driver when processes go down. I do not want to use PsSetCreateProcessNotifyRoutine
because that gives me notification for every process that is created or destroyed. I would like to know/get notification only when certain process ID's which i am interested in are destroyed/exit/deleted. (I don't care about process creations).
One way I thought of doing this would be to share an application created event with the driver. I will create a worker thread in the driver and make it wait on the user created event, and when the application terminates, the wait will abort. Is this a good way to know when the process is terminated/closed or are there more standard ways of doing this? I have read on some forums that sharing events is not a good idea and that i should use overlapped ioctls, but that wont work here obviously.