创建虚拟HID设备vhidmini2

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

我正在尝试为Windows 10 1809创建一个虚拟HID设备,但我卡住了。我使用Visual Studio 2017,我想从vhidmini2示例开始,可在以下位置找到:https://github.com/Microsoft/Windows-driver-samples/tree/master/hid/vhidmini2

我能够创建一个合适的目标设备,并将其设置为将驱动程序部署到该设备中。

部署日志:

Deploying driver files for project "C:\Users\***\Documents\vs\vhidmini2\driver\kmdf\vhidmini.vcxproj".  Deployment may take a few minutes...
[16:46:54:953]: Remove Existing Remote Package
[16:46:54:958]: Task "Remove Existing Remote Package" completed successfully
[16:46:55:161]: Copy Driver Package
[16:46:55:463]: Task "Copy Driver Package" completed successfully
[16:46:55:465]: Driver Removal
[16:46:55:465]: Removing any existing files from test execution folder.
[16:46:55:487]: Copying required files for "Driver Removal".
[16:46:57:411]: [Driver Removal] Command Line:
$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverRemoval'" /p:"InfFile=vhidmini.inf" /p:"ImportDriver=1" /p:"RemoveDriver=1" /p:"CertificateFile=vhidmini.cer" /p:"PackageGuid=x64" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Removal_00002.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated
[16:47:43:221]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0
[16:47:43:222]: Task "Driver Removal" completed successfully
[16:47:43:492]: Driver Preparation
[16:47:43:492]: Removing any existing files from test execution folder.
[16:47:43:502]: Copying required files for "Driver Preparation".
[16:47:46:579]: [Driver Preparation] Command Line:
$KitRoot$\Testing\Runtimes\TAEF\te.exe "%SystemDrive%\DriverTest\Run\DriverTestTasks.dll" /select:"@Name='DriverTestTasks::_DriverPreparation'" /p:"InfFile=vhidmini.inf" /p:"ImportDriver=1" /p:"RemoveDriver=1" /p:"CertificateFile=vhidmini.cer" /p:"PackageGuid=x64" /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Run\Driver_Preparation_00002.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated
[16:47:50:110]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0
[16:47:50:111]: Task "Driver Preparation" completed successfully
[16:47:50:387]: Driver Post Install Actions
[16:47:50:388]: Removing any existing files from test execution folder.
[16:47:50:421]: Copying required files for "Driver Post Install Actions".
[16:47:52:251]: [Driver Post Install Actions] Command Line:
$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_00002.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*" /runas:Elevated
[16:47:53:560]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0
[16:47:53:560]: Task "Driver Post Install Actions" completed successfully

构建过程按预期工作,我可以在目标设备上运行构建的testvhid.exe,但它没有找到驱动程序应该创建的HID设备。

C:\Users\WDKRemoteUser\Desktop\Debug>testvhid.exe
....looking for our HID device (with UP=0xFF00 and Usage=0x01)
Warning: CreateFile failed: 5
Warning: CreateFile failed: 5
Failure: Could not find our HID device

我错过了什么?

windows-10 hid wdk
1个回答
0
投票

我能够让它发挥作用。我只需要填写Driver's Configuration properties -> Driver install -> Deployment -> Hardware ID驱动程序更新字段,一切都按预期工作。 enter image description here

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