无法部署SimpleMediaSource

问题描述 投票:0回答:1

SimpleMediaSource(Windows-driver-samples 的示例)(https://github.com/microsoft/Windows-driver-samples) 无法部署。请帮忙。

首先,我克隆了这个存储库,并使用最新的 Visual Studio Community(版本 17.7.2)和最新的 22H2 SDK&WDK 构建了 SimpleMediaSource。不幸的是,此解决方案的构建过程失败,并显示错误消息: Error MSB4044 The "ValidateNTTargetVersion" task was not given a value for the required parameter "ValidNTTargetVersions".

其次,我通过将“配置属性”的“驱动程序设置”中的“目标操作系统版本”编辑为“Windows 10或更高版本”解决了这个问题。然后就搭建成功了。

第三,我按照 README 中的说明,将 x64/release 中的输出复制到我的测试机。另外,我在我的测试机中安装了证书。

第四,我通过特权PowerShell执行了README中提到的命令:

PS C:\simpleMediaSource\SimpleMediaSourceDriver> & 'C:\Program Files (x86)\Windows Kits\10\Tools\10.0.22621.0\x64\devgen.exe' /add /bus ROOT /hardwareid root\SimpleMediaSource
Microsoft Device Generator

Device successfully created. Device Instance ID: ROOT\DEVGEN\{4829BE55-A885-E541-B1FD-9AD84349DDE9}

第一个命令执行成功。 但是当谈到第二个命令时:

PS C:\simpleMediaSource\SimpleMediaSourceDriver> pnputil /add-driver SimpleMediaSourceDriver.inf /install
Microsoft PnP Utility

Adding driver package:  SimpleMediaSourceDriver.inf
Driver package added successfully. (Already exists in the system)
Published Name:         oem22.inf
Unable to install driver package: The installation failed because a function driver was not specified for this device instance.
Unable to install driver package: The installation failed because a function driver was not specified for this device instance.
Unable to install driver package: The installation failed because a function driver was not specified for this device instance.

Total driver packages:  1
Added driver packages:  0

如何解决这个问题?我真的需要并感谢您的帮助。

windows driver umdf windows-driver
1个回答
0
投票

好的,登录C:\Windows\INF\setupapi.dev.log的部分如下:

     dvi:                                         Strong Name=oem3.inf:741f41b5bd9588f8:SimpleMediaSource:20.56.44.28:root\simplemediasource
     dvi:                                    {Writing Device Properties - Complete}
!    dvi:                                    Could not include WUDFRD.inf under [SimpleMediaSource.NT.Services].
!!!  dvi:                                    Error: No INF AddService directives contained the flag SPSVCINST_ASSOCSERVICE
!!!  dvi:                                    Error while installing services.
!!!  dvi:                                    Error 0xe0000219: The installation failed because a function driver was not specified for this device instance.
!!!  dvi:                                    Cleaning up failed installation
!!!  dvi:                                    Error 0xe0000219: The installation failed because a function driver was not specified for this device instance.
     dvi:                               {Install DEVICE exit (0xe0000219)}
!!!  dvi:                               Cleaning up failed installation (e0000219)
!!!  dvi:                          Default installer: failed
!!!  dvi:                          Error 0xe0000219: The installation failed because a function driver was not specified for this device instance.
     dvi:                          CoInstaller 1: Enter (Post Processing) 04:13:56.541
     dvi:                          CoInstaller 1: Exit (Post Processing)
     dvi:                     {DIF_INSTALLDEVICE - exit(0xe0000219)} 04:13:56.541
!!!  dvi:                     Error(e0000219) installing device!
     dvi:                {Install Device - exit(0xe0000219)} 04:13:56.541
     dvi:           {Core Device Install - exit(0xe0000219)} 04:13:56.541
     dvi:           {DIF_DESTROYPRIVATEDATA} 04:13:56.541

我发现 错误:没有 INF AddService 指令包含标志 SPSVCINST_ASSOCSERVICE 意味着 .inf 文件中的 *.Services 部分有问题。

解决办法:确保INF文件中Services部分(如DDInstall.Services部分)中AddService指令的所有描述正确。并且还要确保“包含”和“需要”的目标在 Windows Vista 中存在。

因此我检查了 .inf 文件,发现它包含 WUDFRD.inf,该文件仅包含在 Windows 11 及更高版本中。不幸的是,我在win10虚拟机中运行了这个示例。所以安装失败。

© www.soinside.com 2019 - 2024. All rights reserved.