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.
can i write lower level filter driver with umdf ?
No, the UMDF driver has to be at the top of the stack. The rest of the drivers have to be in the kernel. So, you can have an UMDF upper-level filter or a UMDF function driver, but you cannot have a UMDF lower level filter.
I'm doing some firmware and hardware design needs to create drivers for windows.
trying to make my computer work better
You say that UMDF can be use for software-only driver, e.g. virtual ports. I assume that this includes also virtual COM ports. But how can I handle the unsupported IRPs, e.g. IRP_MJ_FLUSH_FILE_BUFFERS?
Can I write a User-Mode driver to control copying some files (located by Database) to terminal devices like USB, DVD,...?
do you have some example like skeleton that describe step by step, what do every comand line in the driver code?, and what is the main file code in the example skeleton?, i dont know where to begining.
i forgot i trying to do a umdf driver for a USB bulk or isochronous transfer