none
How to attach a KMDF based upper/lower filter driver with the other driver ? RRS feed

  • Question

  • I have just started  working on disk cache filter driver. I read we can use ioattachdevice() but I do not know whether we can use it in KMDF based filter driver. I thought we are suppose to use only WDF api's. I am unclear with the point of adding a driver as a upper or lower filter driver.Is it through WDF callbackroutine or changing in the INF file.  
    Friday, July 12, 2013 12:12 PM

Answers

  • Filter drivers are done through the INF file.  Take a look at the generic filter in the Toaster sample driver for a good basis to get started.  IoAttachDevice is a WDM concept you don't use it in KMDF.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Friday, July 12, 2013 12:27 PM
  • You need an INF.  You can use DifxAPI to invoke the installation of the driver.   Two of the lines from the INX file of the sample I suggested (INX get converted to INF by the build process) are:

    [ToasterFilter.NT.HW.AddReg] 
    HKR,,"UpperFilters",0x00010000,"ToasterFilter"

    Change the UpperFilters to LowerFilters if you want a lower filter driver.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Friday, July 12, 2013 2:15 PM

All replies

  • Filter drivers are done through the INF file.  Take a look at the generic filter in the Toaster sample driver for a good basis to get started.  IoAttachDevice is a WDM concept you don't use it in KMDF.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Friday, July 12, 2013 12:27 PM
  • Do we really need a INF file for installing a kmdf based filter driver or we can write an application and add the service and registry manually? And how can we attach our  filter driver as upper/lower filter driver?
    Friday, July 12, 2013 2:03 PM
  • You need an INF.  You can use DifxAPI to invoke the installation of the driver.   Two of the lines from the INX file of the sample I suggested (INX get converted to INF by the build process) are:

    [ToasterFilter.NT.HW.AddReg] 
    HKR,,"UpperFilters",0x00010000,"ToasterFilter"

    Change the UpperFilters to LowerFilters if you want a lower filter driver.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Friday, July 12, 2013 2:15 PM
  • I think for KMDF based filter driver installation we can not use DifxAPI. 
    Monday, July 15, 2013 7:17 AM
  • What makes you think that?  I've done it for clients.

    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Monday, July 15, 2013 10:23 AM
  • I was reading sample code for kmdf filter driver. In that code it was suggested to use non-pnp install file(with some modification) for installation and it uses services api. On some other forum, they have used setup api's and your are suggesting to use DifxAPI. By all this I really got confused which to use and how to modify INF file.
    Monday, July 15, 2013 12:50 PM