搭建VS2008+WDK+DDKWzardwindows驱动开发环境

搭建VS2008+WDK+DDKWzardwindows驱动开发环境

一、微软驱动开发之-WDK的介绍、下载、安装及配制

1、关于WDK

Windows Driver Kit(驱动程序工具包): 是一种完全集成的驱动程序开发系统,它包含 Windows Driver Device Kit (DDK),用于测试Windows 驱动程序的可靠性和稳定性,包括:

§    Windows Driver Foundation (WDF) 简化了 Windows 驱动程序的开发和支持。

§    头文件重构 (Windows Vista 和更高版本)通过提供更简单的目录结构、避免声明冲突以及对所有支持的 Windows 版本使用单一头文件集,降低头文件的复杂性。

§    Installable File Systems (IFS) Kit将头、库、示例以及文档作为 WDK 的一部分分发。

§    验证程序和静态分析工具, (如 PREfast 和 静态驱动程序验证程序)帮助您在编译时查找 bug。

2、下载WDK

所以当时下载的时候还要走一些不得不走的路。不过,今天好像发现WDK能直接下载了

下载地址:http://www.microsoft.com/en-us/download/search.aspx?q=WDk

如果不能正常下载,具体操作请见如何下载WDK

3、安装WDK驱动开发包

1.                              用虚拟光驱加载下载好的WDK.ISO镜像文件,双击运行,出现下面亲切的画面 

安装WDK驱动开发包

  1. 点击出现以下画面,在左侧的树形复选框中选择要安装的组件及工具,选择所要安装的组件及工具,建议全部安装,然后点击“OK”

                

2.                     最后一路确定默认即可


    1. 安装WDK的组件及工具
    1. 安装WDK的步骤

    2. 二、DDKWzard的介绍、下载、安装及配制

      在VS2008 IDE中没有提供驱动开发的项目选项,当然可以用普通工程,然后手动在VS中配制相应的编辑连接以及调试选项,但是如此一来,每次都要重复这些复杂的步骤。在http://ddkwizard.assarbad.net/网站上发现了一个很好用的辅助工具DDKWizard,能够方便地对开发环境进行配置,懒人必备,作者也是懒人一族,才开发此驱动开发辅助工具。

      • DDKwzard安装需要三个文件:DDKWzard主程序:安装VS2008的项目模板ddkwizard_setup.exe
      • DDKBUILD.CMD:应该是用VS2008调用WDK编辑编译器的一系列脚本dkbuild_cmd.zip
      • DDKBUILD.BAT :估计也是是用VS2008调用WDK编辑编译器的一系列脚本ddkbuild_bat.zip
      1. 安装ddkwizard_setup,默认安装,一路Next点过即可,将DDKBUILD.CMD与DDKBUILD.BAT考到WDK的安装目录,或者其它目录也行,只要在后续的设置就行。如:我将其放在wdk的目录下,如图
      1.  安装ddkwizard

设置环境变量

添加相应的环境变量,如要开发XP系统下的驱动则添加WXPBASE,变量值为WDK的根目录,如图

  1. 添加WDK相应的环境变量
  2. 如果为其它系统开发驱动则填写相应的环境变量

    • NT 4.0 ———–NT4BASEwindows2000—-W2KBASE
    • windowsXP——-WXPBASE
    • windows2003—-WNETBASE
    • win7/2008 R2—-W7BASE
    1.  
    2. 打开VS 2008,菜单“工具”->“选项”->左侧“项目和解决方案”->“VC++目录”->右侧“可执行文件”下拉列表->添加一项D:/WINDDK(根据你在a安装的实际路径,就是第1步中DDKBUILD.CMD与DDKBUILD.BAT所在的路径)。 
    3. image_thumb_7

·  然后就可以在我们的VS2008中新建项目了,如下图,在Visual C++选项卡中多了DDK Project的项目类型,选择相应的模板添加我们的项目,点击确定

 image_thumb_8


确定后出现DDKWzard的项目创建页面,在“Choose the DDKBUILD you want to use”中选择“ddkbuild.cmd”或者“ddkbuild.bat”,在其下面选择我们要为哪个平台(win2000, winxp, Vista, Win7……)开发的驱动。
最后finish

  1. DDKWzard的项目创建页面选择开发平台

  1.  在解决方案中便是由DDKWzard为我们自动生成的一个简单的驱动程序框架。

DDKWzard自动生成驱动程序框架

·  最后点击F6生成解决方案,成功生成后在项目的objchk_win7_x86/i386文件夹下会生成几个文件

driver1.obj —编译生成的2进制文件
driver1.pdb—用于调试时使用的符号文件
vc90.pdb—–用于调试时使用的符号文件
driver1.sys—就是我们拭目以待的驱动程序文件

也许您还对以下文章有兴趣:

搭建XP驱动开发IDE平台DDK2003 + VS2005 + DriverStudio3.2

XP DDK+DDKWizard+VS2008配置驱动开发环境

  1. 安装WDK的步骤


准备一台XP的虚拟机,把MYDRIVER.sys放到虚拟机里。

http://www.osronline.com/article.cfm?article=157下载osrloader,先要用电子邮件进行注册。

http://download.sysinternals.com/files/DebugView.zip下载debugview。

把osrloader和debugview都放到XP虚拟机里,然后打开debugview,用osrloader加载MYDRIVER.sys,并且注册服务,启动服务,这时,并不会输出DbgPrint里的信息,因为还没重启XP。重启XP后,就会看到输出了


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
DDKWizard is a so-called project creation wizard that allows you to create projects that use the DDKBUILD scripts from OSR (also available in the download section from this site). The wizard will give you several options to configure your project prior to the creation. Have a look at figure 1. Figure 2: Project creation dialog (click to enlarge) Instead of forcing you to use a subset of options and specific DDKs this wizard lets you choose what you want. Of course the template files are predefined and so is the content of the project(s) within certain limits. However, I tried to choose the best options that I could think of and provide a way to create quickly and easily the DDKBUILD project you want. This means that I tried to leave out those things that may limit your choice lateron and add other options that will give you the flexibility to change options quickly long after the project was created. DDKWizard adds a new subfolder in the project creation wizard - see figure 2 - and presents all supported project types there. Currently these are Driver, Empty Driver, Native Application, Win32 console application and Win32 DLL. In either case you just choose the type of project to create, give the name of the project and/or solution as well as other options (at the bottom) and you are being presented the wizard dialog (see figure 1). From the wizard dialog you choose the DDKBUILD script you want to use, the DDK or multiple DDKs as well as the other options. If you are curious about the Property Sheet feature, please download the manual and read the respective section there. Compatibility DDKWizard (1.2.0a) has been tested on the following configurations: Visual Studio Professional .NET with WNET DDK and DDKBUILD.CMD on Windows 2003 Server R2 Standard Visual Studio Professional .NET 2003 with WNET DDK and DDKBUILD.CMD on Windows 2003 Server R2 Standard Visual C++ 2005 Express with WNET DDK and DDKBUILD.CMD on Windows 2003 Server R2 Standard Visual Studio 2005 Professional with WNET DDK and DDKBUILD.CMD on Windows 2003 Server R2 Standard Visual Studio 2008 Professional with WNET DDK and DDKBUILD.CMD on Windows XP From this list one can deduce that it is supposed to also run if you got the respective "non-Express" Visual C++ version. Also if there has been some Visual C++ .NET 2003 Express DDKWizard is prepared for it. Download You could go watch the demo or download right away: Manual: contains the detailed description of how to configure DDKBUILD and use DDKWizard. If you are unsure whether you should download and install DDKWizard grab this file and skim over it. Download: ddkwiz_manual.pdf (~513kB, 2009-12-05@20-11-55, downloaded 31666 times) Installer (incl. manual) of DDKWizard 1.3.0a: this is the setup program which will install DDKWizard along with the manual on your computer and register it with Visual Studio. Download: ddkwizard_setup.exe (~557kB, 2009-12-05@20-12-37, downloaded 72787 times) DDKBUILD.CMD: Stable version 7.4/r60 of OSRs DDKBUILD NT script version. Feedback for this version can be sent to me directly. Download: ddkbuild_cmd.zip (~12kB, 2009-11-28@04-38-36, downloaded 20707 times) DDKBUILD.BAT (obsoleted by the above!): Version 6.12 of OSRs DDKBUILD batch script version. Download: ddkbuild_bat.zip (~6kB, 2008-03-21@15-59-07, downloaded 17226 times) Trunk version of DDKBUILD.CMD The version from trunk is available as well. Please note that this is not necessarily the same version as offered in the ZIP archive above. It may be in a better shape (e.g. reported bugs fixed) or slightly worse (e.g. new feature that is not yet stable). So use this version only if you want to test the latest development version and are able to provide feedback. Here is the link to the prettier ViewVC URL: ddkbuild/trunk - SVN clients get read-only access here. License All projects created by DDKWizard can be put under whatever license you like to put them. The scripts and HTML files which contain the DDKWizard logic are subject to the zlib license starting with version 1.2.0, before it was released under the GPL v2 from 1991. The zlib license is a lot more liberal and allows just about any kind of use for the script and "user interface" part of DDKWizard. The DDKBUILD scripts are mirrored with the permission of OSR. I will try to keep it synchronized at all times. Everything else Contact me here and also visit my blog and my website. Note that I usually announce new versions of DDKWizard and DDKBUILD on my blog - you also might want to subscribe to the RSS feed for DDKWizard and DDKBUILD. This page will be extended whenever I deem it necessary.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值