如何检测win32进程创建/终止在c ++ [英] How to detect win32 process creation/termination in c++

查看:223
本文介绍了如何检测win32进程创建/终止在c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,为了接收关于win32进程创建或终止的通知,我们可以使用API​​ PsSetCreateProcessNotifyRoutine()实现一个NT内核模式驱动程序,它提供注册系统调用的回调函数的能力,每次当一个新进程开始,退出或被终止。

I know that to receive notifications about win32 process creation or termination we might implement a NT kernel-mode driver using the APIs PsSetCreateProcessNotifyRoutine() that offers the ability to register system-wide callback function which is called by OS each time when a new process starts, exits or is terminated.

我的问题是如果这可能没有创建一个NT内核模式驱动程序,只使用win32 API函数使用C ++?不使用无限循环的基本解决方案查询当前活动进程的列表。

My question is if this is possible without creating a NT kernel-mode driver, only using win32 api functions using c++? Not using the basic solution of a infinite cycle querying the list of active process of course.

是否有任何库或win32 API提供相同的功能(系统范围的回调,异步事件...)?

Is there any library or win32 API that provides the same functionality (system wide callback, asynchronous events, ...)?

感谢

推荐答案

只有我能想到的是WMI,不知道它是否提供了一个过程创建回调,但它可能值得研究。

The only thing I could think of is WMI, not sure if it provides a process creation callback, but it might be worth looking into.

这篇关于如何检测win32进程创建/终止在c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆