VC6+VA来编辑和编译开发驱动程序

 

1。新建一个空的Win32 Application,将驱动文件(包括INCLUDE和SOURCES)加入工程

2。Tools-->Options-->Directories-->Executable files
加入:C:\WINDDK\7600.16385.0\BIN\X86\X86
编译驱动的时候将该命令放在最上面;
编译应用态程序的时候,将该命令放在最下面

3。Project-->Settings...

{C/C++}
[General]
Debug info:
Program Database

Preprocessor definitions:
_X86_=1,i386=1,STD_CALL,WIN32=100,_WIN32_WINNT=0x0501,WINVER=0x0501,_DEBUG

Project Options:
去掉GX /YX /pdbtype:sept
MLd->MTd

[Code Generation]
Calling convention:
__stdcall
Use run-time library
Debug Multithreaded

[Preprocessor]
Additional include directories:
C:\WinDDK\7600.16385.0\inc,
C:\WinDDK\7600.16385.0\inc\api,
C:\WinDDK\7600.16385.0\inc\ddk,
C:\WinDDK\7600.16385.0\inc\crt


{Link}
[General]
Output file name:
name.sys
Object/library modules:
ntoskrnl.lib hal.lib usbd.lib wmilib.lib
去掉"Link incrementally"的勾

[input]
Additional library path:
C:\WinDDK\7600.16385.0\lib,
C:\WinDDK\7600.16385.0\lib\crt\i386,
C:\WinDDK\7600.16385.0\lib\wnet\i386

[output]
Entry-point symbol:
DriverEntry

Project Options:
/machine:IX86 /driver /subsystem:native /SECTION:INIT,d
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221
删除如下选项:
/subsystem:windows

其实主要是为了利用VA编辑代码的方便。编译64位的程序或者WIN7等版本,可以直接使用WDK的编译命令来编译即可。


你可能感兴趣的:(windows驱动开发,winddk,preprocessor,include,generation,output,application)