Wednesday, June 1, 2016

Creating a Bus Filter Driver Is As Easy As 1-2-3

How to make a KMDF-based upper filter driver behave as a bus filter?
Easy! Just follow three steps:
  1. Initialize Bus Filter Framework in DriverEntry, after a call to WdfDriverCreate.
  2. Call WdfDeviceInitAssignWdmIrpPreprocessCallback in your EvtDriverDeviceAdd callback function, to register a Bus Filter Framework handler for IRP_MJ_PNP/IRP_MN_QUERY_DEVICE_RELATIONS/BusRelations.
  3. Allocate context space for an upper filter device object on behalf of Bus Filter Framework in your EvtDriverDeviceAdd callback function, after a call to WdfDeviceCreate.
That's it!

No comments:

Post a Comment