最近公司要求做一个驱动程序。以前从来没有做过此程序。后来知道用DDK可以创建。我只有vc+win2000ddk;
我的系统是WIN2000,我安装了一个WIN2000 SP1 ,当然VC是安装了。
安装完了后。在开始菜单就有一个WIN2000 KIT 的项。但现在我根本不知道怎么入手。查了一下,好象说要输入build -cz编译一下。那么编译完了后怎么调试我在ddk文档中找到的例子呢?也就是vc中的环境要怎么配置。还有例子中找到的文件都是.h和.c的还有makefile等文件。根本就没有vc需要的dsw文件啊。。各位要怎么办啊。详细的跟我讲解一下。
谢谢!

解决方案 »

  1.   

    本版FAQ中有我写的详细的win2000+vc6+ddk的编译配置说明
      

  2.   

    用driverstudio 开发就行。或者
    http://www.codeproject.com/system/idd.asp?print=true
      

  3.   

    http://community.csdn.net/Expert/topic/4657/4657917.xml?temp=.7448236
      

  4.   

    调试的话你先安装你的驱动(设备管理器or用inf随便你),然后用softice的symbol loader先translate你的check build版本的driver,ctrl+D进入softice,bpx下断点,可以断在driverentry上,或者别的函数上,然后退出softice,触发你的函数(比如你插上硬件什么的),softice会弹出停在断点上,这时候你就可以调试了。
      

  5.   

    DriverStudio也不行的一般都是build 编译,
    使用SoftIce调试
      

  6.   

    首先运行C:\NTDDK\bin\setenv.bat
    完成环境的配置!
    再到cmd下,注意要运行Checked Build Environment,而不是直接运行cmd!
    然后转到驱动源代码所在的目录下,然后build -cZ,就可以编译了!
      

  7.   

    一般的配置都是:
    在VC下编辑(注意:是编辑),使用Build编译,使用Si调试。当然,也可以配置一下,在VC下编译。
    (主要是配置project-settings,使用编译脚本cmd,脚本中调用build)
    本质上还是离不开build。
    因为现在的DDK已经不能用VC的cl编译器了。
    (至少我的WindowsXPsp2DDK是这样,在其releaseNotes中直接告诉你了:As was the case for the Windows XP DDK a complete set of tools is supplied with the Windows XP Service Pack 1 DDK for building drivers. Microsoft Visual C++ is no longer required to be installed to use the DDK.
    Please use the included tools to build Windows 2000 or Windows XP device drivers. Do not use compilers, linkers or other build tools from other development products such as Visual Studio .NET to build Windows 2000 or Windows XP device drivers. This version of the Windows DDK does not support using a version of Microsoft Visual C++ other than the one supplied with the DDK. Attempts to use in incorrect version of Visual C++ will result in the following error message from the compiler:
    error C1189: #error : Compiler version not supported by Windows DDK
    Some Windows Millennium (Me) drivers may require Visual C++ version 6.0 to be installed for use regardless of the platform being used to build the drivers. Later versions of Visual C++ will not work in the Windows Me build environment. )
      

  8.   

    装了vc和ddk之后装driverstudio,在vc的工具栏上就会有driverwizard,生成了项目之后会自动用vc打开,象编译其他工程一样,只是没法用vc调试。
      

  9.   

    一般来说命令行 编译方便....如果你能配置好 你的 VC(erery vision)..也一样windows 2000 以后的驱动 MS推荐用 WDM 模型针对不同的设备类 有相应的 初始化 和准备工作..具体参看 ddk documentvista 先不要考虑了..我没装过..据说又换了模型(太阳!!)应该也兼容 wdm模型