Ayala 发表于 2017-3-20 16:42:18

【配置】vs2010 ddk7600

本帖最后由 Ayala 于 2017-3-20 18:51 编辑

vs2010 和 ddk安装过程略过 预定义符号 debug模式 DBG;_DEBUG;_DEBUG_;

新建一个空项目 新建文件

#include <ntdef.h>
#include <ntddk.h>

NTSTATUS
DriverEntry(IN PDRIVER_OBJECT DriverObject,IN PUNICODE_STRING RegistryPath)
{
      return 0;
}
右键 项目 属性

在配置属性页中选择 配置管理器 建立一个新配置

修改配置
































































































测试

Ayala 发表于 2017-3-20 21:41:16

本帖最后由 Ayala 于 2017-3-21 09:00 编辑

default.vcxproj

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="sysDebug|Win32">
      <Configuration>sysDebug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="sysDebug|x64">
      <Configuration>sysDebug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="sysRelease|Win32">
      <Configuration>sysRelease</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="sysRelease|x64">
      <Configuration>sysRelease</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <UseOfMfc />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'" Label="Configuration">
    <UseOfMfc />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'" Label="Configuration">
    <UseOfMfc />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'" Label="Configuration">
    <UseOfMfc />
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <UseOfAtl />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'" Label="Configuration">
    <UseOfAtl />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'" Label="Configuration">
    <UseOfAtl />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'" Label="Configuration">
    <UseOfAtl />
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <CLRSupport />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'" Label="Configuration">
    <CLRSupport />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'" Label="Configuration">
    <CLRSupport />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'" Label="Configuration">
    <CLRSupport />
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <WholeProgramOptimization />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'" Label="Configuration">
    <WholeProgramOptimization />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'" Label="Configuration">
    <WholeProgramOptimization />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'" Label="Configuration">
    <WholeProgramOptimization />
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <Import Project="$(VSInstallDir)VC\VCWizards\default.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'" Label="PropertySheets">
    <Import Project="$(VSInstallDir)VC\VCWizards\default.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'" Label="PropertySheets">
    <Import Project="$(VSInstallDir)VC\VCWizards\default.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'" Label="PropertySheets">
    <Import Project="$(VSInstallDir)VC\VCWizards\default.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <OutDir>$(SolutionDir)$(Configuration)\i386\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'">
    <OutDir>$(SolutionDir)$(Configuration)\i386\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'">
    <OutDir>$(SolutionDir)$(Configuration)\amd64\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'">
    <OutDir>$(SolutionDir)$(Configuration)\amd64\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <IntDir>$(SolutionDir)$(Configuration)\i386\temp\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'">
    <IntDir>$(SolutionDir)$(Configuration)\i386\temp\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'">
    <IntDir>$(SolutionDir)$(Configuration)\amd64\temp\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'">
    <IntDir>$(SolutionDir)$(Configuration)\amd64\temp\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <TargetExt>.sys</TargetExt>
    <ExecutablePath>$(WINDDK)bin\x86\x86</ExecutablePath>
    <IncludePath>$(WINDDK)inc;$(WINDDK)inc\crt;$(WINDDK)inc\api;$(WINDDK)inc\ddk;$(WINDDK)inc\wdf</IncludePath>
    <ReferencePath />
    <LibraryPath>$(WINDDK)lib\wxp\i386</LibraryPath>
    <SourcePath />
    <ExcludePath />
    <GenerateManifest />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'">
    <TargetExt>.sys</TargetExt>
    <ExecutablePath>$(WINDDK)bin\x86\x86</ExecutablePath>
    <IncludePath>$(WINDDK)inc;$(WINDDK)inc\crt;$(WINDDK)inc\api;$(WINDDK)inc\ddk;$(WINDDK)inc\wdf</IncludePath>
    <ReferencePath />
    <LibraryPath>$(WINDDK)lib\wxp\i386</LibraryPath>
    <SourcePath />
    <ExcludePath />
    <GenerateManifest />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'">
    <TargetExt>.sys</TargetExt>
    <ExecutablePath>$(WINDDK)bin\x86\amd64</ExecutablePath>
    <IncludePath>$(WINDDK)inc;$(WINDDK)inc\crt;$(WINDDK)inc\api;$(WINDDK)inc\ddk;$(WINDDK)inc\wdf</IncludePath>
    <ReferencePath />
    <LibraryPath>$(WINDDK)lib\win7\amd64</LibraryPath>
    <SourcePath />
    <ExcludePath />
    <GenerateManifest />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'">
    <TargetExt>.sys</TargetExt>
    <ExecutablePath>$(WINDDK)bin\x86\amd64</ExecutablePath>
    <IncludePath>$(WINDDK)inc;$(WINDDK)inc\crt;$(WINDDK)inc\api;$(WINDDK)inc\ddk;$(WINDDK)inc\wdf</IncludePath>
    <ReferencePath />
    <LibraryPath>$(WINDDK)lib\win7\amd64</LibraryPath>
    <SourcePath />
    <ExcludePath />
    <GenerateManifest />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <Link>
      <AdditionalDependencies>ntoskrnl.lib;hal.lib</AdditionalDependencies>
    </Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'">
    <Link>
      <AdditionalDependencies>ntoskrnl.lib;hal.lib</AdditionalDependencies>
    </Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'">
    <Link>
      <AdditionalDependencies>ntoskrnl.lib;hal.lib</AdditionalDependencies>
    </Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'">
    <Link>
      <AdditionalDependencies>ntoskrnl.lib;hal.lib</AdditionalDependencies>
    </Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|Win32'">
    <Link>
      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
      <ManifestFile>
      </ManifestFile>
      <AllowIsolation>
      </AllowIsolation>
      <EnableUAC>
      </EnableUAC>
      <UACExecutionLevel>
      </UACExecutionLevel>
      <UACUIAccess>
      </UACUIAccess>
      <SubSystem>Native</SubSystem>
      <Driver>Driver</Driver>
      <ProfileGuidedDatabase>
      </ProfileGuidedDatabase>
      <IgnoreEmbeddedIDL>
      </IgnoreEmbeddedIDL>
      <TypeLibraryResourceID>
      </TypeLibraryResourceID>
      <EntryPointSymbol>DriverEntry</EntryPointSymbol>
      <RandomizedBaseAddress>
      </RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <TurnOffAssemblyGeneration>
      </TurnOffAssemblyGeneration>
      <TargetMachine>MachineX86</TargetMachine>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
    <ClCompile>
      <PreprocessorDefinitions>_X86_;DBG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|Win32'">
    <Link>
      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
      <ManifestFile>
      </ManifestFile>
      <AllowIsolation>
      </AllowIsolation>
      <EnableUAC>
      </EnableUAC>
      <UACExecutionLevel>
      </UACExecutionLevel>
      <UACUIAccess>
      </UACUIAccess>
      <SubSystem>Native</SubSystem>
      <Driver>Driver</Driver>
      <ProfileGuidedDatabase>
      </ProfileGuidedDatabase>
      <IgnoreEmbeddedIDL>
      </IgnoreEmbeddedIDL>
      <TypeLibraryResourceID>
      </TypeLibraryResourceID>
      <EntryPointSymbol>DriverEntry</EntryPointSymbol>
      <RandomizedBaseAddress>
      </RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <TurnOffAssemblyGeneration>
      </TurnOffAssemblyGeneration>
      <TargetMachine>MachineX86</TargetMachine>
      <SetChecksum>true</SetChecksum>
    </Link>
    <ClCompile>
      <PreprocessorDefinitions>_X86_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='sysDebug|x64'">
    <Link>
      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
      <ManifestFile>
      </ManifestFile>
      <AllowIsolation>
      </AllowIsolation>
      <EnableUAC>
      </EnableUAC>
      <UACExecutionLevel>
      </UACExecutionLevel>
      <UACUIAccess>
      </UACUIAccess>
      <SubSystem>Native</SubSystem>
      <Driver>Driver</Driver>
      <ProfileGuidedDatabase>
      </ProfileGuidedDatabase>
      <IgnoreEmbeddedIDL>
      </IgnoreEmbeddedIDL>
      <TypeLibraryResourceID>
      </TypeLibraryResourceID>
      <EntryPointSymbol>DriverEntry</EntryPointSymbol>
      <RandomizedBaseAddress>
      </RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <TurnOffAssemblyGeneration>
      </TurnOffAssemblyGeneration>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
    <ClCompile>
      <PreprocessorDefinitions>_AMD64_;_WIN64;_M_AMD64;DBG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='sysRelease|x64'">
    <Link>
      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
      <ManifestFile>
      </ManifestFile>
      <AllowIsolation>
      </AllowIsolation>
      <EnableUAC>
      </EnableUAC>
      <UACExecutionLevel>
      </UACExecutionLevel>
      <UACUIAccess>
      </UACUIAccess>
      <SubSystem>Native</SubSystem>
      <Driver>Driver</Driver>
      <ProfileGuidedDatabase>
      </ProfileGuidedDatabase>
      <IgnoreEmbeddedIDL>
      </IgnoreEmbeddedIDL>
      <TypeLibraryResourceID>
      </TypeLibraryResourceID>
      <EntryPointSymbol>DriverEntry</EntryPointSymbol>
      <RandomizedBaseAddress>
      </RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <TurnOffAssemblyGeneration>
      </TurnOffAssemblyGeneration>
      <SetChecksum>true</SetChecksum>
    </Link>
    <ClCompile>
      <PreprocessorDefinitions>_AMD64_;_WIN64;_M_AMD64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>



$(VSInstallDir)VC\VCWizards\default.props
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="UserMacros">
    <WINDDK>C:\WinDDK\7600.16385.1\</WINDDK>
</PropertyGroup>
<PropertyGroup>
    <OutDir />
</PropertyGroup>
<PropertyGroup>
    <IntDir />
</PropertyGroup>
<PropertyGroup>
    <TargetName>$(ProjectName)</TargetName>
</PropertyGroup>
<PropertyGroup>
    <TargetExt>.sys</TargetExt>
</PropertyGroup>
<PropertyGroup>
    <ExtensionsToDeleteOnClean>$(ExtensionsToDeleteOnClean)</ExtensionsToDeleteOnClean>
    <IncludePath>$(WINDDK)inc;$(WINDDK)inc\crt;$(WINDDK)inc\api;$(WINDDK)inc\ddk;$(WINDDK)inc\wdf</IncludePath>
</PropertyGroup>
<ItemGroup>
    <BuildMacro Include="WINDDK">
      <Value>$(WINDDK)</Value>
      <EnvironmentVariable>true</EnvironmentVariable>
    </BuildMacro>
</ItemGroup>
<ItemDefinitionGroup>
    <ClCompile>
      <DebugInformationFormat>
      </DebugInformationFormat>
      <Optimization>
      </Optimization>
      <InlineFunctionExpansion>
      </InlineFunctionExpansion>
      <IntrinsicFunctions>
      </IntrinsicFunctions>
      <FavorSizeOrSpeed>
      </FavorSizeOrSpeed>
      <OmitFramePointers>
      </OmitFramePointers>
      <EnableFiberSafeOptimizations>
      </EnableFiberSafeOptimizations>
      <WholeProgramOptimization>
      </WholeProgramOptimization>
      <MinimalRebuild>
      </MinimalRebuild>
      <ExceptionHandling>
      </ExceptionHandling>
      <SmallerTypeCheck>
      </SmallerTypeCheck>
      <BasicRuntimeChecks>
      </BasicRuntimeChecks>
      <RuntimeLibrary>
      </RuntimeLibrary>
      <StructMemberAlignment>
      </StructMemberAlignment>
      <BufferSecurityCheck>
      </BufferSecurityCheck>
      <CallingConvention>StdCall</CallingConvention>
      <CompileAs>CompileAsC</CompileAs>
    </ClCompile>
    <Link>
      <EntryPointSymbol>DriverEntry</EntryPointSymbol>
      <AdditionalDependencies>ntoskrnl.lib;hal.lib</AdditionalDependencies>
      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
    </Link>
</ItemDefinitionGroup>
</Project>

Ayala 发表于 2017-3-20 16:43:08

本帖最后由 Ayala 于 2017-3-20 16:48 编辑

x64模式














Ayala 发表于 2017-3-20 16:50:32

本帖最后由 Ayala 于 2017-3-20 20:02 编辑

Release 预处理器定义删除 _DEBUG

x86



x64




操作成功之后 最后打开vs安装目录
打开
\Microsoft Visual Studio 10.0\VC\VCWizards\default.vcxproj
先备份下 之后按照之前操作 进行设置

页: [1]
查看完整版本: 【配置】vs2010 ddk7600