Windows 7 Deployment Target - GenFilter Sample

I’m developing a filter driver for hid badge reader. I just need to intercept the scan and do some checks. This should be pretty straight forward, but I’m having trouble deploying it from Win11 VS2019 to my Win 7 Target. I’m probably missing something simple

Driver Install
[14:21:00:725]: Removing any existing files from test execution folder.
[14:21:00:775]: Copying required files for “Driver Install”.
[14:21:11:267]: [Driver Install] Command Line:
$KitRoot$\Testing\Runtimes\TAEF\te.exe “%SystemDrive%\DriverTest\Run\DriverTestTasks_downlevel.dll” /select:“@Name=‘DriverTestTasks::_RunProcess’” /p:“BinaryPath=%SystemDrive%\DriverTest\devcon.exe” /p:“Arguments=-f install %SystemDrive%\DriverTest\Drivers\GenFilter.inf GenFilter” /p:“WorkingFolder=%SystemDrive%\DriverTest\Drivers” /rebootStateFile:%SystemDrive%\DriverTest\Run\DriverTestReboot.xml /enableWttLogging /wttDeviceString:$LogFile:file=“%SystemDrive%\DriverTest\Run\Driver_Install_00000.wtl”,writemode=append,encoding=unicode,nofscache=true,EnableLvl=“WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|" /runas:Elevated
[14:21:14:848]: Result Summary: Total=1, Passed=0, Failed=1, Blocked=0, Warned=0, Skipped=0
[14:21:14:849]: ERROR: Task “Driver Install” failed to complete successfully. Look at the logs in the driver test group explorer for more details on the failure.
[14:21:15:465]: Driver Post Install Actions
[14:21:15:467]: Removing any existing files from test execution folder.
[14:21:15:609]: Copying required files for “Driver Post Install Actions”.
[14:21:33:260]: [Driver Post Install Actions] Command Line:
$KitRoot$\Testing\Runtimes\TAEF\te.exe “%SystemDrive%\DriverTest\Run\DriverTestTasks_downlevel.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
[14:21:34:830]: Result Summary: Total=1, Passed=1, Failed=0, Blocked=0, Warned=0, Skipped=0

I checked the Task Driver install in the driver test group and the only error in there. A bit puzzling. Any advice is appreciated.



Failed


The default driver package installation task has this which I am investigating, but not finding anything on this error so far.

<Error
File=“”
Line=“-1”
ErrCode=“0x0”
ErrType=“”
ErrorText=“Error 0x00000000”
UserText="System.IO.FileNotFoundException: Could not load file or assembly ‘WDTF.Interop, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.
File name: ‘WDTF.Interop, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’
at Microsoft.DriverKit.DefaultDriverPackageInstallationClass.PerformDefaultDriverPackageInstallation()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
" CA=“53761” LA=“54314” >

Thank you!
Jay

Are you trying to use WDTF? To the best of my knowledge, that component requires at least Windows 10.

Ah. I am actually going that route. I’m building a windows 10 test machine to see if it works there. Any thoughts on easy testing with Windows 7/10 devices for an upper filter? I manually deployed GenFilter to a windows 10 device and it blocked the entire HIDClass instead of the device I was targeting. Lost both mouse and keyboard and had to reimage. Maybe that is the process of debugging, but feels like I am missing something. Any advice is greatly appreciated.

Well, if you’re testing a HID filter, then install the filter only on that device, and not on the whole class.

@JAtkins said:
Any thoughts on easy testing with Windows 7/10 devices for an upper filter?

Sure - don’t use WDTF. Install the test driver yourself, either manually or with your own automation software.

What they said. If you’re trying to use the whole VS-built-in-deploy thing, be advised that it really doesn’t work reliably.

Just don’t use it. Install your driver yourself. Once you’ve done the install on a given system ONE TIME, then all you need to do is disable the driver in Device Manager, copy the new image to \windows\system32\drivers, and re-enable the driver in Device Manager. Done… and without any magic nonsense in VS involved.

Peter

1 Like

Thank you everyone!