sirroom
驱动大牛
驱动大牛
  • 注册日期2001-07-30
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分6分
  • 威望11点
  • 贡献值1点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1186回复:0

driver project in vc setting.source debug.

楼主#
更多 发布于:2002-05-30 19:18
  
新闻群组    
 高级群组搜寻      
  
  
Groups search result 1 for softice driverentry debug problem

Search Result 1
寄件者:bro (neri@orgio.net)
主旨:[info for newer]Thanks to news guys! driver project in vc setting.source debug.
新闻群组:comp.os.ms-windows.programmer.nt.kernel-mode
View: (This is the only article in this thread) | Original Format
日期:2001-12-05 17:19:37 PST
 

i\'m Thanksful to all this news guys for solving my problem!
this time.
not question. just i hope little infomation for freshman in kernel
(like me :)

yes. all hint is in WDM book. ( it support WDM project wizard. but i
do not work on WDM but NT Lagacy. so i did modify some setting... )

but now i\'m just start with Empty Win32 Application Project. and
little modificated setting is work well for NTKernelmode programming
with VC++.

here is ..

1) Start Project with Empty Win32 Application
2) Open Project Setting Properties Sheet.
4) C++ Option Modification
   ( for Debugging with SoftICE. you can debug ( it tested by me )
   You can do it with replacing in setting edit control.
5) also, Link Option. ( output filename TestDev.sys so modify it , too
)
6) coding for ur driver.
7) if you do break point in your driver code, then code like below
   __try{ DbgBreakPoint(); } __except( EXCEPTION_EXECUTE_HANDLER ) {}
 
7) compile & link. check your driver.

8) execute SoftICE Symbol Loader , and Open debug/urdriver.sys and
   check \'pachage with source\' on tool bar button. and click translate
button
   on toolbar. then it makes \'NMS\' (Symbol file).
   and click Load button also on toolbar.

9) all is ok. then you can debug your driver code in single machine.
   execute your driver code with your application.
   then when driver code execute at breakpoint, then SoftICE pop up
for you.

10) F10 key down, and F3 (or \'SRC\' on console ) then driver code is
shown in
   code window of SoftICE. command \'g\' can execute while next
breakpoint.
   in softICE, you can set break point in code window with click.


just copy it and replace setting.
Debug Setting
---------------
  C++ Option :
    /nologo /Gz /MLd /W3 /Zi /Od /Gy /I \"$(DDKPATH)\\inc\" /I
\"$(DDKPATH)\\inc\\ddk\" /FI\"$(DDKPATH)\\inc\\warning.h\" /D \"WIN32\" /D
\"_DEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D _X86_=1 /D i386=1 /D \"STD_CALL\"
/D CONDITION_HANDLING=1 /D NT_UP=1 /D NT_INST=0 /D WIN32=100 /D
_NT1X_=100 /D WINNT=1 /D _WIN32_WINNT=0x0500 /D _WIN32_IE=0x0400 /D
WIN32_LEAN_AND_MEAN=1 /D DBG=1 /D DEVL=1 /D FPO=0 /D \"NDEBUG\" /D
_DLL=1 /D \"DRIVER\" /D \"_IDWBUILD\" /D \"RDRDBG\" /D \"SRVDBG\" /FR\"Debug/\"
/Fp\"Debug/FileSM.pch\" /YX /Fo\"Debug/\" /Fd\"Debug/\" /FD /Zel -cbstring
/QIfdiv- /QI0f /GF /QIf /c

  Project option :
    hal.lib ntoskrnl.lib libcmt.lib /nologo /base:\"0x10000\"
/version:4.0 /entry:\"DriverEntry@8\" /subsystem:windows
/incremental:yes /pdb:\"Debug/TestDev.pdb\" /debug /debugtype:both
/machine:I386 /nodefaultlib /out:\"debug\\TestDev.sys\"
/libpath:\"$(DDKPATH)\\libchk\\i386\" -MERGE:_PAGE=PAGE -MERGE:_TEXT=.text
-MERGE:.rdata=.text -SECTION:INIT,d -OPT:REF -FORCE:MULTIPLE -RELEASE
-FULLBUILD -IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096
-osversion:4.00 -optidata -driver -align:0x20 -subsystem:native,4.00
-debug:notmapped,FULL

Release Setting
----------------
  C++ Option :
    /nologo /Gz /ML /W3 /O1 /I \"$(DDKPATH)\\inc\" /I
\"$(DDKPATH)\\inc\\ddk\" /FI\"$(DDKPATH)\\inc\\warning.h\" /D \"WIN32\" /D
\"NDEBUG\" /D \"_WINDOWS\" /D \"_MBCS\" /D _X86_=1 /D i386=1 /D \"STD_CALL\"
/D CONDITION_HANDLING=1 /D NT_UP=1 /D NT_INST=0 /D WIN32=100 /D
_NT1X_=100 /D WINNT=1 /D _WIN32_WINNT=0x0500 /D _WIN32_IE=0x0400 /D
WIN32_LEAN_AND_MEAN=1 /D DBG=1 /D DEVL=1 /D FPO=0 /D _DLL=1 /D
\"DRIVER\" /D \"_IDWBUILD\" /FR\"Release/\" /Fp\"Release/FSMon.pch\" /YX
/Fo\"Release/\" /Fd\"Release/\" /FD /Zel -cbstring /QIfdiv- /QI0f /GF /Oxs
/c

  Project option :
    hal.lib ntoskrnl.lib /nologo /base:\"0x10000\" /version:4.0
/entry:\"DriverEntry@8\" /subsystem:windows /pdb:none /machine:I386
/nodefaultlib /out:\"release\\FSMon.sys\"
/libpath:\"$(DDKPATH)\\libfre\\i386\" -MERGE:_PAGE=PAGE -MERGE:_TEXT=.text
-MERGE:.rdata=.text -SECTION:INIT,d -OPT:REF -FORCE:MULTIPLE -RELEASE
-FULLBUILD -IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096
-osversion:4.00 -optidata -driver -align:0x20 -subsystem:native,4.00
-debug:notmapped,minimal


--------------------------------------------------------------------------------
  

?2002 Google

最新喜欢:

flyfoxflyfox
111
游客

返回顶部