The first WDF framework that I'll talk about is the UMDF (User-Mode Driver Framework). This framework allows the development of user-mode drivers. Currently, the supported devices are USB non-isochronous devices, like digital cameras, portable media players, cell phones, PDAs, etc. Isochronous devices are the ones that require the data rate to flow continuously and at a steady rate, e.g. webcams, and their drivers are developed using the Kernel-Mode Driver Framework (KMDF), which I'll analyse in one of my future posts.
The first thought that comes to somebody's mind, when he hears the term "user-mode driver" is that this driver is 1)going to be slow and it 2)might also have stability or security issues, since the code will not be loaded in the protected memory area, where the kernel resides. So, let's look at both these potential problems. First of all, we've conducted measurements that show that the bottleneck in user-mode drivers is not the overhead of the additional user-to-kernel mode transisions, but the hardware bus. UMDF's WinHEC 2006 presentation states that "UMDF can easily saturate a USB 2.0 bus' maximum speed of 480 megabits/sec"! So, clearly performance in not an issue in our case. In addition, regarding the security issue, I need to remind you that: 1)one user-mode process cannot corrupt the memory that belongs to any other user-mode process or to the kernel and 2)if a user-mode process crashes, then the system continues normally, whereas if a kernel component crashes, then the Blue Screen Of Death (BSOD) appears and the computer is halted. So, we understand that user-mode drivers are actually even more secure than kernel-mode drivers, because another process cannot cause them to crash and also even if they crash (e.g. because of a programmatic error), the rest of the system remains intact!
Now that we've gone through the original "fears" behind UMDF let's talk about its advantages:
So, now it's time to understand, when it's better to use UMDF over KMDF or the opposite. Generally, you should use UMDF:
On the other hand, you should use KMDF:
Of course, you can always create a hybrid driver that is consisted of both a UMDF and a KMDF part :)
For addition information in UMDF, I have gather a list of very useful links that don't only talk about UMDF's architecture, but also describe how to develop a user-mode driver.