Microsoft KB Archive/314963

= PRB: WINVER Is Incorrectly Set to 0x0501 in the Windows 2000 Build Environment of the DDK =

Article ID: 314963

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Windows XP Driver Development Kit

-



This article was previously published under Q314963



SYMPTOMS
You may notice that the environment variable WINVER is incorrectly set to 0x0501 in the Microsoft Windows 2000 build environment of the Windows XP DDK.



CAUSE
In the Windows XP DDK, the value for WINVER is set to 0x0501, even in the Windows 2000 build environment. The correct value for WINVER in the Windows 2000 build environment is 0x0500.



RESOLUTION
To conditionally compile your code (which takes into account the target platform), check the definition of WINVER at compile time. Make sure that you carefully check your drivers, and any public include files that your drivers may reference, to determine whether these drivers and files rely on the definition of WINVER.

If reliance on WINVER cannot be avoided, you can edit the %BASEDIR%\bin\w2k\set2k.bat file, and then add the following line before any other set commands at the beginning of the file:

set WIN32_WINNT_VERSION=0x0500

For the sake of thoroughness, you may also want to set the value of WIN32_IE_VERSION. Although a particular driver may not rely on this value, Control Panel extensions or software components may. Add the following line immediately after the set WIN32_WINNT_VERSION=0x0500 line (described in the preceding paragraph of this article):

set WIN32_IE_VERSION=0x0501

As an alternative to WINVER for conditional compilation tests in your driver, use the VER_PRODUCTMAJORVERSION and VER_PRODUCTMINORVERSION definitions found in ntverp.h.

Keywords: kbinput kbprb kbwdm KB314963

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.