阅读:1646回复:5
VC++和DDK如何配置产生*.sys????
各位大侠:
大家讨论了很多驱动程序核心的问题,我问一个入门的问题, 用VC++和DDK来设计驱动程序,请问如何配置产生*.sys驱动程序???好像VC向导里没有那个模式是产生*.sys也 谢谢 |
|
沙发#
发布于:2004-08-05 13:00
使用DS建立工程,VC中编译,即可生成驱动
|
|
|
板凳#
发布于:2004-08-05 13:53
我介绍一些在WIN2000SP4+2000DDK+VC6SP6环境用VC6编译DDK的例子
1 用makefile方法编译,首先编写makefile文件,假设为build.bat下面是makefile内容“//”为注释不要加入文件 @echo off echo Function : 开始2000DDK编译环境设置并编译WDM Driver File echo on call F:\NTDDK\bin\setenv.bat F:\NTDDK checked //打开编译器环境设置 f: cd F:\编程开发\驱动开发\我的作品\filedisk\2003-04-30_FILESRC\sys //转到自己代码目录文件夹 build -b -w -nmake /a//编译连接按照你的要求来 2 用VC6建立DDK代码工程,file->new->projects->makefile,设定到好DDK例子所在目录,下一步makefile step1-2对话框 Commandline填写build.bat完成,然后在tool->options->Directories->Executable files添加build.bat文件夹,然后project->Add to project->file添加 .c .h .rc文件,就可以编辑了 3 编译连接,大功告成 用这种方法就可以用VC6来编写驱动,用DDK自己的编译器编译程序在VC的OUTPUT栏中察看编译信息,并根据提示可修改代码,这样基本上就能把VC6和DDK融为一体了 下面是BUILD的命令说明 F:\NTDDK>build /? BUILD: Object root set to: ==> objfre BUILD: /i switch ignored BUILD: Version 4.03.2134 Usage: BUILD [-?] display this message [-3] same as -Z but will add a third pass zero pass [-a] allows synchronized blocks and drains during link pass [-b] displays full error message text (doesn't truncate) [-c] deletes all object files [-C] deletes all .lib files only [-D] check dependencies before building (on by default if BUILD_PRODUCT != NT) [-e] generates build.log, build.wrn & build.err files [-E] always keep the log/wrn/err files (use with -z) [-f] force rescan of all source and include files [-F] when displaying errors/warnings to stdout, print the full path [-G] enables target specific dirs files iff one target [-i] ignore extraneous compiler warning messages [-I] do not display thread index if multiprocessor build [-k] keep (don't delete) out-of-date targets [-l] link only, no compiles [-L] compile only, no link phase [-m] run build in the idle priority class [-M [n]] Multiprocessor build (for MP machines) [-o] display out-of-date files [-O] generate obj\_objects.mac file for current directory [-p] pause' before compile and link phases [-P] Print elapsed time after every directory [-q] query only, don't run NMAKE [-r dirPath] restarts clean build at specified directory path [-s] display status line at top of display [-S] display status line with include file line counts [-t] display the first level of the dependency tree [-T] display the complete dependency tree [-$] display the complete dependency tree hierarchically [-u] display unused BUILD_OPTIONS [-v] enable include file version checking [-w] show warnings on screen [-y] show files scanned [-z] no dependency checking or scanning of source files - one pass compile/link [-Z] no dependency checking or scanning of source files - two passes [-why] list reasons for building targets [-all] same as -386, -axp64, -alpha, and -ia64 [-alpha] build targets for alpha [-axp64] build targets for axp64 [-386] build targets for i386 [-ia64] build targets for IA64 [-x filename] exclude include file from dependency checks [-j filename] use 'filename' as the name for log files [-nmake arg] argument to pass to NMAKE [-clean] equivalent to '-nmake clean' Non-switch parameters specify additional source directories BUILD: Done |
|
|
地板#
发布于:2004-09-16 17:42
用WinXP的ddk和VC6不行,我看到WinXP的DDK的wdm.h里有这样的:
#if _MSC_VER < 1300 #error Compiler version not supported by Windows DDK #endif 不知道有没有解决办法,难道一定要用VC.net? |
|
|
地下室#
发布于:2004-09-16 21:25
我想问一下DS和DDK哪一个更好啊,有神么不同么??
|
|
5楼#
发布于:2004-09-16 23:06
用WinXP的ddk和VC6不行,我看到WinXP的DDK的wdm.h里有这样的: ds3.1的插件,可以在VC6中编译for XP的驱动,不过实际用的是DDK的cl和link |
|