Where can I find a minimalistic WDM driver template with source code in it? [closed]

心不动则不痛 提交于 2019-12-07 21:43:14

问题


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.
  • 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).

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 and then modify a default WDM project template with source code in it using the Windows Driver Kit, but when I downloaded the Windows Driver Kit (WDK), the only WDM driver template was completely blank and did not have any source code.

Where can I find an example of a minimalistic WDM driver template with source code in it that uses IoCreateDevice to create a device object?


回答1:


I found it here. Part of the Windows Driver Kit 8.1 Samples, the glorious IOCTL driver sample

demonstrates the usage of four different types of IOCTLs (METHOD_IN_DIRECT, METHOD_OUT_DIRECT, METHOD_NEITHER, and METHOD_BUFFERED)

Furthermore,

This sample driver is not a Plug and Play driver. This is a minimal driver meant to demonstrate a feature of the operating system. Neither this driver nor its sample programs are intended for use in a production environment. Instead, they are intended for educational purposes and as a skeleton driver.



来源:https://stackoverflow.com/questions/24017717/where-can-i-find-a-minimalistic-wdm-driver-template-with-source-code-in-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!