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.
Ok, The section of log in C:\Windows\INF\setupapi.dev.log is as follows:
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.
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.