Configure the driver development environment for WINDOWS 7 (wdk7.60)

Source: Internet
Author: User
Configure the driver development environment for WINDOWS 7 (wdk7.60)

1. Install VS2010 and WDK7.60 (GRMWDK_EN_7600_1)

2. Create a VC console Project (select Empty Project)

3. Create a project and configure "driver". Click the drop-down button and click (Configuration Manager)

Enter the name (driver) and click "OK". Do not change anything else!

Effect after completion!

The image displayed after you click OK.

Right-click the newly created driver attribute. The following window is displayed!

 
4. Set the VC ++ path

<I want to install wdk on an edisk>
A. Configure the executable file directory: E: \ WinDDK \ 7600.16385.1 \ bin \ x86;
B. The configuration directory contains: E: \ WinDDK \ 7600.16385.1 \ inc \ ddk.
E: \ WinDDK \ 7600.16385.1 \ inc \ crt
E: \ WinDDK \ 7600.16385.1 \ inc \ api
C. Configuration library Directory: E: \ WinDDK \ 7600.16385.1 \ lib \ win7 \ i3865

 

Create a new C/C ++ file. Otherwise, no C/C ++ setting options are available.

<At the beginning, we created an empty project, so there is no c ++ file in the project. Now we need to add a new c ++ file in the empty project-Source File>

General
Target File Extension:. sys // required

6. set C/C ++ options
General Tab
1. debug information format (C7 compatible (/Z7) // optional
2 warning level (level 2 (/W2) // optional
3. view the warning as an error (Yes (/wx) // optional

Optimization Tab
Optimized (disabled/Od) // optional

Pre-processor
Pre-processor definition: WIN32 = 100; _ X86 _ = 1; WINVER = 0x501; DBG = 1 // required

Code Generation
Enable minimum regenerate: No // optional

Basic runtime check: Default Value // optional
Runtime Library: multi-thread debugging (/MTd) or multi-thread (/MT) // recommended <I chose multi-thread debugging (/MTd)>
Buffer security check: No // optional
(LINK: error LNK2001: the external symbol _ security_cookie cannot be parsed)
Advanced
Call Convention _ stdcall (/Gz) // required

7. linker settings
General
Enable INCREMENTAL link: NO (/INCREMENTAL: NO) // It is recommended that you select
Ignore import/export: Yes // optional
(When this value is set, you must add E: \ WinDDK \ 7600.16385.1 \ lib \ win7 \ i3865 to the directory of the additional library so that the project will not depend on the setting of the IDE environment)

If no (when this value is set, it depends on the relevant settings of the IDE environment)

Input
Additional Dependencies
Ntoskrnl. lib; Hal. lib; wdm. lib; wdmsec. lib; wmilib. lib; ndis. lib; MSVCRT. LIB; LIBCMT. LIB // required

// Ntoskrnl. lib WDM driver ntoskrnl. lib
(HalXXX function in Hal. lib, WmiXXX function in wmilib. lib, NdisXXX function in ndis. lib)
(If necessary, add Microsoft's standard library MSVCRT. lib msvcrtd. LIB (debugging Library) LIBCMT. LIBIBCMTD. LIB (debugging Library ))
(If the source file exists in the source code, the TARGETLIBS field of the file lists the required libraries for this project)

Ignore all default libraries: Yes (/nodefalib Lib) // required

Configuration file:
Enable User Account Control (UAC) No // required

Otherwise,> link: Fatal error lnk1295: "/manifestuac" is incompatible with the "/driver" Specification. "/manifestuac" is not used for link"

Debugging:
The generated debugging information is (/debug) // optional
Generate an image file: Yes (/MAP) // optional
Image File Name: $ (targetdir) $ (targetname). Map // optional

System)
Subsystem: Console (/subsystem: Console) // required
Stack retention size: 4194304 // optional
Stack submission size: 4096 // optional
DRIVER: DRIVER (/DRIVER) // required
Advanced:
Entry Point: DriverEntry // required
Random base address: Clear // Delete the data in the box. (Yes is neither no nor a clean text box) // required
Otherwise E: \ XXX. SYS: Fatal error lnk1295:
"/Dynamicbase" is not compatible with "/driver" specifications; "/dynamicbase" is not used for links"

Data Execution Protection (DEP): Clear // Delete the data in the box. (Yes is neither no nor a clean text box) // required
Otherwise E: \ XXX. SYS: Fatal error lnk1295:
"/Nxcompat: No" is incompatible with the "/driver" Specification; "/nxcompat: no" is not used for linking"

 

Set Effect and: Yes (/release) // optional

Base Address: 0x10000 // recommended

Command Line:/section: init, D/ignore: 4078 (it is recommended that you do not enter it. An error will be reported !)

Finally, a super simple code is provided to test whether the configuration is successful ??

# Include "ntddk. H"

Ntstatus
DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
Return STATUS_UNSUCCESSFUL;
}

 

If no error is reported, congratulations!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.