vs.next %(PreprocessorDefinitions) macro

Does anyone know where the %(PreprocessorDefinitions) macro is defined
in vs.next? If you look at the c/c++ command line you can see the
defines that are added by this macro. It is apparent that this macro is
being defined on a per configuration basis; but I don’t see where it is
defined.

Regards,

What project type? Which defines? There are wdk .props and .targets in the program files\msbuild\cpp.… Tree (cpp is placeholder, can’t remember the real dir name) and under kitroot (build or msbuild might be the dir name, I don’t have a w8 kit install handy). Both locations add preprocessor defines

d

debt from my phone


From: George M. Garner Jr.
Sent: 9/28/2011 8:50 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] vs.next %(PreprocessorDefinitions) macro

Does anyone know where the %(PreprocessorDefinitions) macro is defined
in vs.next? If you look at the c/c++ command line you can see the
defines that are added by this macro. It is apparent that this macro is
being defined on a per configuration basis; but I don’t see where it is
defined.

Regards,


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron,

What project type? <

KMDF. I just generated a default KMDF driver project using the UI.
However, it doesn’t matter because the same mechanism is used for other
project types.

Which defines? <

Here are the contents of the “Preprocessor” edit control in the UI:

X86=1;i386=1;STD_CALL;%(PreprocessorDefinitions)

This results in the following c/c++ command line:

/Zi /nologo /W3 /WX /Od /Oi /Oy- /D “X86=1” /D “i386=1” /D “STD_CALL”
/D “DEPRECATE_DDK_FUNCTIONS=1” /D “MSC_NOOPT” /D “WIN32_LEAN_AND_MEAN=1”
/D “_WIN32_WINNT=0x0601” /D “WINVER=0x0601” /D “WINNT=1” /D
“NTDDI_VERSION=0x06010000” /D “DBG=1” /GF /Gm- /Zp8 /GS /Gy /fp:precise
/hotpatch /Zc:wchar_t- /Zc:forScope- /GR- /Fp"Windows 7
Debug\KMDFDriver1.pch" /Fa"Windows 7 Debug" /Fo"Windows 7 Debug"
/Fd"Windows 7 Debug\KMDFDriver1.pdb" /Gz /wd"4748" /wd"4603" /wd"4627"
/wd"4986" /wd"4987" /wd"4996" /FI"C:\Program Files (x86)\Windows
Kits\8.0\Include\Shared\warning.h" /analyze-
/analyze:plugin"WindowsPrefast.dll" /analyze:plugin"drivers.dll"
/errorReport:queue

If I remove the %(PreprocessorDefinitions) macro then I get the
following command line:

/Zi /nologo /W3 /WX /Od /Oi /Oy- /D “X86=1” /D “i386=1” /D “STD_CALL”
/GF /Gm- /Zp8 /GS /Gy /fp:precise /hotpatch /Zc:wchar_t- /Zc:forScope-
/GR- /Fp"Windows 7 Debug\KMDFDriver1.pch" /Fa"Windows 7 Debug"
/Fo"Windows 7 Debug" /Fd"Windows 7 Debug\KMDFDriver1.pdb" /Gz /wd"4748"
/wd"4603" /wd"4627" /wd"4986" /wd"4987" /wd"4996" /FI"C:\Program Files
(x86)\Windows Kits\8.0\Include\Shared\warning.h" /analyze-
/analyze:plugin"WindowsPrefast.dll" /analyze:plugin"drivers.dll"
/errorReport:queue

The difference is the following defines which must be coming from the
%(PreprocessorDefinitions) macro:

/D “DEPRECATE_DDK_FUNCTIONS=1” /D “MSC_NOOPT” /D “WIN32_LEAN_AND_MEAN=1”
/D “_WIN32_WINNT=0x0601” /D “WINVER=0x0601” /D “WINNT=1” /D
“NTDDI_VERSION=0x06010000” /D "DBG=1

However, the definition changes on a per configuration basis. So my
question is, “What is the discriminator?”

Regards,

George.

Chk build
/D “DEPRECATE_DDK_FUNCTIONS=1” /D “MSC_NOOPT” "DBG=1

Target OS
/D “_WIN32_WINNT=0x0601” /D “WINVER=0x0601” /D “NTDDI_VERSION=0x06010000” /D "DBG=1

Always added
/D “WINNT=1” /D “WIN32_LEAN_AND_MEAN=1”

Architecture
X86=1;i386=1;

d
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of George M. Garner Jr.
Sent: Thursday, September 29, 2011 7:47 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] vs.next %(PreprocessorDefinitions) macro

Doron,

What project type? <

KMDF. I just generated a default KMDF driver project using the UI.
However, it doesn’t matter because the same mechanism is used for other
project types.

Which defines? <

Here are the contents of the “Preprocessor” edit control in the UI:

X86=1;i386=1;STD_CALL;%(PreprocessorDefinitions)

This results in the following c/c++ command line:

/Zi /nologo /W3 /WX /Od /Oi /Oy- /D “X86=1” /D “i386=1” /D “STD_CALL”
/D “DEPRECATE_DDK_FUNCTIONS=1” /D “MSC_NOOPT” /D “WIN32_LEAN_AND_MEAN=1”
/D “_WIN32_WINNT=0x0601” /D “WINVER=0x0601” /D “WINNT=1” /D
“NTDDI_VERSION=0x06010000” /D “DBG=1” /GF /Gm- /Zp8 /GS /Gy /fp:precise
/hotpatch /Zc:wchar_t- /Zc:forScope- /GR- /Fp"Windows 7
Debug\KMDFDriver1.pch" /Fa"Windows 7 Debug" /Fo"Windows 7 Debug"
/Fd"Windows 7 Debug\KMDFDriver1.pdb" /Gz /wd"4748" /wd"4603" /wd"4627"
/wd"4986" /wd"4987" /wd"4996" /FI"C:\Program Files (x86)\Windows
Kits\8.0\Include\Shared\warning.h" /analyze-
/analyze:plugin"WindowsPrefast.dll" /analyze:plugin"drivers.dll"
/errorReport:queue

If I remove the %(PreprocessorDefinitions) macro then I get the
following command line:

/Zi /nologo /W3 /WX /Od /Oi /Oy- /D “X86=1” /D “i386=1” /D “STD_CALL”
/GF /Gm- /Zp8 /GS /Gy /fp:precise /hotpatch /Zc:wchar_t- /Zc:forScope-
/GR- /Fp"Windows 7 Debug\KMDFDriver1.pch" /Fa"Windows 7 Debug"
/Fo"Windows 7 Debug" /Fd"Windows 7 Debug\KMDFDriver1.pdb" /Gz /wd"4748"
/wd"4603" /wd"4627" /wd"4986" /wd"4987" /wd"4996" /FI"C:\Program Files
(x86)\Windows Kits\8.0\Include\Shared\warning.h" /analyze-
/analyze:plugin"WindowsPrefast.dll" /analyze:plugin"drivers.dll"
/errorReport:queue

The difference is the following defines which must be coming from the
%(PreprocessorDefinitions) macro:

/D “DEPRECATE_DDK_FUNCTIONS=1” /D “MSC_NOOPT” /D “WIN32_LEAN_AND_MEAN=1”
/D “_WIN32_WINNT=0x0601” /D “WINVER=0x0601” /D “WINNT=1” /D
“NTDDI_VERSION=0x06010000” /D "DBG=1

However, the definition changes on a per configuration basis. So my
question is, “What is the discriminator?”

Regards,

George.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer