Hello,

I'm continuing work on a user-mode project that uses the Windows DDK, which
was originally written using the Windows IFS Kit version 3790.1414 on another
PC.

To get the project to build, the following include directories were listed
up in Microsoft Visual Studio .NET (Tools | Options... | Projects | VC++
Directories):
C:\WINDDK\3790.1414\inc
C:\WINDDK\3790.1414\inc\wxp
C:\WINDDK\3790.1414\inc\ifs\wxp
C:\WINDDK\3790.1414\inc\ddk\wxp
C:\WINDDK\3790.1414\inc\crt

I have just installed a later version of the IFS Kit / DDK, now known as
"Microsoft® Windows® Driver Kit (WDK)". The DDK directory structure is
installed on my PC under:
C:\WINDDK\5112

The include directories present in this later DDK do not match exactly those
in the earlier one - by looking at the contents of the directories in the
3790.1414 and comparing them with those in the newer one, I've set up the
following include directories:
C:\WINDDK\5112\inc
C:\WINDDK\5112\inc\api
C:\WINDDK\5112\inc\ddk
C:\WINDDK\5112\inc\crt

However, when I build the entire solution in Visual Studio now, I get the
following build error for several of the projects:

C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
unmatched parenthesis : missing ')'

The line this refers to is:
#if FLT_MGR_BASELINE

If I right-click on this symbol and "Go to definition", it shows the
definition in fltUser.h:

#define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
SPVER(NTDDI_VERSION) >= 5) || \
(OSVER(NTDDI_VERSION) ==
NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
(OSVER(NTDDI_VERSION) ==
NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
(OSVER(NTDDI_VERSION) >=
NTDDI_WINLH)

Clearly, there are no unmatched parentheses! (?)

So I'm confused about why I get this build error.

Does anyone have any idea why this error occurs, and what I can do to
resolve it?

Many thanks in advance for any advice or comments,

JP

Re: Build problem with Windows Development Kit (WDK) by Pavel

Pavel
Wed Aug 10 14:57:08 CDT 2005

Enable listing of C preprocessor and you will easily see where is the error.
--PA

"J Prendergast" <j.prendergast@nospam.nospam> wrote in message news:92B45996-A2F3-4F8C-936C-7A4FBBE26487@microsoft.com...
> Hello,
>
> I'm continuing work on a user-mode project that uses the Windows DDK, which
> was originally written using the Windows IFS Kit version 3790.1414 on another
> PC.
>
> To get the project to build, the following include directories were listed
> up in Microsoft Visual Studio .NET (Tools | Options... | Projects | VC++
> Directories):
> C:\WINDDK\3790.1414\inc
> C:\WINDDK\3790.1414\inc\wxp
> C:\WINDDK\3790.1414\inc\ifs\wxp
> C:\WINDDK\3790.1414\inc\ddk\wxp
> C:\WINDDK\3790.1414\inc\crt
>
> I have just installed a later version of the IFS Kit / DDK, now known as
> "MicrosoftR WindowsR Driver Kit (WDK)". The DDK directory structure is
> installed on my PC under:
> C:\WINDDK\5112
>
> The include directories present in this later DDK do not match exactly those
> in the earlier one - by looking at the contents of the directories in the
> 3790.1414 and comparing them with those in the newer one, I've set up the
> following include directories:
> C:\WINDDK\5112\inc
> C:\WINDDK\5112\inc\api
> C:\WINDDK\5112\inc\ddk
> C:\WINDDK\5112\inc\crt
>
> However, when I build the entire solution in Visual Studio now, I get the
> following build error for several of the projects:
>
> C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
> unmatched parenthesis : missing ')'
>
> The line this refers to is:
> #if FLT_MGR_BASELINE
>
> If I right-click on this symbol and "Go to definition", it shows the
> definition in fltUser.h:
>
> #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
> SPVER(NTDDI_VERSION) >= 5) || \
> (OSVER(NTDDI_VERSION) ==
> NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
> (OSVER(NTDDI_VERSION) ==
> NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
> (OSVER(NTDDI_VERSION) >=
> NTDDI_WINLH)
>
> Clearly, there are no unmatched parentheses! (?)
>
> So I'm confused about why I get this build error.
>
> Does anyone have any idea why this error occurs, and what I can do to
> resolve it?
>
> Many thanks in advance for any advice or comments,
>
> JP



Re: Build problem with Windows Development Kit (WDK) by Stephan

Stephan
Thu Aug 11 03:32:11 CDT 2005

Take a look at DDKBUILD by MVP Bill McKenzie (it's free):

"DDKBUILD - Integrating the Windows DDK with Visual Studio .Net"
http://www.hollistech.com/
-> "Resources"
-> "DDKBUILD"

Stephan


Re: Build problem with Windows Development Kit (WDK) by Maxim

Maxim
Thu Aug 11 04:05:59 CDT 2005

By Mark Roddy I think?

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Stephan Wolf [MVP]" <stewo68@hotmail.com> wrote in message
news:1123749131.362085.222260@g49g2000cwa.googlegroups.com...
> Take a look at DDKBUILD by MVP Bill McKenzie (it's free):
>
> "DDKBUILD - Integrating the Windows DDK with Visual Studio .Net"
> http://www.hollistech.com/
> -> "Resources"
> -> "DDKBUILD"
>
> Stephan
>



Re: Build problem with Windows Development Kit (WDK) by j

j
Thu Aug 11 10:16:05 CDT 2005

Hi, thanks for your response.

My interpretation of this (as Iâ??ve not heard of this option before) was to
set the project setting:

C/C++ -> Preprocessor -> Generate Processed File

From value: No
To value: With Line Numbers (/P)

When I built the project, as well as the usual files, it produces lots of .i
(Preprocessed C/C++ Source) files in the project source files directory.

I looked at the relevant .i file, looking for the problematic code â?? but
couldnâ??t find it â?? maybe because it was in a #if decision, it wouldnâ??t be
included (as opposed to any #defineâ??d macros, which Iâ??m guessing would be?)

To be more explicit, here's how I tried to look for it...

I get the build error:
C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
unmatched parenthesis : missing ')'
first of all when the project is building the RulesInfo.cpp sourcefile

I used the project setting C/C++ -> Advanced -> Show Includes (switched it
from No to Yes) so that when compiling this file, I get a list of the files
that are included. The last 3 that are included are:
Note: including file: C:\WINDDK\5112\inc\ddk\fltuser.h
Note: including file: C:\WINDDK\5112\inc\ddk\fltUserStructures.h
Note: including file: C:\WINDDK\5112\inc\ddk\fltWinError.h

As described earlier, the troublesome #define is contained in fltuser.h
#define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
SPVER(NTDDI_VERSION) >= 5) || \
(OSVER(NTDDI_VERSION) ==
NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
(OSVER(NTDDI_VERSION) ==
NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
(OSVER(NTDDI_VERSION) >=
NTDDI_WINLH)

When it's used in the line "#if FLT_MGR_BASELINE" in fltUserStructures.h,
the error occurs.

I tried looking for some of the "real code" from the #define's definition -
e.g. ">= 5", ">=2" in the RulesInfo.i file generated for RulesInfo.cpp and
didn't find either of them.

Am I using the correct approach following on from your suggestion? Also, is
the "Generate Processed File" option that I've switched on the one you were
referring to?

Thanks again

JP



"Pavel A." wrote:

> Enable listing of C preprocessor and you will easily see where is the error.
> --PA
>
> "J Prendergast" <j.prendergast@nospam.nospam> wrote in message news:92B45996-A2F3-4F8C-936C-7A4FBBE26487@microsoft.com...
> > Hello,
> >
> > I'm continuing work on a user-mode project that uses the Windows DDK, which
> > was originally written using the Windows IFS Kit version 3790.1414 on another
> > PC.
> >
> > To get the project to build, the following include directories were listed
> > up in Microsoft Visual Studio .NET (Tools | Options... | Projects | VC++
> > Directories):
> > C:\WINDDK\3790.1414\inc
> > C:\WINDDK\3790.1414\inc\wxp
> > C:\WINDDK\3790.1414\inc\ifs\wxp
> > C:\WINDDK\3790.1414\inc\ddk\wxp
> > C:\WINDDK\3790.1414\inc\crt
> >
> > I have just installed a later version of the IFS Kit / DDK, now known as
> > "MicrosoftR WindowsR Driver Kit (WDK)". The DDK directory structure is
> > installed on my PC under:
> > C:\WINDDK\5112
> >
> > The include directories present in this later DDK do not match exactly those
> > in the earlier one - by looking at the contents of the directories in the
> > 3790.1414 and comparing them with those in the newer one, I've set up the
> > following include directories:
> > C:\WINDDK\5112\inc
> > C:\WINDDK\5112\inc\api
> > C:\WINDDK\5112\inc\ddk
> > C:\WINDDK\5112\inc\crt
> >
> > However, when I build the entire solution in Visual Studio now, I get the
> > following build error for several of the projects:
> >
> > C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
> > unmatched parenthesis : missing ')'
> >
> > The line this refers to is:
> > #if FLT_MGR_BASELINE
> >
> > If I right-click on this symbol and "Go to definition", it shows the
> > definition in fltUser.h:
> >
> > #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
> > SPVER(NTDDI_VERSION) >= 5) || \
> > (OSVER(NTDDI_VERSION) ==
> > NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
> > (OSVER(NTDDI_VERSION) ==
> > NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
> > (OSVER(NTDDI_VERSION) >=
> > NTDDI_WINLH)
> >
> > Clearly, there are no unmatched parentheses! (?)
> >
> > So I'm confused about why I get this build error.
> >
> > Does anyone have any idea why this error occurs, and what I can do to
> > resolve it?
> >
> > Many thanks in advance for any advice or comments,
> >
> > JP
>
>
>

Re: Build problem with Windows Development Kit (WDK) by pavel_a

pavel_a
Thu Aug 11 12:58:14 CDT 2005

Oops, this was pretty idiotic on my part :(
Preprocessor listing (the .i file) of course won't contain any
preprocessor instructions.

Maybe you can insert before of instead of this #if some C code,
for example C function that contains this expression, to see how it expands.

Regards,
--PA

"J Prendergast" wrote:
> Hi, thanks for your response.
>
> My interpretation of this (as Iâ??ve not heard of this option before) was to
> set the project setting:
>
> C/C++ -> Preprocessor -> Generate Processed File
>
> From value: No
> To value: With Line Numbers (/P)
>
> When I built the project, as well as the usual files, it produces lots of .i
> (Preprocessed C/C++ Source) files in the project source files directory.
>
> I looked at the relevant .i file, looking for the problematic code â?? but
> couldnâ??t find it â?? maybe because it was in a #if decision, it wouldnâ??t be
> included (as opposed to any #defineâ??d macros, which Iâ??m guessing would be?)
>
> To be more explicit, here's how I tried to look for it...
>
> I get the build error:
> C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
> unmatched parenthesis : missing ')'
> first of all when the project is building the RulesInfo.cpp sourcefile
>
> I used the project setting C/C++ -> Advanced -> Show Includes (switched it
> from No to Yes) so that when compiling this file, I get a list of the files
> that are included. The last 3 that are included are:
> Note: including file: C:\WINDDK\5112\inc\ddk\fltuser.h
> Note: including file: C:\WINDDK\5112\inc\ddk\fltUserStructures.h
> Note: including file: C:\WINDDK\5112\inc\ddk\fltWinError.h
>
> As described earlier, the troublesome #define is contained in fltuser.h
> #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
> SPVER(NTDDI_VERSION) >= 5) || \
> (OSVER(NTDDI_VERSION) ==
> NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
> (OSVER(NTDDI_VERSION) ==
> NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
> (OSVER(NTDDI_VERSION) >=
> NTDDI_WINLH)
>
> When it's used in the line "#if FLT_MGR_BASELINE" in fltUserStructures.h,
> the error occurs.
>
> I tried looking for some of the "real code" from the #define's definition -
> e.g. ">= 5", ">=2" in the RulesInfo.i file generated for RulesInfo.cpp and
> didn't find either of them.
>
> Am I using the correct approach following on from your suggestion? Also, is
> the "Generate Processed File" option that I've switched on the one you were
> referring to?
>
> Thanks again
>
> JP
>
>
>
> "Pavel A." wrote:
>
> > Enable listing of C preprocessor and you will easily see where is the error.
> > --PA
> >
> > "J Prendergast" <j.prendergast@nospam.nospam> wrote in message news:92B45996-A2F3-4F8C-936C-7A4FBBE26487@microsoft.com...
> > > Hello,
> > >
> > > I'm continuing work on a user-mode project that uses the Windows DDK, which
> > > was originally written using the Windows IFS Kit version 3790.1414 on another
> > > PC.
> > >
> > > To get the project to build, the following include directories were listed
> > > up in Microsoft Visual Studio .NET (Tools | Options... | Projects | VC++
> > > Directories):
> > > C:\WINDDK\3790.1414\inc
> > > C:\WINDDK\3790.1414\inc\wxp
> > > C:\WINDDK\3790.1414\inc\ifs\wxp
> > > C:\WINDDK\3790.1414\inc\ddk\wxp
> > > C:\WINDDK\3790.1414\inc\crt
> > >
> > > I have just installed a later version of the IFS Kit / DDK, now known as
> > > "MicrosoftR WindowsR Driver Kit (WDK)". The DDK directory structure is
> > > installed on my PC under:
> > > C:\WINDDK\5112
> > >
> > > The include directories present in this later DDK do not match exactly those
> > > in the earlier one - by looking at the contents of the directories in the
> > > 3790.1414 and comparing them with those in the newer one, I've set up the
> > > following include directories:
> > > C:\WINDDK\5112\inc
> > > C:\WINDDK\5112\inc\api
> > > C:\WINDDK\5112\inc\ddk
> > > C:\WINDDK\5112\inc\crt
> > >
> > > However, when I build the entire solution in Visual Studio now, I get the
> > > following build error for several of the projects:
> > >
> > > C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
> > > unmatched parenthesis : missing ')'
> > >
> > > The line this refers to is:
> > > #if FLT_MGR_BASELINE
> > >
> > > If I right-click on this symbol and "Go to definition", it shows the
> > > definition in fltUser.h:
> > >
> > > #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
> > > SPVER(NTDDI_VERSION) >= 5) || \
> > > (OSVER(NTDDI_VERSION) ==
> > > NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
> > > (OSVER(NTDDI_VERSION) ==
> > > NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
> > > (OSVER(NTDDI_VERSION) >=
> > > NTDDI_WINLH)
> > >
> > > Clearly, there are no unmatched parentheses! (?)
> > >
> > > So I'm confused about why I get this build error.
> > >
> > > Does anyone have any idea why this error occurs, and what I can do to
> > > resolve it?
> > >
> > > Many thanks in advance for any advice or comments,
> > >
> > > JP


Re: Build problem with Windows Development Kit (WDK) by Stephan

Stephan
Fri Aug 12 03:12:27 CDT 2005

Maxim S. Shatskih wrote:
> By Mark Roddy I think?

Oops, yes, sure, pardon me. DDKBUILD is an offer by Mark Roddy, see

http://groups.google.com/group/microsoft.public.development.device.drivers/msg/22a7f383d2451414

Sorry folks...

Stephan
---
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
> "Stephan Wolf [MVP]" <stewo68@hotmail.com> wrote in message
> news:1123749131.362085.222260@g49g2000cwa.googlegroups.com...
> > Take a look at DDKBUILD by MVP Bill McKenzie (it's free):
> >
> > "DDKBUILD - Integrating the Windows DDK with Visual Studio .Net"
> > http://www.hollistech.com/
> > -> "Resources"
> > -> "DDKBUILD"
> >
> > Stephan


Re: Build problem with Windows Development Kit (WDK) by j

j
Fri Aug 12 03:21:06 CDT 2005

Thanks - I added the following code above #if FLT_MGR_BASELINE in
fltUserStructures.h

int nTest = 456;

int test(void)
{
FLT_MGR_BASELINE
}

When I compiled RulesInfo.cpp, this appeared in the generated RulesInfo.i
file thus:

int nTest = 456;

int test(void)
{
(OSVER(NTDDI_VERSION) == NTDDI_WIN2K && SPVER(NTDDI_VERSION) >= 5) ||
(OSVER(NTDDI_VERSION) == NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) ||
(OSVER(NTDDI_VERSION) == NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) ||
(OSVER(NTDDI_VERSION) >= NTDDI_WINLH)
}

and caused no compilation errors... yet the very next line starting with #if
did.
(as an aside, I typed all sorts of random things into this function and it
compiled OK - so I'm not sure how good the above test is!)

I've got a feeling this is one of those problems where the solution is very
simple / trivial - but finding it is nothing like that..

JP

"Pavel A." wrote:

> Oops, this was pretty idiotic on my part :(
> Preprocessor listing (the .i file) of course won't contain any
> preprocessor instructions.
>
> Maybe you can insert before of instead of this #if some C code,
> for example C function that contains this expression, to see how it expands.
>
> Regards,
> --PA
>
> "J Prendergast" wrote:
> > Hi, thanks for your response.
> >
> > My interpretation of this (as Iâ??ve not heard of this option before) was to
> > set the project setting:
> >
> > C/C++ -> Preprocessor -> Generate Processed File
> >
> > From value: No
> > To value: With Line Numbers (/P)
> >
> > When I built the project, as well as the usual files, it produces lots of .i
> > (Preprocessed C/C++ Source) files in the project source files directory.
> >
> > I looked at the relevant .i file, looking for the problematic code â?? but
> > couldnâ??t find it â?? maybe because it was in a #if decision, it wouldnâ??t be
> > included (as opposed to any #defineâ??d macros, which Iâ??m guessing would be?)
> >
> > To be more explicit, here's how I tried to look for it...
> >
> > I get the build error:
> > C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
> > unmatched parenthesis : missing ')'
> > first of all when the project is building the RulesInfo.cpp sourcefile
> >
> > I used the project setting C/C++ -> Advanced -> Show Includes (switched it
> > from No to Yes) so that when compiling this file, I get a list of the files
> > that are included. The last 3 that are included are:
> > Note: including file: C:\WINDDK\5112\inc\ddk\fltuser.h
> > Note: including file: C:\WINDDK\5112\inc\ddk\fltUserStructures.h
> > Note: including file: C:\WINDDK\5112\inc\ddk\fltWinError.h
> >
> > As described earlier, the troublesome #define is contained in fltuser.h
> > #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
> > SPVER(NTDDI_VERSION) >= 5) || \
> > (OSVER(NTDDI_VERSION) ==
> > NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
> > (OSVER(NTDDI_VERSION) ==
> > NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
> > (OSVER(NTDDI_VERSION) >=
> > NTDDI_WINLH)
> >
> > When it's used in the line "#if FLT_MGR_BASELINE" in fltUserStructures.h,
> > the error occurs.
> >
> > I tried looking for some of the "real code" from the #define's definition -
> > e.g. ">= 5", ">=2" in the RulesInfo.i file generated for RulesInfo.cpp and
> > didn't find either of them.
> >
> > Am I using the correct approach following on from your suggestion? Also, is
> > the "Generate Processed File" option that I've switched on the one you were
> > referring to?
> >
> > Thanks again
> >
> > JP
> >
> >
> >
> > "Pavel A." wrote:
> >
> > > Enable listing of C preprocessor and you will easily see where is the error.
> > > --PA
> > >
> > > "J Prendergast" <j.prendergast@nospam.nospam> wrote in message news:92B45996-A2F3-4F8C-936C-7A4FBBE26487@microsoft.com...
> > > > Hello,
> > > >
> > > > I'm continuing work on a user-mode project that uses the Windows DDK, which
> > > > was originally written using the Windows IFS Kit version 3790.1414 on another
> > > > PC.
> > > >
> > > > To get the project to build, the following include directories were listed
> > > > up in Microsoft Visual Studio .NET (Tools | Options... | Projects | VC++
> > > > Directories):
> > > > C:\WINDDK\3790.1414\inc
> > > > C:\WINDDK\3790.1414\inc\wxp
> > > > C:\WINDDK\3790.1414\inc\ifs\wxp
> > > > C:\WINDDK\3790.1414\inc\ddk\wxp
> > > > C:\WINDDK\3790.1414\inc\crt
> > > >
> > > > I have just installed a later version of the IFS Kit / DDK, now known as
> > > > "MicrosoftR WindowsR Driver Kit (WDK)". The DDK directory structure is
> > > > installed on my PC under:
> > > > C:\WINDDK\5112
> > > >
> > > > The include directories present in this later DDK do not match exactly those
> > > > in the earlier one - by looking at the contents of the directories in the
> > > > 3790.1414 and comparing them with those in the newer one, I've set up the
> > > > following include directories:
> > > > C:\WINDDK\5112\inc
> > > > C:\WINDDK\5112\inc\api
> > > > C:\WINDDK\5112\inc\ddk
> > > > C:\WINDDK\5112\inc\crt
> > > >
> > > > However, when I build the entire solution in Visual Studio now, I get the
> > > > following build error for several of the projects:
> > > >
> > > > C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
> > > > unmatched parenthesis : missing ')'
> > > >
> > > > The line this refers to is:
> > > > #if FLT_MGR_BASELINE
> > > >
> > > > If I right-click on this symbol and "Go to definition", it shows the
> > > > definition in fltUser.h:
> > > >
> > > > #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
> > > > SPVER(NTDDI_VERSION) >= 5) || \
> > > > (OSVER(NTDDI_VERSION) ==
> > > > NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
> > > > (OSVER(NTDDI_VERSION) ==
> > > > NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
> > > > (OSVER(NTDDI_VERSION) >=
> > > > NTDDI_WINLH)
> > > >
> > > > Clearly, there are no unmatched parentheses! (?)
> > > >
> > > > So I'm confused about why I get this build error.
> > > >
> > > > Does anyone have any idea why this error occurs, and what I can do to
> > > > resolve it?
> > > >
> > > > Many thanks in advance for any advice or comments,
> > > >
> > > > JP
>

Re: Build problem with Windows Development Kit (WDK) by Pavel

Pavel
Fri Aug 12 10:38:04 CDT 2005

Ok, since all these symbols (OSVER, NTDDI_VERSION...) survived
preprocessing, they all are undefined.
This is the reason of the error.

--PA

"J Prendergast" <j.prendergast@nospam.nospam> wrote in message news:F37F5C46-ED9F-4CF6-9E29-7A8C9D2EA47E@microsoft.com...
> Thanks - I added the following code above #if FLT_MGR_BASELINE in
> fltUserStructures.h
>
> int nTest = 456;
>
> int test(void)
> {
> FLT_MGR_BASELINE
> }
>
> When I compiled RulesInfo.cpp, this appeared in the generated RulesInfo.i
> file thus:
>
> int nTest = 456;
>
> int test(void)
> {
> (OSVER(NTDDI_VERSION) == NTDDI_WIN2K && SPVER(NTDDI_VERSION) >= 5) ||
> (OSVER(NTDDI_VERSION) == NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) ||
> (OSVER(NTDDI_VERSION) == NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) ||
> (OSVER(NTDDI_VERSION) >= NTDDI_WINLH)
> }
>
> and caused no compilation errors... yet the very next line starting with #if
> did.
> (as an aside, I typed all sorts of random things into this function and it
> compiled OK - so I'm not sure how good the above test is!)
>
> I've got a feeling this is one of those problems where the solution is very
> simple / trivial - but finding it is nothing like that..
>
> JP
>
> "Pavel A." wrote:
>
>> Oops, this was pretty idiotic on my part :(
>> Preprocessor listing (the .i file) of course won't contain any
>> preprocessor instructions.
>>
>> Maybe you can insert before of instead of this #if some C code,
>> for example C function that contains this expression, to see how it expands.
>>
>> Regards,
>> --PA
>>
>> "J Prendergast" wrote:
>> > Hi, thanks for your response.
>> >
>> > My interpretation of this (as I've not heard of this option before) was to
>> > set the project setting:
>> >
>> > C/C++ -> Preprocessor -> Generate Processed File
>> >
>> > From value: No
>> > To value: With Line Numbers (/P)
>> >
>> > When I built the project, as well as the usual files, it produces lots of .i
>> > (Preprocessed C/C++ Source) files in the project source files directory.
>> >
>> > I looked at the relevant .i file, looking for the problematic code - but
>> > couldn't find it - maybe because it was in a #if decision, it wouldn't be
>> > included (as opposed to any #define'd macros, which I'm guessing would be?)
>> >
>> > To be more explicit, here's how I tried to look for it...
>> >
>> > I get the build error:
>> > C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
>> > unmatched parenthesis : missing ')'
>> > first of all when the project is building the RulesInfo.cpp sourcefile
>> >
>> > I used the project setting C/C++ -> Advanced -> Show Includes (switched it
>> > from No to Yes) so that when compiling this file, I get a list of the files
>> > that are included. The last 3 that are included are:
>> > Note: including file: C:\WINDDK\5112\inc\ddk\fltuser.h
>> > Note: including file: C:\WINDDK\5112\inc\ddk\fltUserStructures.h
>> > Note: including file: C:\WINDDK\5112\inc\ddk\fltWinError.h
>> >
>> > As described earlier, the troublesome #define is contained in fltuser.h
>> > #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
>> > SPVER(NTDDI_VERSION) >= 5) || \
>> > (OSVER(NTDDI_VERSION) ==
>> > NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
>> > (OSVER(NTDDI_VERSION) ==
>> > NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
>> > (OSVER(NTDDI_VERSION) >=
>> > NTDDI_WINLH)
>> >
>> > When it's used in the line "#if FLT_MGR_BASELINE" in fltUserStructures.h,
>> > the error occurs.
>> >
>> > I tried looking for some of the "real code" from the #define's definition -
>> > e.g. ">= 5", ">=2" in the RulesInfo.i file generated for RulesInfo.cpp and
>> > didn't find either of them.
>> >
>> > Am I using the correct approach following on from your suggestion? Also, is
>> > the "Generate Processed File" option that I've switched on the one you were
>> > referring to?
>> >
>> > Thanks again
>> >
>> > JP
>> >
>> >
>> >
>> > "Pavel A." wrote:
>> >
>> > > Enable listing of C preprocessor and you will easily see where is the error.
>> > > --PA
>> > >
>> > > "J Prendergast" <j.prendergast@nospam.nospam> wrote in message news:92B45996-A2F3-4F8C-936C-7A4FBBE26487@microsoft.com...
>> > > > Hello,
>> > > >
>> > > > I'm continuing work on a user-mode project that uses the Windows DDK, which
>> > > > was originally written using the Windows IFS Kit version 3790.1414 on another
>> > > > PC.
>> > > >
>> > > > To get the project to build, the following include directories were listed
>> > > > up in Microsoft Visual Studio .NET (Tools | Options... | Projects | VC++
>> > > > Directories):
>> > > > C:\WINDDK\3790.1414\inc
>> > > > C:\WINDDK\3790.1414\inc\wxp
>> > > > C:\WINDDK\3790.1414\inc\ifs\wxp
>> > > > C:\WINDDK\3790.1414\inc\ddk\wxp
>> > > > C:\WINDDK\3790.1414\inc\crt
>> > > >
>> > > > I have just installed a later version of the IFS Kit / DDK, now known as
>> > > > "MicrosoftR WindowsR Driver Kit (WDK)". The DDK directory structure is
>> > > > installed on my PC under:
>> > > > C:\WINDDK\5112
>> > > >
>> > > > The include directories present in this later DDK do not match exactly those
>> > > > in the earlier one - by looking at the contents of the directories in the
>> > > > 3790.1414 and comparing them with those in the newer one, I've set up the
>> > > > following include directories:
>> > > > C:\WINDDK\5112\inc
>> > > > C:\WINDDK\5112\inc\api
>> > > > C:\WINDDK\5112\inc\ddk
>> > > > C:\WINDDK\5112\inc\crt
>> > > >
>> > > > However, when I build the entire solution in Visual Studio now, I get the
>> > > > following build error for several of the projects:
>> > > >
>> > > > C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
>> > > > unmatched parenthesis : missing ')'
>> > > >
>> > > > The line this refers to is:
>> > > > #if FLT_MGR_BASELINE
>> > > >
>> > > > If I right-click on this symbol and "Go to definition", it shows the
>> > > > definition in fltUser.h:
>> > > >
>> > > > #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
>> > > > SPVER(NTDDI_VERSION) >= 5) || \
>> > > > (OSVER(NTDDI_VERSION) ==
>> > > > NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
>> > > > (OSVER(NTDDI_VERSION) ==
>> > > > NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
>> > > > (OSVER(NTDDI_VERSION) >=
>> > > > NTDDI_WINLH)
>> > > >
>> > > > Clearly, there are no unmatched parentheses! (?)
>> > > >
>> > > > So I'm confused about why I get this build error.
>> > > >
>> > > > Does anyone have any idea why this error occurs, and what I can do to
>> > > > resolve it?
>> > > >
>> > > > Many thanks in advance for any advice or comments,
>> > > >
>> > > > JP
>>



Re: Build problem with Windows Development Kit (WDK) by j

j
Mon Aug 22 08:22:03 CDT 2005

Hi, many thanks for this. Here's the outcome of my further investigations,
indicating how I finally got everything to build in Visual Studio!

As you pointed out - since OSVER, SPVER and NTDDI_VERSION survived
preprocessing, it indicated that these are all undefined â?? and that _was_ the
primary reason behind my problem.

So I did a search for NTDDI_VERSION on Google, and found the following
interesting PowerPoint presentation and Word document.

WDK Build Environment Refactoring:

http://download.microsoft.com/download/f/0/5/f05a42ce-575b-4c60-82d6-208d3754b2d6/WDK_BE-Refactoring.ppt


Header File Changes in the Windows Driver Kit:

http://download.microsoft.com/download/5/D/6/5D6EAF2B-7DDF-476B-93DC-7CF0072878E6/headers.doc


These describe the changes between the old DDK and the WDK, including the
header file reorganisation that has taken place and led to my build problems.


In the release notes for version 5112 WDK, thereâ??s the following brief
mention of the changes:

Header Versioning Activated
This release of the WDK implements a versioned header system. The overall
effect of this new system is that the WDK no longer contains operating
system-specific include directories under \inc. The WDK build environments
are configured for this change, but customized build environments that have
hard-coded include paths might break.

Workaround: Use the WDK build environments, or update customized build
environments appropriately.

From the above 2 URLs, I found the following essential information:

----

1) The WDK build environment defines the constant NTDDI_VERSION to match the
driverâ??s build environment.

- Since various projects in Tonyâ??s updated Application Manager solution use
the DDK, and Iâ??m building them in Microsoft Visual Studio .NET, this is the
crux of the problem. If I was to build all the projects using the WDK build
environment, in theory, this build problem shouldnâ??t exist.


2) In order to still be able to build in Visual Studio, the solution is to
define NTDDI_VERSION with a target operating system value

Table 1: Windows Operating System Version Constants

Constant Version of operating system

NTDDI_WIN2K Windows 2000

NTDDI_WINXP Windows XP

NTDDI_WS03 Windows Server 2003

NTDDI_LONGHORN Windows Longhorn


(declared in the new sdkddkver.h header file)


· DO be sure that you build your drivers within the build environment
provided by the DDK, or that you define the necessary environment variables
to ensure that NTDDI_VERSION is correctly defined.

----


Taking into account this information, as a test, I added this line at the
top of RulesInfo.cpp


#define NTDDI_VERSION NTDDI_WINXP


The resulting RulesInfo.i file then contained:



(OSVER(NTDDI_WINXP) == NTDDI_WIN2K && SPVER(NTDDI_WINXP) >=
5) || (OSVER(NTDDI_WINXP) == NTDDI_WINXP && SPVER(NTDDI_WINXP) >=2) ||
(OSVER(NTDDI_WINXP) == NTDDI_WS03 && SPVER(NTDDI_WINXP) >=1) ||
(OSVER(NTDDI_WINXP) >= NTDDI_WINLH)


Indicating that OSVER and SPVER were still undefined.


I found that these are defined in the new â??sdkddkver.hâ?? header file, and
that is #included in the DDK version of â??windows.hâ??, found at:
C:\WINDDK\5112\inc\api


So, after all that, the main thing I needed to do was to ensure that this
include file directory is listed at the top of the Include Directories in
Visual Studioâ??s Tools -> Optionsâ?¦ -> Projects -> VC++ Directories settings.

It then turned out that NTDDI_VERSION gets #defined in â??sdkddkver.hâ?? too, so
#define'ing it wasnâ??t necessary in my source file.


After this primary reason for my build problem, I then had another 3 -
here's how I resolved them:

1) Even though everything in the project compiled, no .obj files were being
created, and it couldnâ??t link.

- It turns out that that having the â??C/C++ -> Preprocessor -> Generate
Processed Fileâ?? project setting set to â??With Line Numbers (/P)â?? caused no
.obj files to be created!?! Turning it off fixed the problem.


2) There was then a problem with another project in the solution against the
WDK:


c:\WINDDK\5112\inc\api\usb200.h(85) : error C2332: 'struct' : missing tag name

c:\WINDDK\5112\inc\api\usb200.h(85) : error C2011: '__unnamed' : 'enum' type
redefinition

C:\WINDDK\5112\inc\api\shlwapi.h(1482) : see declaration of
'__unnamed'

c:\WINDDK\5112\inc\api\usb200.h(85) : error C2059: syntax error : 'constant'

c:\WINDDK\5112\inc\api\usb200.h(85) : error C2334: unexpected token(s)
preceding '{'; skipping apparent function body



In usb200.h, the following was defined:



typedef union _USB_HIGH_SPEED_MAXPACKET {

struct _MP {

USHORT MaxPacket:11; /* 0..10 */

USHORT HSmux:2; /* 11..12 */

USHORT Reserved:3; /* 13..15 */

};

USHORT us;

} USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET;



But this caused a problem because _MP is already a #defined constant in
mbctype.h:



/* bit masks for MBCS character types */



#define _MS 0x01 /* MBCS single-byte symbol */

#define _MP 0x02 /* MBCS punct */

â?¦.



So my inelegant fix for this to put #undef _MP above the #include
<afxtempl.h> line in the project's stdafx.h file.



3) A simple one â?? the PUSB_NODE_CONNECTION_INFORMATION_EX used in this
project is defined within â??#if (_WIN32_WINNT >= 0x0501)â?? in
C:\WINDDK\5112\inc\api\usbioctl.h
It wasn't inside a #ifdef in the previous DDK version.

So I simply updated the _WIN32_WINNT #define in the project's stdafx.h file
as follows:

#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to
target Windows 2000 or later.


Thanks for all your help, I hope my post helps others who may encounter a
similar problem when building projects written against an older DDK, and they
then upgrade from DDK to Windows Driver Kit (WDK) for Windows Longhorn.

JP

"Pavel A." wrote:

> Ok, since all these symbols (OSVER, NTDDI_VERSION...) survived
> preprocessing, they all are undefined.
> This is the reason of the error.
>
> --PA
>
> "J Prendergast" <j.prendergast@nospam.nospam> wrote in message news:F37F5C46-ED9F-4CF6-9E29-7A8C9D2EA47E@microsoft.com...
> > Thanks - I added the following code above #if FLT_MGR_BASELINE in
> > fltUserStructures.h
> >
> > int nTest = 456;
> >
> > int test(void)
> > {
> > FLT_MGR_BASELINE
> > }
> >
> > When I compiled RulesInfo.cpp, this appeared in the generated RulesInfo.i
> > file thus:
> >
> > int nTest = 456;
> >
> > int test(void)
> > {
> > (OSVER(NTDDI_VERSION) == NTDDI_WIN2K && SPVER(NTDDI_VERSION) >= 5) ||
> > (OSVER(NTDDI_VERSION) == NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) ||
> > (OSVER(NTDDI_VERSION) == NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) ||
> > (OSVER(NTDDI_VERSION) >= NTDDI_WINLH)
> > }
> >
> > and caused no compilation errors... yet the very next line starting with #if
> > did.
> > (as an aside, I typed all sorts of random things into this function and it
> > compiled OK - so I'm not sure how good the above test is!)
> >
> > I've got a feeling this is one of those problems where the solution is very
> > simple / trivial - but finding it is nothing like that..
> >
> > JP
> >
> > "Pavel A." wrote:
> >
> >> Oops, this was pretty idiotic on my part :(
> >> Preprocessor listing (the .i file) of course won't contain any
> >> preprocessor instructions.
> >>
> >> Maybe you can insert before of instead of this #if some C code,
> >> for example C function that contains this expression, to see how it expands.
> >>
> >> Regards,
> >> --PA
> >>
> >> "J Prendergast" wrote:
> >> > Hi, thanks for your response.
> >> >
> >> > My interpretation of this (as I've not heard of this option before) was to
> >> > set the project setting:
> >> >
> >> > C/C++ -> Preprocessor -> Generate Processed File
> >> >
> >> > From value: No
> >> > To value: With Line Numbers (/P)
> >> >
> >> > When I built the project, as well as the usual files, it produces lots of .i
> >> > (Preprocessed C/C++ Source) files in the project source files directory.
> >> >
> >> > I looked at the relevant .i file, looking for the problematic code - but
> >> > couldn't find it - maybe because it was in a #if decision, it wouldn't be
> >> > included (as opposed to any #define'd macros, which I'm guessing would be?)
> >> >
> >> > To be more explicit, here's how I tried to look for it...
> >> >
> >> > I get the build error:
> >> > C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
> >> > unmatched parenthesis : missing ')'
> >> > first of all when the project is building the RulesInfo.cpp sourcefile
> >> >
> >> > I used the project setting C/C++ -> Advanced -> Show Includes (switched it
> >> > from No to Yes) so that when compiling this file, I get a list of the files
> >> > that are included. The last 3 that are included are:
> >> > Note: including file: C:\WINDDK\5112\inc\ddk\fltuser.h
> >> > Note: including file: C:\WINDDK\5112\inc\ddk\fltUserStructures.h
> >> > Note: including file: C:\WINDDK\5112\inc\ddk\fltWinError.h
> >> >
> >> > As described earlier, the troublesome #define is contained in fltuser.h
> >> > #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
> >> > SPVER(NTDDI_VERSION) >= 5) || \
> >> > (OSVER(NTDDI_VERSION) ==
> >> > NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
> >> > (OSVER(NTDDI_VERSION) ==
> >> > NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
> >> > (OSVER(NTDDI_VERSION) >=
> >> > NTDDI_WINLH)
> >> >
> >> > When it's used in the line "#if FLT_MGR_BASELINE" in fltUserStructures.h,
> >> > the error occurs.
> >> >
> >> > I tried looking for some of the "real code" from the #define's definition -
> >> > e.g. ">= 5", ">=2" in the RulesInfo.i file generated for RulesInfo.cpp and
> >> > didn't find either of them.
> >> >
> >> > Am I using the correct approach following on from your suggestion? Also, is
> >> > the "Generate Processed File" option that I've switched on the one you were
> >> > referring to?
> >> >
> >> > Thanks again
> >> >
> >> > JP
> >> >
> >> >
> >> >
> >> > "Pavel A." wrote:
> >> >
> >> > > Enable listing of C preprocessor and you will easily see where is the error.
> >> > > --PA
> >> > >
> >> > > "J Prendergast" <j.prendergast@nospam.nospam> wrote in message news:92B45996-A2F3-4F8C-936C-7A4FBBE26487@microsoft.com...
> >> > > > Hello,
> >> > > >
> >> > > > I'm continuing work on a user-mode project that uses the Windows DDK, which
> >> > > > was originally written using the Windows IFS Kit version 3790.1414 on another
> >> > > > PC.
> >> > > >
> >> > > > To get the project to build, the following include directories were listed
> >> > > > up in Microsoft Visual Studio .NET (Tools | Options... | Projects | VC++
> >> > > > Directories):
> >> > > > C:\WINDDK\3790.1414\inc
> >> > > > C:\WINDDK\3790.1414\inc\wxp
> >> > > > C:\WINDDK\3790.1414\inc\ifs\wxp
> >> > > > C:\WINDDK\3790.1414\inc\ddk\wxp
> >> > > > C:\WINDDK\3790.1414\inc\crt
> >> > > >
> >> > > > I have just installed a later version of the IFS Kit / DDK, now known as
> >> > > > "MicrosoftR WindowsR Driver Kit (WDK)". The DDK directory structure is
> >> > > > installed on my PC under:
> >> > > > C:\WINDDK\5112
> >> > > >
> >> > > > The include directories present in this later DDK do not match exactly those
> >> > > > in the earlier one - by looking at the contents of the directories in the
> >> > > > 3790.1414 and comparing them with those in the newer one, I've set up the
> >> > > > following include directories:
> >> > > > C:\WINDDK\5112\inc
> >> > > > C:\WINDDK\5112\inc\api
> >> > > > C:\WINDDK\5112\inc\ddk
> >> > > > C:\WINDDK\5112\inc\crt
> >> > > >
> >> > > > However, when I build the entire solution in Visual Studio now, I get the
> >> > > > following build error for several of the projects:
> >> > > >
> >> > > > C:\WINDDK\5112\inc\ddk\fltUserStructures.h(24) : fatal error C1012:
> >> > > > unmatched parenthesis : missing ')'
> >> > > >
> >> > > > The line this refers to is:
> >> > > > #if FLT_MGR_BASELINE
> >> > > >
> >> > > > If I right-click on this symbol and "Go to definition", it shows the
> >> > > > definition in fltUser.h:
> >> > > >
> >> > > > #define FLT_MGR_BASELINE (OSVER(NTDDI_VERSION) == NTDDI_WIN2K &&
> >> > > > SPVER(NTDDI_VERSION) >= 5) || \
> >> > > > (OSVER(NTDDI_VERSION) ==
> >> > > > NTDDI_WINXP && SPVER(NTDDI_VERSION) >=2) || \
> >> > > > (OSVER(NTDDI_VERSION) ==
> >> > > > NTDDI_WS03 && SPVER(NTDDI_VERSION) >=1) || \
> >> > > > (OSVER(NTDDI_VERSION) >=
> >> > > > NTDDI_WINLH)
> >> > > >
> >> > > > Clearly, there are no unmatched parentheses! (?)
> >> > > >
> >> > > > So I'm confused about why I get this build error.
> >> > > >
> >> > > > Does anyone have any idea why this error occurs, and what I can do to
> >> > > > resolve it?
> >> > > >
> >> > > > Many thanks in advance for any advice or comments,
> >> > > >
> >> > > > JP
> >>
>
>
>