这是目前编译驱动程序,开发驱动程序最方便、最亲切、最自然的方法。
1、制作一个文本文件,(名称如:wdkproperty.props);
1.5、在VS2010中新建空项目,配置configuration manager,添加new-debug->wdk;在project->propertis相应wdk添加新:wdkproperty.props;
2、将你制作好的wdkproperty.props放入你的project相应目录内替换掉;
3、configuration manager选择wdk,项目即可直接编译成功,.sys文件出来了;
4、注意生成目录路径;
5、注意:我的WDK安装在D:\DDK7600
wdkproperty.props
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <ImportGroup Label="PropertySheets" />
4 <PropertyGroup Label="UserMacros" />
5 <PropertyGroup>
6 <ExecutablePath>D:\DDK7600\bin\x86;$(ExecutablePath)</ExecutablePath>
7 </PropertyGroup>
8 <PropertyGroup>
9 <IncludePath>D:\DDK7600\inc\api;D:\DDK7600\inc\ddk;D:\DDK7600\inc\crt;$(IncludePath)</IncludePath>
10 </PropertyGroup>
11 <PropertyGroup>
12 <LibraryPath>D:\DDK7600\lib\wxp\i386;$(LibraryPath)</LibraryPath>
13 <TargetExt>.sys</TargetExt>
14 <LinkIncremental>false</LinkIncremental>
15 <GenerateManifest>false</GenerateManifest>
16 </PropertyGroup>
17 <ItemDefinitionGroup>
18 <ClCompile>
19 <PreprocessorDefinitions>_X86_;DBG</PreprocessorDefinitions>
20 <CallingConvention>StdCall</CallingConvention>
21 <ExceptionHandling>false</ExceptionHandling>
22 <BasicRuntimeChecks>Default</BasicRuntimeChecks>
23 <BufferSecurityCheck>false</BufferSecurityCheck>
24 <CompileAs>Default</CompileAs>
25 <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
26 <AssemblerOutput>All</AssemblerOutput>
27 </ClCompile>
28 <Link>
29 <AdditionalDependencies>ntoskrnl.lib;wdm.lib;wdmsec.lib;wmilib.lib;ndis.lib;Hal.lib;MSVCRT.LIB;LIBCMT.LIB;%(AdditionalDependencies)</AdditionalDependencies>
30 </Link>
31 <Link>
32 <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
33 <EnableUAC>false</EnableUAC>
34 <SubSystem>Native</SubSystem>
35 <EntryPointSymbol>DriverEntry</EntryPointSymbol>
36 <BaseAddress>0x10000</BaseAddress>
37 <RandomizedBaseAddress>
38 </RandomizedBaseAddress>
39 <DataExecutionPrevention>
40 </DataExecutionPrevention>
41 <GenerateDebugInformation>true</GenerateDebugInformation>
42 <Driver>Driver</Driver>
43 </Link>
44 </ItemDefinitionGroup>
45 <ItemGroup />
46 </Project>

本文链接:VS2010+WDK开发环境搭建最简易方法,转载请注明。