简体   繁体   中英

What is the easiest way to debug and test minifilter driver in visual studio?

我正在研究一些示例驱动程序,但测试代码非常烦人,只是我想弄清楚驱动程序代码中传递了什么值。

I know this is supposed to be possible with newer versions of Visual Studio, but I have not had good luck. Windbg is your friend.

I find that the easiest way to debug and test is to run a machine with Hyper-V installed, have a virtual machine that hosts a client OS and on which you install and test your filter driver. Then on the host machine you can run windbg, attach it to a virtual COM port on the VM, and you're up and running.

Since windbg is running on the machine where you are doing dev work, the symbols and source usually just resolve automatically. If you run into problems with that, like you have built a new driver but haven't updated in on the VM and still want to debug, you can set up a build script that keeps a symbol server of recent builds, or you can just force windbg to load the symbols anyway (even though they won't match up perfectly).

In my experience this is FAR easier that getting VS driver debugging to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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