delphi应用程序与Windows NT系统驱动程序之间的通信

发布于 2024-10-05 00:10:13 字数 357 浏览 0 评论 0原文

我正在尝试构建一个非常简单的驱动程序。它的唯一目的是注册“PsSetCreateProcessNotifyRoutine”,并在从内核收到的回调中通知我的 Win32 应用程序启动和停止了哪些进程。

我只知道如何使用“DriverEntry”和“DriverUnload”构建这样一个简单的驱动程序并使用DDK对其进行编译。但我不知道如何真正实现沟通。我知道可以用 IOCTL 来完成。但除此之外我一无所知。我找不到如何在 Delphi 中执行此操作的简单示例。我只知道这是可以做到的。

因此,我正在寻找一些简单易懂的教程,介绍如何做到这一点,或者更好地提供带有随附驱动程序代码的示例 delphi 程序。也许还有其他的沟通方式。

任何帮助将不胜感激。

I am trying to build a very simple driver. Its sole purpose will be to register "PsSetCreateProcessNotifyRoutine" and on callbacks recieved from kernel, notify my Win32 application about which proccesses are started and stoped.

I only know how to build such a simple driver with "DriverEntry" and "DriverUnload" and compile it with DDK. But I don't know how to actually implement communication. I know it can be done with IOCTL. But beyond that I am in the dark. I cannot find simple example of how to do that in Delphi. I only know it can be done.

So what I am looking for is some simple and understandable tutorial on how to do it or event better an example delphi program with acompaniying driver code. Maybe there are even other ways of communication.

Any help would be appriciated.

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

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

发布评论

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

评论(1

醉梦枕江山 2024-10-12 00:10:13

是否在 Delphi 中并不重要。您必须使用 DeviceIoControl 函数。请阅读 MSDN 中的相关文章

简而言之,您必须选择一些IOCTL代码< /a> 来自可用的集合。然后,您使用这些代码之一调用 DeviceIoControl 并传递一些数据,然后在驱动程序中处理该请求并返回其他内容。

您还可以处理标准 IOCTLS,例如通过在用户模式下调用 ReadFile 或 WriteFile 生成的 IOCTLS。

不要寻找“如何在 Delphi 中执行此操作的教程”,只需寻找任何教程即可。它们都是一样的,不管是什么语言,都是纯粹的 Win32/Native api 东西。例如,这里有一个,刚刚用谷歌搜索出来。

Doesn't matter if in Delphi or not. You have to use the function DeviceIoControl. Read the article in MSDN about it.

In short, you'll have to choose some IOCTL codes from the available set. Then you call DeviceIoControl with one of these codes and pass some data, and in driver you handle that request and return something else.

You can also handle standard IOCTLS, such as the ones generated by calling ReadFile or WriteFile in user-mode.

Don't look for a "tutorial how to do that in Delphi", just look for any tutorial. They're all the same, no matter the language, it's pure Win32/Native api stuff. Here's one for example, just googled it out.

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