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