WDF model: This is the WDF model. The difference between the WDM model and the WDF model has been discussed in the Windows WDM Driver Design. We can see from this model: for applications, either the WDM driver or the WDF driver model is transparent. Likewise, for Kernel subsystems, both WDM and WDF drivers are the same. Let's take a look at the framework. For the WDF driver framework, the framework includes the object model, I/O model, PNP/power model, and the object model is used to create the WDF object, the I/O model is input and output. for WDM and WDF, Io processing is different. For WDM, the IO manager is responsible for dispatching IRPs, but for WDF, it is distributed by IRP and IO queues. For PNP power management, the framework model is basically finished for us; then, let's look at the framework objects, which is created by the object model; and Callbacks is the callback function that must be compiled for the driver: for example, read functions, write functions, and special PNP and power management functions. WDF object • about methods, properties, and events • 1)
MethodsPerform actions on the object. • 2)
Properties:•
3) Events:Are messages that indicate that something has occurred for which a driver might be required to take action. 3. WDM and WDF drivers
Wdfdriver |
Driver object |
Wdfdevice |
Device object |
Wdfqueue |
Cancel-safe queue/dispatching/serialization/auto-locking/synch with PNP |
Wdfrequest |
IRP |
Wdfinterrupt |
Interrupt |
Wdfdpc |
DPC |
Wdfworkitem |
Work Item |
Wdfdmaenabler |
DMA adapter object |
Wdfiotarget |
Sending I/O to another driver-iocalldriver |
Wdfwaitlock |
Event dispatcher object-passive Level Lock |
Wdfspinlock |
Spinlock |
Wdfmemory |
Kernel pool-refcounted |
Wdfkey |
Registry Access |
4) Why to port a driver
• Here are a few advantages of porting a driver to kmdf.
• 1) kmdf drivers are simpler and easier to maintain.
• 2) kmdf manages most interactions with the operating system.
• 3) kmdf supports versioning and is tested for each release of the operating system.