Using 2003SP1 DDK for Windows 2000 drivers

Discussion in 'Windows Vista Drivers' started by Nathan G, Oct 20, 2005.

  1. Nathan G

    Nathan G Guest

    Hello,

    I have a driver which compiled just fine under an old Windows 2000 DDK.

    I wanted to compile it using the 2003SP1 DDK, which I believe is the latest.

    I run "setenv mydir fre W2K". When I attempt to compile, I get the following
    errors.

    e:\ddk2003sp1\inc\w2k\winbase.h(280) : error C2061: syntax error :
    identifier 'CRITICAL_SECTION'
    e:\ddk2003sp1\inc\w2k\winbase.h(280) : error C2059: syntax error : ';'
    e:\ddk2003sp1\inc\w2k\winbase.h(281) : error C2061: syntax error :
    identifier 'PCRITICAL_SECTION'
    e:\ddk2003sp1\inc\w2k\winbase.h(281) : error C2059: syntax error : ';'
    e:\ddk2003sp1\inc\w2k\winbase.h(282) : error C2061: syntax error :
    identifier 'LPCRITICAL_SECTION'
    e:\ddk2003sp1\inc\w2k\winbase.h(282) : error C2059: syntax error : ';'
    e:\ddk2003sp1\inc\w2k\winbase.h(284) : error C2061: syntax error :
    identifier 'CRITICAL_SECTION_DEBUG'
    e:\ddk2003sp1\inc\w2k\winbase.h(284) : error C2059: syntax error : ';'
    e:\ddk2003sp1\inc\w2k\winbase.h(285) : error C2061: syntax error :
    identifier 'PCRITICAL_SECTION_DEBUG'
    e:\ddk2003sp1\inc\w2k\winbase.h(285) : error C2059: syntax error : ';'
    e:\ddk2003sp1\inc\w2k\winbase.h(286) : error C2061: syntax error :
    identifier 'LPCRITICAL_SECTION_DEBUG'
    e:\ddk2003sp1\inc\w2k\winbase.h(286) : error C2059: syntax error : ';'
    e:\ddk2003sp1\inc\w2k\winbase.h(289) : error C2061: syntax error :
    identifier 'LPLDT_ENTRY'
    e:\ddk2003sp1\inc\w2k\winbase.h(289) : error C2059: syntax error : ';'
    e:\ddk2003sp1\inc\w2k\winbase.h(1135) : error C2373: 'InterlockedIncrement'
    : redefinition; different type modifiers
    e:\ddk2003sp1\inc\ddk\w2k\ntddk.h(5230) : see declaration of
    'InterlockedIncrement'
    e:\ddk2003sp1\inc\w2k\winbase.h(1142) : error C2373: 'InterlockedDecrement'
    : redefinition; different type modifiers
    e:\ddk2003sp1\inc\ddk\w2k\ntddk.h(5237) : see declaration of
    'InterlockedDecrement'
    .... etc ....

    The only system header file I include is <ntddk.h>. The compile command line
    is as follows.

    cl -nologo -Ii386\ -I. -Ie:\ddk2003sp1\inc\mfc42 -I.. -I..\..\..\kernel
    -I..\..\..\inc -I..\..\common -Iobjfre_w2K_x86\i386 -Ie:\ddk2003sp1\inc\w2K
    -Ie:\ddk2003sp1\inc\w2K -Ie:\ddk2003sp1\inc\ddk\w2K
    -Ie:\ddk2003sp1\inc\ddk\wdm\w2K -Ie:\ddk2003sp1\inc\crt -D_X86_=1 -Di386=1
    -DSTD_CALL -DCONDITION_HANDLING=1 -DNT_INST=0 -DWIN32=100 -D_NT1X_=100
    -DWINNT=1 -D_WIN32_WINNT=0x0500 /DWINVER=0x0500 -D_WIN32_IE=0x0501
    -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -D__BUILDMACHINE__=WinDDK -DFPO=0 -DNDEBUG
    -D_DLL=1 /c /Zl /Zp8 /Gy /Gm- -cbstring /W3 /WX /Gz /GX- /GR- /GF /GS
    /G6 /Ze /Gi- /QIfdiv- /hotpatch -Z7 /Oxs /Oy-
    -FIe:\ddk2003sp1\inc\w2K\warning.h .\mysrc.c

    Any obvious reason why I should get all these errors?

    Thanks,
    Nathan
     
    Nathan G, Oct 20, 2005
    #1
    1. Advertisements

  2. Nathan G

    fat_boy Guest

    I found stuff like IoReuseIrp() missing form the 2k headers with this
    DDK. In this instance, because it is a valid function in 2k, I had to
    define it myself, based on the wxp definition.

    Just search the headers for these defines, and work out either from
    #defines or from which directory they are in, what you have to do to
    get it in your code. Either define it yourself, or put in a /D xxx to
    get that section of header in.
     
    fat_boy, Oct 21, 2005
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.