VS2010+WDK配置驱动开发环境

2025-09-28 16:10:35

1、首先将VS2010和WDK安装到电脑中

2、配置VS2010驱动环境,运行VS2010,新建一个空项目:

VS2010+WDK配置驱动开发环境

3、打开配置管理器,添加一个驱动的活动项,确定,如图:

VS2010+WDK配置驱动开发环境

4、来到VS2010的property manager,为Driver编译添加一个新的配置文件,如图:

VS2010+WDK配置驱动开发环境

VS2010+WDK配置驱动开发环境

5、此时工程目录下会生成一个配置文件,如图:

VS2010+WDK配置驱动开发环境

6、修改此配置文件,将如下内容覆盖到配置文件中,

<?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <ImportGroup Label="PropertySheets" />

  <PropertyGroup Label="UserMacros" />

  <PropertyGroup>

    <ExecutablePath>D:\WinDDK\7600.16385.1\bin\x86;$(ExecutablePath)</ExecutablePath>

  </PropertyGroup>

  <PropertyGroup>

    <IncludePath>D:\WinDDK\7600.16385.1\inc\api;D:\WinDDK\7600.16385.1\inc\ddk;D:\WinDDK\7600.16385.1\inc\crt;$(IncludePath)</IncludePath>

  </PropertyGroup>

  <PropertyGroup>

    <LibraryPath>D:\WinDDK\7600.16385.1\lib\win7\i386;$(LibraryPath)</LibraryPath>

    <TargetExt>.sys</TargetExt>

    <LinkIncremental>false</LinkIncremental>

    <GenerateManifest>false</GenerateManifest>

  </PropertyGroup>

  <ItemDefinitionGroup>

    <ClCompile>

      <PreprocessorDefinitions>_X86_;DBG</PreprocessorDefinitions>

      <CallingConvention>StdCall</CallingConvention>

      <ExceptionHandling>false</ExceptionHandling>

      <BasicRuntimeChecks>Default</BasicRuntimeChecks>

      <BufferSecurityCheck>false</BufferSecurityCheck>

      <CompileAs>Default</CompileAs>

      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

    </ClCompile>

    <Link>

      <AdditionalDependencies>ntoskrnl.lib;wdm.lib;wdmsec.lib;wmilib.lib;ndis.lib;Hal.lib;MSVCRT.LIB;LIBCMT.LIB;%(AdditionalDependencies)</AdditionalDependencies>

    </Link>

    <Link>

      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>

      <EnableUAC>false</EnableUAC>

      <SubSystem>Native</SubSystem>

      <EntryPointSymbol>DriverEntry</EntryPointSymbol>

      <BaseAddress>0x10000</BaseAddress>

      <RandomizedBaseAddress>

      </RandomizedBaseAddress>

      <DataExecutionPrevention>

      </DataExecutionPrevention>

      <GenerateDebugInformation>true</GenerateDebugInformation>

      <Driver>Driver</Driver>

    </Link>

  </ItemDefinitionGroup>

  <ItemGroup />

</Project>

保存文件,关闭VS2010,重新打开VS2010即可。

VS2010+WDK配置驱动开发环境

7、PS:配置文件生成后,以后新建工程时可以直接使用,在第四部中就不需要新建一个配置文件,直接添加生成的配置文件即可

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢