2012年9月19日 星期三

安装Visual Studio 2010,Windows Driver Kits 7


Visual Studio 2010 With Windows Driver Kits 7 驱动环境配置 For XP/Vista/7

[ 驱动开发 ]  
348
0
+1
0


1.
安装Visual Studio 2010,Windows Driver Kits 7
2.新建VC控制台项目(选择为空项目)
3.新建项目配置“Driver----
Build - Configuration Manager      - Active Solution configuration
- <New...> Name="Driver"
           - Copy Setting from=Debug|Release [这里选择Debug]
View Property Manager                - Driver | Win32 右键
                      - Add New Project Property Sheet
                      - Name="Driver" [可能是所有工程通用属性 - Can Try]
新生成的"Driver" - 右键 - Properties:
Genernal
Target Extension   = .sys
VC++ Directories
Include Directorie = D:\WINDDK\7600.16385.1\inc\ddk;D:\WINDDK\7600.16385.1\inc\api;D:\WINDDK\7600.16385.1\inc\crt;
Library Directories= D:\WINDDK\7600.16385.1\lib\wxp\i386;
C/C++
Genernal - Debug Information Format                         = Program Database (/Zi)                             /* 可选 [C7 compatible (/Z7)] */
    
Code Generation - Basic Runtime Checks                        = Default
     
Advanced - Calling Convention                                     = __stdcall (/Gz)
     
Preprocessor - Preprocessor Definitions                     = _X86_;DBG              
 [后面可以不要]=1;WIN32=100;WINVER=0x501;DBG=1;
 原因:提示—— 1>D:\WINDDK\7600.16385.1\inc\ddk\wdm.h(14197): fatal error C1189: #error :  "No target architecture defined"
#if !(defined(_X86_) || defined(_AMD64_) || defined(_IA64_))
#error "No target architecture defined"
#endif
     
Genernal - Treat Warnings As Errors        =Yes(/WX)        (警告信息变成错误信息:最大程序保障代码可靠性 /* 可选 */)
     
Code Generation - Enable Minimal Rebuild=No(/Gm-)若上面设置 [C7 compatible (/Z7)] 则必选
Compile As                        =[有时需设置]Compile as C Code (/TC) [选中代码中不需加extern "C",不选则需加]
Linker
Genernal - Enable Incremental Linking                         = No (/INCREMENTAL:NO)
System - Subsystem                                         = Console (/SUBSYSTEM:CONSOLE)
Advanced - EntryPoint                                         = DriverEntry
Input - Additional Dependencies                                 = ntoskrnl.lib;wdm.lib;wdmsec.lib;wmilib.lib;ndis.lib;Hal.lib;MSVCRT.LIB;LIBCMT.LIB;

沒有留言:

張貼留言