For detailed configuration methods, see my other article Article
Http://www.ecjtu.org/forum/read.php? Tid-21660.html
Title: Build a vista driver development environment using vs2008 pro, wdk, and ddkwizard
Author: eping
Email: eping@msn.cn
Time: 2009.12.2
Statement: some pictures of a book are still in the previous article, and the main changes are text. I will mark the modified text in red
1. Install vs2008 (Chinese Version)
Ii. Installation Visual assist (this is not necessary), but it is a rare tool during development.
3. Install wdk
For details about how to download and install wdk, see Official Link Http://download.microsoft.com/download/A/A/7/AA7A3E5E-2279-4431-B363-7EC0E3113F90/GRMWDK_EN_7600.ISO 4. Install ddkwizard The latest official version supports Windows 7
:Http://ddkwizard.assarbad.net/
The files to be downloaded include
1, Ddkwizard_setup.exe
2, Ddkbuild_bat.zip
3,Ddkbuild_mirror.zip
Install the first file Program Similarly, you only need to follow the default settings.
2 and 3 files only need to be decompressed and copied to all the root directories of our wdk.
My current directory is E: \ winddk \ 7600.16385.0
Next, we need to set the environment variable.
There are two places to set Point 2: Change the system environment variable wlhbase Variable name: w7base Variable value: e: \ winddk \ 7600.16385.0
1. Path
Add D: \ winddk to the path variable.
Otherwise, the command cannot be found during compilation.
2. Create System Variables
Variable name: wlhbase
Variable value: D: \ winddk \ 6001.18002 modify the wdk path installed for you
For example
V. Open vs2008This is the same as that in the Vista environment.
Tools --> options --> VC ++ directories in projects and solutions options
Add the root directory of wdk
All settings have been completed.
6. Write simple drivers and test our driver development environment
1. Create a project
Select empty driver in the DDK Project
Next, a dialog box of the ddkwizard Wizard will be displayed.
This is a little different from the previous version .. Select the W7 environment.
Here we can keep the default settings. I only select longhornvista wdk.
After finishing, you can start writing our driver.
For demonstration, we will not print anything but output "helloeping"
Simple driverCodeAs follows:
Note: Save it as *. C. Here I save it as test. C.
- # Include <ntddk. h>
- Void driverunload (pdriver_object driver)
- {
- Dbuplint ("helloeping \ r \ n ");
- }
- Ntstatus DriverEntry (pdriver_object driver, punicode_string reg_path)
- {
- Dbuplint ("Hello, eping! ");
- Driver-> driverunload = driverunload;
- Return STATUS_SUCCESS;
- }
|
Note: targettype = the default generated code in the sources File
You need to change to targettype = driver sources = It is empty by default. I will change it to sources = test. C to compile it successfully. Otherwise, you will find that the driver file cannot be found after the compilation is successful.
Illustration:
Driver file testdriver. sys generated on D: \ Users \ eping \ Desktop \ testdriver \ objchk_wlh_x86 \ i386
The above test is valid! Note: If you want to run the above Code on Windows 7, see