yoyo
yoyo

Reputation: 31

Can't deploy SimpleMediaSource

SimpleMediaSource, a sample of Windows-driver-samples(https://github.com/microsoft/Windows-driver-samples), can't be deployed. Please help.

First, I cloned this repos and built SimpleMediaSource with latest Visual Studio Community(Version 17.7.2) and latest 22H2 SDK&WDK. Unfortunately, The building process of this solution was failed with an error message: Error MSB4044 The "ValidateNTTargetVersion" task was not given a value for the required parameter "ValidNTTargetVersions".

Second, I solved this problem by editing the "Target OS Version" in "Driver Setting" of "Configuration Properties" to "Windows 10 or higher". Then, it built successfully.

Third, I followed the instructions in README, copied the output in x64/release to my test machine. Also, I installed the certificate in my test machine.

Fourth, I executed the commands mentioned in README by privileged PowerShell:

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}

the first command executed successfully. But when it comes to the second command:

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

How to solve this problem? I really need and appreciate your help.

Upvotes: 0

Views: 374

Answers (1)

yoyo
yoyo

Reputation: 31

Ok, The section of log in C:\Windows\INF\setupapi.dev.log is as follows:

     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

I figured out that Error: No INF AddService directives contained the flag SPSVCINST_ASSOCSERVICE means there are something wrong with *.Services section in .inf file.

Solutions:Ensure that all description of the AddServicedirective in the Servicessection (such as DDInstall.Servicessection) in the INF file is correct. And also ensure that the target of "Include"and"Needs"exists in Windows Vista.

So I checked my .inf file and noticed that it includes WUDFRD.inf which is included only with Windows 11 and later. Unfortunately, I ran this sample in a win10 virtual machine. So it failed to install.

Upvotes: 0

Related Questions