Configure the compiling environment for vc7 to create a driver project

Source: Internet
Author: User

1. Create a Win32 Empty Project
2. Add the C driver code
3. Set the compiling environment (note that the following H and Lib paths are changed according to the actual situation)

Development Environment: XP + vc2003

Debug version

[C/C ++]
[General]
[Additional include directories] = s:/SDK/winddk/3790/INC/CRT; s:/SDK/winddk/3790/INC/wxp; s: /SDK/winddk/3790/INC/DDK/wxp; s:/SDK/winddk/3790/INC/ifs/wxp
[Debug information format] = program database (/Zi)
[Detect 64-bit portability issues] = No

[Optimization]
[Optimization] = custom
[Enable intrinsic functions] = Yes (/OI)

[Preprocessor]
[Preprocessor definitions] = winver = 0X501; debug; _ debug; Unicode; ndis50_miniport = 1; ndis50 = 1; _ x86 _; i386; std_call; condition_handling; prepare; nt_up; rdrdbg; srvdbg; dbg; _ idwbuild

[Code generation]
[Enable minimal rebuild] = No
[Enable C ++ exceptions] = No
[Basic runtime checks] = default
[Runtime Library] = single-threaded (/ml)
[Buffer security check] = No

[Advanced]
[Calling convention] = _ stdcall (/GZ)
[Compile as] = default

[Linker]
[General]
[Output file] = $ (outdir)/xxx. sys
[Enable incremental linking] = No (/Incremental: No)
[Additional library directories] = s:/SDK/winddk/3790/lib/wxp/i386

[Input]
[Additional dependencies] = ntoskrnl. Lib Hal. Lib WDM. Lib wdmsec. Lib
[Ignore all default libraries] = Yes (/nodefaultlib)

[Debugging]
[Generate map file] = Yes (/map)
[Map File Name] = $ (outdir)/xxx. Map

[System]
[Subsystem] = not set

[Advanced]
[Entry point] = DriverEntry @ 8
[Base address] = 0x10000

[Command line]
[Additional options] =/driver/subsystem: Native

 

Free Version

[C/C ++]
[General]
[Additional include directories] = s:/SDK/winddk/3790/INC/CRT; s:/SDK/winddk/3790/INC/wxp; s: /SDK/winddk/3790/INC/DDK/wxp; s:/SDK/winddk/3790/INC/ifs/wxp
[Debug information format] = program database (/Zi)
[Detect 64-bit portability issues] = No

[Optimization]
[Optimization] = minimize size (/O1)
[Global optimizations] = Yes (/og)
[Inline function expansion] = any suitable (/ob2)
[Enable intrinsic functions] = Yes (/OI)
[Favor size or speed] = favor small code (/OS)

[Preprocessor]
[Preprocessor definitions] = winver = 0X501; ndebug; Unicode; ndis50_miniport = 1; ndis50 = 1; _ x86 _; i386; std_call; condition_handling; handler; nt_up; _ idwbuild

[Code generation]
[Enable string pooling] = Yes (/GF)
[Enable minimal rebuild] = No
[Enable C ++ exceptions] = No
[Basic runtime checks] = default
[Runtime Library] = single-threaded (/ml)
[Buffer security check] = No
[Enable function-level linking] = Yes (/Gy)

[Advanced]
[Calling convention] = _ stdcall (/GZ)
[Compile as] = default

[Linker]
[General]
[Output file] = $ (outdir)/xxx. sys
[Enable incremental linking] = No (/Incremental: No)
[Suppress startup Banner] = Yes (/nologo)
[Additional library directories] = s:/SDK/winddk/3790/lib/wxp/i386

[Input]
[Additional dependencies] = ntoskrnl. Lib Hal. Lib WDM. Lib wdmsec. Lib
[Ignore all default libraries] = Yes (/nodefaultlib)

[Debugging]
[Generate debug info] = Yes (/debug)
[Generate map file] = Yes (/map)
[Map File Name] = $ (outdir)/xxx. Map

[System]
[Subsystem] = not set

[Optimization]
[References] = eliminate unreferenced data (/OPT: ref)
[Enable comdat folding] = Remove redundant comdats (/OPT: ICF)

[Advanced]
[Entry point] = DriverEntry @ 8
[Set checksum] = Yes (/release)
[Base address] = 0x10000

[Command line]
[Additional options] =/driver/subsystem: Native

 

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.