简体   繁体   English

为什么Windows驱动程序工具包中没有WDM内核模式驱动程序模板?

[英]Why is there no WDM kernel-mode driver template in Windows Driver Kit?

I came across kernel-mode drivers with very little experience. 我遇到的内核模式驱动程序经验很少。 Here's what I am trying to do: 这是我想做的事情:

  • Have a user-mode application that loads the driver. 有一个加载驱动程序的用户模式应用程序。
  • Have the user-mode application write to it, in order to send it an instruction. 让用户模式应用程序对其进行写入,以便向其发送指令。
  • Have the driver send the RDMSR instruction to the Intel chip. 让驱动程序将RDMSR指令发送到Intel芯片。
  • Return the results back to the user-mode application. 将结果返回给用户模式应用程序。

I've read this article that describes the different ways in which you can accomplish this behavior (Buffered I/O, Direct I/O, or Neither). 我已经阅读了这篇文章 ,描述了完成此行为的不同方法(缓冲I / O,直接I / O或两者都不做)。

My problem is this...the article has code that represents the way you would structure a WDM driver, and I was expecting to be able to create a WDM KMDF project template using the Windows Driver Kit, but when I downloaded the Windows Driver Kit (WDK), the only KMDF driver template was for a WDF driver. 我的问题是...这篇文章中的代码代表了您构建WDM驱动程序的方式,并且我希望能够使用Windows Driver Kit创建WDM KMDF项目模板,但是当我下载Windows Driver Kit时(WDK),唯一的KMDF驱动程序模板是用于WDF驱动程序的。 MSDN has an article describing the differences between the two . MSDN上有一篇文章描述了两者之间的区别 This is kind of strange to me. 这对我来说有点奇怪。 I was expecting to get a template out of the box that I could modify to work like in the article I've linked, but I don't see it. 我期待开箱即用的模板可以修改,以使其像我链接的文章中那样工作,但我看不到它。 Why is there no template for a WDM KMDF driver? 为什么没有WDM KMDF驱动程序的模板?

Just an added note, you can quite easily tell the type of the driver based on the way it creates the device (IoCreateDevice implies WDM, whereas WdfDeviceCreate implies WDF). 只是一个补充说明,您可以根据驱动程序创建设备方式很容易地分辨出驱动程序的类型(IoCreateDevice表示WDM,而WdfDeviceCreate表示WDF)。

There is a lot of inconsistencies in the question. 这个问题有很多不一致之处。 First of all, KMDF is a subset of WDF (and it's the only relevant WDF part when talking about kernel drivers), so there is no contradiction between the two. 首先, KMDFWDF的子集(在谈论内核驱动程序时,它是唯一相关的WDF部分),因此两者之间没有矛盾。 Every kernel driver is essentially a WDM driver. 每个内核驱动程序本质上都是WDM驱动程序。 KMDF is a framework in the WDM and KMDF drivers are normally called, well, KMDF drivers, without mentioning WDM . KMDFWDM的框架,通常将KMDF驱动程序称为KMDF驱动程序,而无需提及WDM WDM driver usually refers to driver that does not use any additional framework, such as KMDF . WDM驱动程序通常是指不使用任何其他框架的驱动程序,例如KMDF Second, WDK integrates with VS2012/2013 and you must have it installed in addition to WDK to get the templates. 其次, WDK与VS2012 / 2013集成在一起,除了WDK之外,还必须安装它才能获取模板。 Third, WDM template does appear in the list. 第三, WDM模板确实出现在列表中。 If you don't have it, I suggest reinstalling the WDK and VS . 如果没有,我建议重新安装WDKVS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM