How to compile drivers with VC7 + XPDDK

xiaoxiao2021-03-06  129

1. Add the required file (.h .c .cpp .asm .rc ..) to the solution 2. Right-click on the project in the solution, call up the properties box, select the configuration type in the regular configuration File "3. (only given only the debug version method, Release version is modified) Select NMKE, fill in MD Debug 2> Nul: cd debugnmake -nologo ../makefile debug = 1 in" Production Command Line " Production command line "Fill in RD / S / Q Debug 2> NUL: MD Debug 2> Nul: CD Debugnmake -nologo ../makefile debug = 1 Fill in RD / S / Q Debug 2> NUL in" Clear Command Line " : In the "Input" fill in the debug / your driver name .sys4. Write the Makefile file (for specific makefile syntax, please check it yourself) Here, Check and Free versions are separated by variables DDK = D: /Windk/2600.1106os = wxpbasename = ZZZ

CC = CLASM = MLALL: $ (BaseName) .sys! IfNDef Release

# Debug DEFINES_D = -D_X86_ = 1 -Di386 = 1 -DSTD_CALL -DCONDITION_HANDLING = 1 / -DNT_UP = 1 -DNT_INST = 0 -DWIN32 = 100 -D_NT1X_ = 100 / -DWINNT = 1 -D_WIN32_WINNT = 0x0400 -DWIN32_LEAN_AND_MEAN = 1 -DDBG = 1 -D_DEBUG -DDEBUG -DDEVL = 1 / -DFPO = 0 -D_DLL = 1 -D_IDWBUILD -DRDRDBG -DSRVDBG -DDBG_MESSAGES = 1 / -D_UNICODE -DLITTLE_ENDIANCFLAGS_D = $ (DEFINES_D) -Zel -Zp8 -Gy -cbstring -Gz - Qifdiv--qif -gi---gm- -gx- / -gr---gf -fi $ (ddk) / inc / $ (os) / warning.h -zi-od -oi -oy--w3 lflags_d = - Merge: _Text = Page -Merge: init, d / -incremental: yes -force: multiple -debug -pdb: $ (basename) .pdb -fulbuild / -ignore: 4001, 4037, 4039, 4065, 4070, 4078, 4087, 4089, 4096 -NodeFaultlib / -debug -version: 4.00 -OSversion: 4.00 -debugtype: cv /-merge:.rdata=.text -map: $ (breakname) .map -driver -align : 0x20 /-subsystem:native, 4.00 -Base: 0x10000 -ENTRY: DRIVERENTRY @ 8! ELSE

# Release ...! Endifcryptoobj = xx.objlink_d = link $ (lflags_d) -nologo -out: $ (breakname) .sys -machine: ix86 / $ (ddk) / lib / $ (os) /i386/ntoskrnl.lib / $ (DDK) / LIB / $ (OS) /i386/hal.lib

Cflags = $ (cflags_d) -nologo -dnt4_driver -i $ (ddk) / inc / $ (os) -i $ (DDK) / INC / DDK / $ (OS) -i $ (DDK) / INC / DDK / WDM / (Os) }.c }.obj: $ (cc) -c $ (cflags) -i ../../ YYY -I ../../xxx $

{../../xx }.c }.Obj: $ (cc) -c $ (cflags) -i ../../ YYY -I ../../xxx $

{../../xx }.c }.Obj: $ (cc) -c $ (cflags) -i ../../ YYY -I ../../xxx $

{../../yy }.asm }.obj: $ (asm) $ (asmflags) $ <{..}. rc {}. Res: rc -r -d_x86_ -fo driver.res $! IFNDEF RELESMFLAGS = / coff / zm / c / cp / zi / d_debug! Elseasmflags = / coff / zm / c / cp / dndebug! ENDIF ...

转载请注明原文地址:https://www.9cbs.com/read-101673.html

New Post(0)