Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

A DDK's project wizard for VC2003

0.00/5 (No votes)
14 Nov 2003 1  
A DDK's project wizard for VC2003.

Introduction

I used command line to compile DDK driver, but never got used to it. So I thought, why not write a wizard to do that.

So I did, and can compiled DDK's example and even WinpCap's NDIS driver.

Background

I stole some QuickSYS' files, and I appreciate the author very much.

Using the code

First, you may have to install DDK. This Wizard depends on the environment variable "ddkroot". If you want to build NDIS driver, please add NDIS.lib to your project.

For common use, just create a new project, choose the "DDK wizard", and press button "Finish", and then everything is OK.

If you want to compile the DDK's examples, you may refer to one file named "sources" in the example directory. Some macros are defined in that file.

For example. you may want to compile DDK's Passthru sample:

  1. Create a new project using this wizard, and delete the c and h file which is created by wizard, because we don't need them now.
  2. Copy the files(*.c, *.h, *.rc) from ntddk\src\network\ndis\passthru to the project directory.
  3. Add these files to the project.
  4. File "sources" are like the following:
    //...
    
    TARGETNAME=PASSTHRU
    TARGETPATH=obj 
    TARGETTYPE=DRIVER 
    TARGETLIBS=$(DDK_LIB_PATH)\ndis.lib 
    C_DEFINES=$(C_DEFINES) -DNDIS40 -DNDIS_MINIPORT_DRIVER -DNDIS40_MINIPORT 
    INCLUDES=..\..\inc 
    SOURCES= passthru.c \ protocol.c \ miniport.c \ passthru.rc 
    //...

So now you know what to do next?

Add NDIS.LIB to your project, add NDIS40, NDIS_MINIPORT_DRIVER, NDIS40_MINIPORT to pre-compile macros. And then build debug and release, you will get success except some warnings.

Points of Interest

This is my first DDK wizard, and DDK is hard for me to master. So this wizard can't be very good. I tested it all in WIN2K DDK. If I have enough time, I will write a NDIS project wizard. May support NIC, IM, TDI or so.

Finally, sorry for my poor English.

History

11-07-2003 - the wizard script can run now.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here