存档

文章标签 ‘romfs’
3,463 views

在 VS 2008 内开发驱动程序的 “解决方案” 的编译链接选项的设置

2008年7月9日
    • General
      Additional Include Directories:
      C:\WINDDK\2600\inc\wxp
      C:\WINDDK\2600\inc\ddk\wxp
      C:\WINDDK\2600\inc\ddk\wdm\wxp
      C:\WINDDK\2600\inc\crt
      Debug Information Format : Program Database (/Zi)
    • Optimization
      Enable Intrinsic Functions: Yes (/Oi) … To avoid the memcmp compile error.
    • Preprocessor
      Preprocessor Definitions:
      _X86_=1
      i386=1
      _WIN32_WINNT=0×0501
      WINVER=0×0501
      WIN32_LEAN_AND_MEAN=1 … dont know if this does much for a device driver
      Ignore Standard Include Path:Yes (/X)
    • Code Generation
      Enable C++ Exceptions:No … no exception handling in the kernel!
      Buffer Security Check:No (/GS-) … linker error if set to Yes
      Basic runtime Checks: Default
    • Advanced
      Calling Convention:__stdcall (/Gz)
    • Language
      Enable Run-Time Type Info:No (/GR-) … linker error if set to Yes
    • Input
      Additional Dependencies:int64.lib ntoskrnl.lib hal.lib … etc.
      Ignore All Default Libraries:Yes (/NODEFAULTLIB)
    • Manifest File
      Generate Manifest:No
    • System
      SubSystem:Native (/SUBSYSTEM:NATIVE)
      Driver:Driver (/DRIVER)
    • Advanced
      Base address:0×10000
      Entry Point:DriverEntry
      Target Machine:MachineX86 (/MACHINE:X86)
      Randomized Base Address:Default
      Data Execution Prevention (DEP) : default
    • General
      Additional Library Directories:C:\WINDDK\2600\lib\wxp\i386
      Enable Incremental linking: No (/INCREMENTAL:NO)
      Output file: $(OutDir)\$(ProjectName).sys
    • Command line
      add there /safeseh:no option
  1. I’ll give you what I found, but all I can say is don’t do it.

    There are always problems linking one version of the CRT against a version of a compiler that it wasn’t written for.

    Create a win32 DLL project.

    C/C++ settings for VC2008

    阅读全文…

内核编程, 技术心得 , , , , ,