Создание виртуального устройства HID vhidmini2 - PullRequest
0 голосов
/ 28 февраля 2019

Я пытаюсь создать виртуальное устройство HID для Windows 10 1809, но я застрял.Я использую 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

Что мне не хватает?

1 Ответ

0 голосов
/ 28 февраля 2019

Я смог заставить его работать.Мне просто нужно было заполнить поле Driver's Configuration properties -> Driver install -> Deployment -> Hardware ID Driver Update и все работает как положено.enter image description here

...