Vs2008+windows DDK 7 Environment configuration

Source: Internet
Author: User

?

Mark offers some third party utilities. That's good, but I'll show a more handy-IMHO: How to configure and use Visual Studio for compiling drivers.?

Has fun

  1. Setup Visual Studio 2008.
  2. Setup DDK (WDK).
  3. Add to VS paths DDK include files, libs and bins.
  4. Create New Empty "Win32 project" and add source file (i.e.? HELLOWORLD.C).
  5. Configure Project Properties (all configurations):
    1. c\c++-general-debug Information Format = Program Database (/zi)
    2. c\c++-Preprocessor-preprocessor definitions = _x86_ [Add also DBG for Debug Config]
    3. C\c++-Code generation-enable C + + Exceptions = No
    4. C\c++-Code generation-basic Runtime Checks = Default
    5. C\c++-Code generation-buffer Security Check = No? (/GS-)
    6. c\c++-Advanced-calling convention = __stdcall (/gz)
    7. C\c++-Advanced-compile as = Compile as C Code (/TC) [If you is going to use plain c]
    8. Linker-general-output File =? $ (OutDir) \$ (ProjectName). SYS
    9. Linker-general-enable Incremental linking = Default
    10. Linker-input-additional Dependencies =? ntoskrnl.lib Hal.lib $ (NOINHERIT)? [Add needed libs here e.g.? ntoskrnl.lib Hal.lib]
    11. Linker-input-ignore all Default Libraries = Yes (/nodefaultlib)
    12. Linker-manifest file-generate Manifest = No
    13. Linker-system-subsystem = Native (/subsystem:native)
    14. Linker-system-driver = Driver (/driver)
    15. Linker-advanced-entry point = DriverEntry
    16. Linker-advanced-base Address = 0x10000
    17. linker-advanced-randomized Base Address = Disable (/dynamicbase:no)

      (should be the default value)

    18. Linker-advanced-data Execution Prevention? (DEP) = Disable (/nxcompat:no)

    (should be the default value)

    ?

  6. OK. Done. Now your can test it with simple code, e.g.:

    Hide??? Copy Code

    #include"Ntddk.h"

    ?

    NTSTATUS

    DriverEntry (Pdriver_object driverobject,punicode_string

    Registrypath)

    {

    return status_unsuccessful;

    }

Vs2008+windows DDK 7 Environment configuration

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.