Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 9 April 2018

Writing WDF Drivers I: Core Concepts, Manchester, NH, 7 May 2018

Kernel Debugging & Crash Analysis for Windows, Manchester, NH, 21 May 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 4  
21 Apr 17 08:34
Adam Olszak
xxxxxx@interia.pl
Join Date: 21 Apr 2017
Posts To This List: 2
Simple Keyboard filtering driver

Hello, First of all: I'm new when it goes to driver development. I went through tutorial(s) and I read a lot about drivers and how it should work but since I don't have knowledge I'm experiencing issues from the very begining... But let me explain my "simple task" - I need to write a keyboard filter - HID keyboard. - I understand that it needs to be in the Kernel space - KMDF - WDF - I took a solution in VS 2015 for Kernel drivers and I adopted it based on OSR WDF Filtering driver tutorial - The driver inf file is based on firefly example from MS (mouse filtering). More/less the same idea. I've narrowed it to a single specific keyboard ==== Current state: The driver installs on my remote machine without issues. I'm able to deploy it and I see it in the Device Manager. It is shown as a "Upper Filter" in the Device Manager. I was able to get Kernel Debug logs (via DbgPrint) and the driver is created without issues - all statuses were ok. I set my driver as filter, created device, created queue and "subscribed" my own callbacks for read/write enents. And the last thing (read/write) callbacks are not called at all. Driver files visible in Device Manager: IngacoFltr.sys (mine) kdbclass.sys kbdhid.sys SynTP.sys (this is laptop specific) Upper Filter: IngacoFltr Device stack: \Driver\kdbclass \Driver\SynTP \Driver\IngacoFltr \Driver\kbdhid \Driver\HidUsb Any comments apprieciated ;).
  Message 2 of 4  
21 Apr 17 10:22
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10195
Simple Keyboard filtering driver

What do you want the filter to do? The kbdfiltr sample is a better starting point as it has all of the relevant pieces wired in. For drivers below kbdclass you will not see reads/writes. Instead you hook the keyboard service callback chain and use it to inspect, inject, and/or reject input Bent from my phone ________________________________ From: xxxxx@lists.osr.com <xxxxx@lists.osr.com> on behalf of xxxxx@interia.pl <xxxxx@interia.pl> Sent: Friday, April 21, 2017 5:32:00 AM To: Windows System Software Devs Interest List Subject: [ntdev] Simple Keyboard filtering driver Hello, First of all: I'm new when it goes to driver development. I went through tutorial(s) and I read a lot about drivers and how it should work but since I don't have knowledge I'm experiencing issues from the very begining... But let me explain my "simple task" - I need to write a keyboard filter - HID keyboard. - I understand that it needs to be in the Kernel space - KMDF - WDF - I took a solution in VS 2015 for Kernel drivers and I adopted it based on OSR WDF Filtering driver tutorial - The driver inf file is based on firefly example from MS (mouse filtering). More/less the same idea. I've narrowed it to a single specific keyboard ==== Current state: The driver installs on my remote machine without issues. I'm able to deploy it and I see it in the Device Manager. It is shown as a "Upper Filter" in the Device Manager. I was able to get Kernel Debug logs (via DbgPrint) and the driver is created without issues - all statuses were ok. I set my driver as filter, created device, created queue and "subscribed" my own callbacks for read/write enents. And the last thing (read/write) callbacks are not called at all. Driver files visible in Device Manager: IngacoFltr.sys (mine) kdbclass.sys kbdhid.sys SynTP.sys (this is laptop specific) Upper Filter: IngacoFltr Device stack: \Driver\kdbclass \Driver\SynTP \Driver\IngacoFltr \Driver\kbdhid \Driver\HidUsb Any comments apprieciated ;). --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=02%7C01%7CDoron.Holan%40microsoft.com%7Cea5 007a009ec48c9781008d488b276bb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636283 747458042960&sdata=pDnELg%2BSU1%2BsLD6N792QTQZhi11CMH11%2BNlusNHd3rA%3D&reserved= 0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=02%7C01%7CDoron.Holan%40microsoft.com%7Cea5007a009ec48c9781008d488b27 6bb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636283747458042960&sdata=n1HHaFM DafL%2BN12JcjEQ%2FS3LrycHYfD7ejfuObhNMd0%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=02%7C01%7CDoron.Holan%40microsoft.com%7Cea5 007a009ec48c9781008d488b276bb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636283 747458042960&sdata=%2BkEVQi8Xd7XIcVQYpB%2F43X4AEIF5BEQs152gbND0oh8%3D&reserved=0> --
  Message 3 of 4  
21 Apr 17 10:39
Adam Olszak
xxxxxx@interia.pl
Join Date: 21 Apr 2017
Posts To This List: 2
Simple Keyboard filtering driver

Thank you for your response. Indeed, I should write what is all about more precisely. I would like to change some key mappings (it should be configurable by user) - more/less like it is for a normal keyboard. You press "Z" and you receive "Y" for example (that needs to be done only for a specific keyboard - and the mapping should be customizable - a few buttons can result as a single letter as an example). The kbdfiltr itself is quite big thing - specially that a lot of the code there seems to be PS/2 keyboard specific (correct me if I'm wrong). But I'm open for any suggestions.
  Message 4 of 4  
21 Apr 17 11:45
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 10195
Simple Keyboard filtering driver

It is a much better sample to start with for what you want to do. The ps2 stuff will be harmless as is or you can remove it (anything with 8042). How are you going to communicate the mappings? You can't open a direct handle to the filter (kbdclass blocks it) which is why kbdfiltr shows you how to create a raw pdo for that communication channel d -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@interia.pl Sent: Friday, April 21, 2017 7:37 AM To: Windows System Software Devs Interest List <xxxxx@lists.osr.com> Subject: RE:[ntdev] Simple Keyboard filtering driver Thank you for your response. Indeed, I should write what is all about more precisely. I would like to change some key mappings (it should be configurable by user) - more/less like it is for a normal keyboard. You press "Z" and you receive "Y" for example (that needs to be done only for a specific keyboard - and the mapping should be customizable - a few buttons can result as a single letter as an example). The kbdfiltr itself is quite big thing - specially that a lot of the code there seems to be PS/2 keyboard specific (correct me if I'm wrong). But I'm open for any suggestions. --- NTDEV is sponsored by OSR Visit the list online at: <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fshowlists.cfm%3Flist%3Dntdev&data=02%7C01%7CDoron.Holan%40microsoft.com%7Cd62 8cc995c4144bb0a5d08d488c3eeeb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636283 822542476150&sdata=7udiJMNiQtvku99BPUA7j4jbmKfjODWNprkgAWmWHN4%3D&reserved=0> MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osr.com%2Fse minars&data=02%7C01%7CDoron.Holan%40microsoft.com%7Cd628cc995c4144bb0a5d08d488c3e eeb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636283822542476150&sdata=c%2FpX0 AIZKfhZ5e21U6ZN%2F%2FpmBNlvRjGew1b9IcieuUQ%3D&reserved=0> To unsubscribe, visit the List Server section of OSR Online at <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.osronline.co m%2Fpage.cfm%3Fname%3DListServer&data=02%7C01%7CDoron.Holan%40microsoft.com%7Cd62 8cc995c4144bb0a5d08d488c3eeeb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636283 822542486164&sdata=A%2BuCOS1u0SoJl1r9cWucGFeBt4vPCKV2CafcecJlPvI%3D&reserved=0>
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 02:28.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license