【问题标题】:Visual Studio driver deployment failsVisual Studio 驱动程序部署失败
【发布时间】:2017-10-29 09:06:27
【问题描述】:

我是驱动程序开发的新手,为了方便起见,我想先获得一个简单的设置,我可以在其中编译我的驱动程序并在 Visual Studio 2015 上按 F5 以在我的 VMware 机器上调试它。我尝试过这样做,但遇到了 Google 根本无法帮助我解决的问题。

我的基本设置是一台 Windows 10 x64 VMWare 机器,以串行端口作为目标,Windows 10 x64 作为主机。目标在主机上。

首先,这是我尝试调试驱动程序时在 Visual Studio 中的 windbg 中获得的完整日志:

Microsoft (R) Windows Debugger Version 10.0.15063.400 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

DESKTOP-AF13U59\Lupe (npipe WinIDE_01D2D83A52532800) connected at Mon May 29 00:13:35 2017

Microsoft (R) Windows Debugger Version 10.0.15063.400 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

Opened \\.\pipe\com_1
Waiting to reconnect...
[00:13:36:302]: Remove Existing Remote Package
[00:13:37:137]: Task "Remove Existing Remote Package" completed successfully
[00:13:37:143]: Copy Driver Package
[00:13:40:517]: Task "Copy Driver Package" completed successfully
[00:13:40:532]: Driver Removal
[00:13:40:532]: Removing any existing files from test execution folder.
[00:13:41:367]: Copying required files for "Driver Removal".

$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverRemoval'" /p:"InfFile=auxkdb.inf" /p:"ImportDriver=1" /p:"RemoveDriver=1" /p:"CertificateFile=auxkdb.cer" /p:"PackageGuid=x64" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Removal_00014.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated




Error message: Unable to start process
[00:13:50:909]: Driver Preparation
[00:13:50:910]: Removing any existing files from test execution folder.
[00:13:51:745]: Copying required files for "Driver Preparation".

$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverPreparation'" /p:"InfFile=auxkdb.inf" /p:"ImportDriver=1" /p:"RemoveDriver=1" /p:"CertificateFile=auxkdb.cer" /p:"PackageGuid=x64" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Preparation_00014.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated




Error message: Unable to start process
[00:14:01:351]: Default Driver Package Installation Task
[00:14:01:351]: Removing any existing files from test execution folder.
[00:14:02:185]: Copying required files for "Default Driver Package Installation Task".

$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DefaultDriverPackageInstallationTask.dll" /select:"@Name='Microsoft.DriverKit.DefaultDriverPackageInstallationClass.PerformDefaultDriverPackageInstallation'" /p:"AbsoluteDriverPackagePath=%SystemDrive%\DriverTest\Drivers\auxkdb.inf" /p:"DQ=%SystemDrive%\DriverTest\Drivers\auxkdb.inf" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Default_Driver_Package_Installation_Task_00012.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated




Error message: Unable to start process
[00:14:11:710]: Driver Post Install Actions
[00:14:11:711]: Removing any existing files from test execution folder.
[00:14:12:545]: Copying required files for "Driver Post Install Actions".

$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverPostInstall'" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Post_Install_Actions_00014.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated




Error message: Unable to start process

似乎可以将驱动程序文件放入C:\DriverTest\DriversNew,但它永远不会启动驱动程序。

其他基本信息:

  • 主机和目标的防火墙均已关闭
  • 我可以在主机上按名称 ping 虚拟机
  • 我可以用windbg调试同一个端口的VM
  • Visual Studio 中的机器显示“已配置用于驱动程序测试”,因此它似乎认为一切正常,至少

我不知道还能提供什么,但the only other occurrence of the problem I could find 是自我回答的,并说通过重新安装Visual Studio、Windows SDK 和WDK 解决了问题。我做了所有这些事情,也尝试过目标是 Windows 7 x64,但问题仍然存在。它也确实创建了 WDKRemoteUser 并登录,之后什么也没有(似乎)。

我将来自this page 的所有链接用于 VS、SDK 和 WDK,所以我认为这不是某种版本不匹配,并且我已经从目标主机上安装了 C:\Program Files (x86)\Windows Kits\10\Remote\x64\WDK Test Target Setup x64-x64_en-us.msi

有什么想法吗?

【问题讨论】:

    标签: c++ visual-studio-2015 vmware


    【解决方案1】:

    我刚刚找到它的来源:p 当 VS 开始调试时,我也有 3 或 4 个 cmd 显示,但速度非常快,所以我看不懂它说什么。 我设法截屏:http://imgur.com/a/Lw5Pe。 (第二张图片)

    “它说需要 Te.service 来启动主机进程。如果已经安装,请重新启动它” => 谷歌“Te.Service 重启” => https://docs.microsoft.com/en-us/windows-hardware/drivers/taef/te-service

    所以:

    1. 我去了 C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\TAEF
    2. 以管理员身份打开了一个新的 CMD
    3. 运行:“Wex.Services.exe /install:Te.Service” 我收到“警告:Te.Service 安装正在删除以前的 Te.Service 安装,因为关联的二进制文件已被删除或无法在“C:\Program Files (x86)\Windows Kits\10\Testing\Runtimes\TAEF\ Wex.Services.exe”。 安装 Te.Service [成功]" YEAAH :p
    4. 然后我运行了“sc start Te.Service”

    之后我没有再遇到同样的错误。

    但我收到另一个错误“无法提升用户的令牌,因为用户不是管理员”http://imgur.com/a/Lw5Pe(第一张图片)

    VS 强制我切换到它之前创建的另一个用户,所以没有管理员权限。 所以我将它添加到 admin localgroup : “网络本地组管理员 WDKRemoteUser /add” 法语: "net localgroup administrateurs WDKRemoteUser /add"

    您是内核驱动开发新手吗?也许我们将来可以在这个问题上互相帮助:)

    希望对你有所帮助!

    【讨论】:

      猜你喜欢
      • 2021-02-16
      • 2019-11-27
      • 1970-01-01
      • 2013-11-09
      • 2016-09-06
      • 1970-01-01
      • 2016-03-28
      • 2012-10-30
      • 2017-01-30
      相关资源
      最近更新 更多