Learning and writing WDM drivers, who is a challenging thing, requires perseverance and perseverance. When you get started, you will find that this is an exciting thing. But how do I use WDM's compilation environment to start WDM learning? This threshold can be not low for an initiator. After installing DDK, you can start the compiler with [start] -> [development kit] -> [windows xx ddk] -> [check / free build environment], because DDK does not use the IDE environment (of course you can use configuration) The following VC or DriverStudio this other is another matter), which is undoubtedly a difficult thing for our programmers who have gestated in the XP era. Why? Because compiling a WDM program except for .cpp .h source files, it is also necessary:
Makefile file
Sources file
These two files should be automatically generated by IDE, such as VC generates Makefile, Sources, XX.rc files for all of our projects, usually we don't need to understand our project without understanding them. DDK does not have the tool to generate these two files, but when the DDK compiler, it needs them. As the saying goes, "I am not as good as hell to enter the hell", we will write these two files:
One .makefile (no extension, its name is called makefile), the content is as follows:
# Do not edit ./sources. If you want to add a new source # file to this component. This file merely indirects to the real make file # That Shared by all the components of nt. #! INCLUDE $ (NTMAKEENV) /MAKEFILE.DEF
It is worthy of being, all Makefiles used by the WDM program are written like this. We only need to write one, copy it to the working directory, and you need to modify it according to different occasions, but the basic template is as follows. :
TargetName = Driver Name // Tell the compiler connection The generated file name is "Driver Name" (without extension) TargetPath = Obj // Fixed TargetType = driver // fixed constant (indicate, connection to *. SYS
Where "$ (basedir)" refers to the current installation directory of the DDK, for example, the current DDK is installed in D: on, $ (basedir) is "d: / ddk", so the above include it can be translated into D: / DDK / INC / DDK; D: / DDK / INC INC INC. Have to pay attention to 3 annoying issues: 1. Makefile, Sources and source must guarantee the Makefile, Sources and source program 2. When writing the Sources file, the "=" cannot have Space 3. If the above problem is not annoying, then the question can be annoying to abandon the learning DDK, the absolute path of the work catalog of the project, such as "c: / documents and settings / myprogramme /" will not Compiled by the DDK compiler, and the surface seems to be DDK seems to be completed. It doesn't do anything! (Let me fainting for an afternoon ~) can say this article has no professional gold, but maybe the above "Small Questions", a text of the initiator, hindering more people to enter a certain field. The author has been made to give up by the above questions, and I have been taking a lot of people who have known as "master" when I ask. This may be a phenomenon in China. Although I don't know if it is in foreign countries: "outside the city People want to go in, people in the city are afraid that too many people go in and make the city crowded. "Author Blog:
http://blog.9cbs.net/yorksenplus/