gpt4 book ai didi

c++ - Visual Studio 驱动程序部署失败

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:43:30 26 4
gpt4 key购买 nike

我是驱动程序开发的新手,为了方便起见,我只想先进行一个简单的设置,我可以在其中编译我的驱动程序并在 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 来自目标主机。

有什么想法吗?

最佳答案

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

“它说启动主机进程需要 Te.service。如果已经安装,请重新启动它”=> 谷歌“Te.Service 重启”=> https://learn.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”

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

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

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

您是内核驱动程序开发的新手吗?也许我们以后可以就这个问题互相帮助:)

希望对你有帮助!

关于c++ - Visual Studio 驱动程序部署失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44235996/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com