Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Windows 7 Deployment Target - GenFilter Sample

JAtkinsJAtkins Member Posts: 5

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

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,317

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

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • JAtkinsJAtkins Member Posts: 5

    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.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,317

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

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,538

    @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.

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,986

    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

    Peter Viscarola
    OSR
    @OSRDrivers

  • JAtkinsJAtkins Member Posts: 5

    Thank you everyone!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 12 September 2022 Live, Online
Internals & Software Drivers 23 October 2022 Live, Online
Kernel Debugging 14 November 2022 Live, Online
Developing Minifilters 5 December 2022 Live, Online