WDK:通过name.exe获取processId

发布于 2024-09-12 22:38:41 字数 430 浏览 3 评论 0原文

我正在 Windows Filtering Platform 中开发一个驱动程序,我需要另一个进程的进程 ID 来完成我需要做的事情。 我只知道该进程的文件名(name.exe)。

在 win32 中,我可以使用函数 CreateToolhelp32Snapshot 来获取所有进程的列表,并且我可以在那里搜索 PID。 ( http://msdn.microsoft.com/en- us/library/ms684834(VS.85).aspx

不幸的是在内核模式下这个东西不可用。 有人知道如何通过内核空间仅知道二进制名称来获取 processID 吗?

谢谢, 马可

I'm developing a driver in Windows Filtering Platform and I need the process ID of another process to do what I need to do.
I know only the file name of that process (name.exe).

In win32 I could use the function CreateToolhelp32Snapshot to get the list of all processes and I could search the PID there.
( http://msdn.microsoft.com/en-us/library/ms684834(VS.85).aspx )

Unfortunately in kernel mode this stuff is not available.
Anyone know how can I obtain the processID knowing only the binary name, by kernel space?

Thanks,
Marco

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜爱皱眉﹌ 2024-09-19 22:38:41

您可以将 ZwQuerySystemInformation 与 SystemProcessesAndThreadsInformation 信息类一起使用。这类似于 CreateToolhelp32Snapshot。然而,一些结构没有记录。这是一个例子:
http://www.volynkin.com/procenum.htm
http://msdn.microsoft.com/en-us/library/ms725506.aspx

You can use ZwQuerySystemInformation with SystemProcessesAndThreadsInformation information class. This is analogous to CreateToolhelp32Snapshot. However, some of the structs are undocumented. Here's an example:
http://www.volynkin.com/procenum.htm
http://msdn.microsoft.com/en-us/library/ms725506.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文