As we all know, WDF driver model, starting from Windows 2000, driver development must be based on WDM. However, its development is very difficult and we cannot expect it to be as easy as user-mode application development. To improve this situation, Microsoft launched a new driver development environment. It should be pointed out in advance that this is not a reinvention, but modeling and encapsulation based on WDM. The significant feature is that it reduces the difficulty of development. because:
1. Apply the original object-based technology in ordinary programming to driver development. Although there is an object model in WDM, it is not the same thing as true object-based technology at all. In order to implement object-based technology, Microsoft carefully designed the object model and encapsulated it. Properties, methods, events, etc. "none of them can be missing".
2. Both kernel-mode drivers and user-mode drivers are built using the same object model and use the same basic carrier. This foundation is WDF. Although WDF is already an encapsulated and defined object model, for kernel mode and user mode objects, WDF is the parent object of both. In other words, both are inherited from WDF, or both are derived from WDF. Relative to the kernel mode, the derived object is called the "KMD framework" or KMDF; relative to the user mode, the derived model is called the "UMD framework" or UMDF. Regardless of the model of the framework, its internal encapsulation methods and execution behaviors are actually completed using WDM.
3. More importantly, and what Microsoft has repeatedly shown off, is the encapsulation of certain common behaviors in drivers: for example, plug and play and power management belong to this common behavior. Because most drivers need to deal with plug-and-play and power management issues, it is said that this requires about thousands of lines of code. Moreover, it may not be able to handle it well without a certain level of proficiency. In order to solve the problem once and for all, WDF simply encapsulated plug-and-play and power management into the object, making it the default behavior of the object in one fell swoop.
4. The relationship between the operating system kernel and the driver has been changed. In the WDM driver, on the one hand, it has to deal with the hardware, and on the other hand, it has to deal with the interaction between the driver and the operating system kernel. Now WDF separates the driver from the operating system kernel. The interaction between the driver and the operating system is completed by methods (functions) encapsulated in the framework, so that driver developers only need to focus on processing the behavior of the hardware. This not only avoids the disadvantages of focusing on one thing at the expense of the other, but also due to the separation of the two parties, it is of great benefit to certain changes in the operating system and the development of supporting drivers for hardware manufacturers.
5. Both modes of drivers (KMDF, UMDF) are built using the same environment, which is called WDK.
That is, the development environment of KMDF and UMDF is WDK.
Windows Device Kit (WDK): By integrating test suites, the DDK becomes the WDK. WDK is a driver integrated development system for the Microsoft operating system series. It combines Windows DDK and Hardware Compatibility Test (HCT) kits (hardware compatibility test tools), and also provides Microsoft's internal test suite for testing the stability and reliability of Windows operating systems.
6. Although it is encapsulated and object-based technology is introduced, the execution efficiency of the developed driver is not inferior to the original one.
This article comes from the CSDN blog. Please indicate the source when reprinting: http://blog.csdn.net/ding_3/archive/2009/12/23/5060907.aspx
-