Operating System Version
The Version API Helper functions are used to determine the version of the operating system that is currently running. For more information, see Getting the System Version.
The following table summarizes the most recent operating system version numbers.
Operating system | Version number |
---|---|
Windows 10 | 10.0* |
Windows Server 2019 | 10.0* |
Windows Server 2016 | 10.0* |
Windows 8.1 | 6.3* |
Windows Server 2012 R2 | 6.3* |
Windows 8 | 6.2 |
Windows Server 2012 | 6.2 |
Windows 7 | 6.1 |
Windows Server 2008 R2 | 6.1 |
Windows Server 2008 | 6.0 |
Windows Vista | 6.0 |
Windows Server 2003 R2 | 5.2 |
Windows Server 2003 | 5.2 |
Windows XP 64-Bit Edition | 5.2 |
Windows XP | 5.1 |
Windows 2000 | 5.0 |
* For applications that have been manifested for Windows 8.1 or Windows 10. Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). To manifest your applications for Windows 8.1 or Windows 10, refer to Targeting your application for Windows.
Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using the Version API Helper functions to determine the operating system platform or version number, test for the presence of the feature itself.
To determine the best way to test for a feature, refer to the documentation for the feature of interest. The following list discusses some common techniques for feature detection:
- You can test for the presence of the functions associated with a feature. To test for the presence of a function in a system DLL, call the LoadLibrary function to load the DLL. Then call the GetProcAddress function to determine whether the function of interest is present in the DLL. Use the pointer returned by GetProcAddress to call the function. Note that even if the function is present, it may be a stub that just returns an error code such as ERROR_CALL_NOT_IMPLEMENTED.
- You can determine the presence of some features by using the GetSystemMetrics function. For example, you can detect multiple display monitors by calling GetSystemMetrics(SM_CMONITORS).
- There are several versions of the redistributable DLLs that implement shell and common control features. For information about determining which versions are present on the system your application is running on, see the topic Shell and Common Controls Versions.
If you must require a particular operating system, be sure to use it as a minimum supported version, rather than design the test for the one operating system. This way, your detection code will continue to work on future versions of Windows.
Note that a 32-bit application can detect whether it is running under WOW64 by calling the IsWow64Process function. It can obtain additional processor information by calling the GetNativeSystemInfo function.
VerifyVersionInfoA function (winbase.h)
Compares a set of operating system version requirements to the corresponding values for the currently running version of the system.This function is subject to manifest-based behavior. For more information, see the Remarks section.
Note: This function has been deprecated for Windows 10. See targeting your applications for Windows for more information.
Syntax
Parameters
A pointer to an OSVERSIONINFOEX structure containing the operating system version requirements to compare. The dwTypeMask parameter indicates the members of this structure that contain information to compare.
You must set the dwOSVersionInfoSize member of this structure to sizeof(OSVERSIONINFOEX) . You must also specify valid data for the members indicated by dwTypeMask. The function ignores structure members for which the corresponding dwTypeMask bit is not set.
A mask that indicates the members of the OSVERSIONINFOEX structure to be tested. This parameter can be one or more of the following values.
Value | Meaning |
---|---|
VER_BUILDNUMBER 0x0000004 | dwBuildNumber |
VER_MAJORVERSION 0x0000002 | dwMajorVersion If you are testing the major version, you must also test the minor version and the service pack major and minor versions. |
VER_MINORVERSION 0x0000001 | dwMinorVersion |
VER_PLATFORMID 0x0000008 | dwPlatformId |
VER_SERVICEPACKMAJOR 0x0000020 | wServicePackMajor |
VER_SERVICEPACKMINOR 0x0000010 | wServicePackMinor |
VER_SUITENAME 0x0000040 | wSuiteMask |
VER_PRODUCT_TYPE 0x0000080 | wProductType |
The type of comparison to be used for each lpVersionInfo member being compared. To build this value, call the VerSetConditionMask function or the VER_SET_CONDITION macro once for each OSVERSIONINFOEX member being compared.
Return value
If the currently running operating system satisfies the specified requirements, the return value is a nonzero value.
If the current system does not satisfy the requirements, the return value is zero and GetLastError returns ERROR_OLD_WIN_VERSION.
If the function fails, the return value is zero and GetLastError returns an error code other than ERROR_OLD_WIN_VERSION.
Remarks
The VerifyVersionInfo function retrieves version information about the currently running operating system and compares it to the valid members of the lpVersionInfo structure. This enables you to easily determine the presence of a required set of operating system version conditions. It is preferable to use VerifyVersionInfo rather than calling the GetVersionEx function to perform your own comparisons.
Typically, VerifyVersionInfo returns a nonzero value only if all specified tests succeed. However, major, minor, and service pack versions are tested in a hierarchical manner because the operating system version is a combination of these values. If a condition exists for the major version, it supersedes the conditions specified for minor version and service pack version. (You cannot test for major version greater than 5 and minor version less than or equal to 1. If you specify such a test, the function will change the request to test for a minor version greater than 1 because it is performing a greater than operation on the major version.)
The function tests these values in this order: major version, minor version, and service pack version. The function continues testing values while they are equal, and stops when one of the values does not meet the specified condition. For example, if you test for a system greater than or equal to version 5.1 service pack 1, the test succeeds if the current version is 6.0. (The major version is greater than the specified version, so the testing stops.) In the same way, if you test for a system greater than or equal to version 5.1 service pack 1, the test succeeds if the current version is 5.2. (The minor version is greater than the specified versions, so the testing stops.) However, if you test for a system greater than or equal to version 5.1 service pack 1, the test fails if the current version is 5.0 service pack 2. (The minor version is not greater than the specified version, so the testing stops.)
To verify a range of system versions, you must call VerifyVersionInfo twice. For example, to verify that the system version is greater than 5.0 but less than or equal to 5.1, first call VerifyVersionInfo to test that the major version is 5 and the minor version is greater than 0, then call VerifyVersionInfo again to test that the major version is 5 and the minor version is less than or equal to 1.
Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using GetVersionEx to determine the operating system platform or version number, test for the presence of the feature itself. For more information, see Operating System Version.
To verify whether the current operating system is either the Media Center or Tablet PC version of Windows, call GetSystemMetrics.
WindowsВ 10:В В VerifyVersionInfo returns false when called by applications that do not have a compatibility manifest for WindowsВ 8.1 or WindowsВ 10 if the lpVersionInfo parameter is set so that it specifies WindowsВ 8.1 or WindowsВ 10, even when the current operating system version is WindowsВ 8.1 or WindowsВ 10. Specifically, VerifyVersionInfo has the following behavior:
The Version Helper functions use the VerifyVersionInfo function, so the behavior IsWindows8Point1OrGreater and IsWindows10OrGreater are similarly affected by the presence and content of the manifest.
To manifest your applications for WindowsВ 8.1 or WindowsВ 10, see Targeting your application for Windows.
Examples
The winbase.h header defines VerifyVersionInfo as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Windows Version Numbers
A list of Windows version numbers & major Windows builds
Each Microsoft Windows operating system has a familiar name, like Windows 10 or Windows Vista, but behind each common name is an actual Windows version number 1 .
You can determine your Windows version a number of ways if you want to check which build number you’re currently running.
Windows Version Numbers
Below is a list of major Windows versions and their associated version numbers:
Reference Table for Windows Version Numbers | ||
---|---|---|
Operating System | Version Details | Version Number |
Windows 10 | Windows 10 (20H2) | 10.0.19042 |
Windows 10 (2004) | 10.0.19041 | |
Windows 10 (1909) | 10.0.18363 | |
Windows 10 (1903) | 10.0.18362 | |
Windows 10 (1809) | 10.0.17763 | |
Windows 10 (1803) | 10.0.17134 | |
Windows 10 (1709) | 10.0.16299 | |
Windows 10 (1703) | 10.0.15063 | |
Windows 10 (1607) | 10.0.14393 | |
Windows 10 (1511) | 10.0.10586 | |
Windows 10 | 10.0.10240 | |
Windows 8 | Windows 8.1 (Update 1) | 6.3.9600 |
Windows 8.1 | 6.3.9200 | |
Windows 8 | 6.2.9200 | |
Windows 7 | Windows 7 SP1 | 6.1.7601 |
Windows 7 | 6.1.7600 | |
Windows Vista | Windows Vista SP2 | 6.0.6002 |
Windows Vista SP1 | 6.0.6001 | |
Windows Vista | 6.0.6000 | |
Windows XP | Windows XP 2 | 5.1.2600 3 |
[1] More specific than a version number, at least in Windows, is a build number, often indicating exactly what major update or service pack has been applied to that Windows version. This is the last number shown in the version number column, like 7600 for Windows 7. Some sources note the build number in parenthesis, like 6.1 (7600).
[2] Windows XP Professional 64-bit had its own version number of 5.2. As far as we know, that’s the only time Microsoft has designated a special version number for a specific edition and architecture-type of a Windows operating system.
[3] Service pack updates to Windows XP did update the build number but in a very minor and long-winded way. For example, Windows XP with SP3 and other small updates is listed as having a version number of 5.1 (Build 2600.xpsp_sp3_qfe.130704-0421 : Service Pack 3).
How to Update Windows
To update Windows to the newest build number, use Windows Update. Using the built-in Windows Update utility is the easiest way to check for and install Windows updates.
If your version of Windows isn’t currently set up to install updates automatically, you can change the Windows Update settings so that new updates are downloaded and applied automatically. This is the simplest way to keep Windows updated to the latest version number.
Major Changes in Windows 10
Microsoft introduced several changes to the Windows operating system with the release of Windows 10. These are some of the biggest differences between Windows 10 and Windows 8 (and older versions of Windows):