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.
OSVERSIONINFOA structure (winnt.h)
Contains operating system version information. The information includes major and minor version numbers, a build number, a platform identifier, and descriptive text about the operating system. This structure is used with the GetVersionEx function.
To obtain additional version information, use the OSVERSIONINFOEX structure with GetVersionEx instead.
Syntax
Members
The size of this data structure, in bytes. Set this member to sizeof(OSVERSIONINFO) .
The major version number of the operating system. For more information, see Remarks.
The minor version number of the operating system. For more information, see Remarks.
The build number of the operating system.
The operating system platform. This member can be the following value.
Value | Meaning |
---|---|
VER_PLATFORM_WIN32_NT 2 | The operating system is WindowsВ 7, Windows ServerВ 2008, WindowsВ Vista, Windows ServerВ 2003, WindowsВ XP, or WindowsВ 2000. |
A null-terminated string, such as «Service Pack 3», that indicates the latest Service Pack installed on the system. If no Service Pack has been installed, the string is empty.
Remarks
Relying on version information is not the best way to test for a feature. Instead, refer to the documentation for the feature of interest. For more information on common techniques for feature detection, see Operating System Version.
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.
The following table summarizes the values returned by supported versions of Windows. Use the information in the column labeled «Other» to distinguish between operating systems with identical version numbers.
Operating system | Version number | dwMajorVersion | dwMinorVersion | Other |
---|---|---|---|---|
WindowsВ 10 | 10.0* | 10 | 0 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows ServerВ 2016 | 10.0* | 10 | 0 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
WindowsВ 8.1 | 6.3* | 6 | 3 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows ServerВ 2012В R2 | 6.3* | 6 | 3 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
WindowsВ 8 | 6.2 | 6 | 2 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows ServerВ 2012 | 6.2 | 6 | 2 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
WindowsВ 7 | 6.1 | 6 | 1 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows ServerВ 2008В R2 | 6.1 | 6 | 1 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
Windows ServerВ 2008 | 6.0 | 6 | 0 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
WindowsВ Vista | 6.0 | 6 | 0 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows ServerВ 2003В R2 | 5.2 | 5 | 2 | GetSystemMetrics(SM_SERVERR2) != 0 |
Windows ServerВ 2003 | 5.2 | 5 | 2 | GetSystemMetrics(SM_SERVERR2) == 0 |
WindowsВ XP | 5.1 | 5 | 1 | Not applicable |
WindowsВ 2000 | 5.0 | 5 | 0 | Not applicable |
* 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. |
В
Examples
The winnt.h header defines OSVERSIONINFO 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 (operating system)
Windows is a series of operating systems produced and maintained by the Microsoft Corporation. It was estimated that as of December 2007 [1] Microsoft Windows accounted for nearly 90% of operating system usage, with 3 out of 4 being Windows XP. Windows is used for desktop, and server computers, [2] and more recently also for cellular phones and tablet computers. It is intended for use with the Intel x86-64 family of processors.
Early versions of Windows (98 and earlier) were notoriously unreliable, despite (or maybe because of?) Microsoft’s near-monopoly share of the operating system market. They crashed so often that the term «blue screen of death» entered the vocabulary. See also this satire: Matrix Runs on Windows XP
Initially Windows was a text-based system (MS-DOS). Then a Graphical User Interface extension was added onto this MS-DOS core [3] It became a full GUI operating system free of the MS-DOS core beginning with the release of Windows NT.
Contents
Windows Major Release Versions
Name | Version Number | Public Release | Notes | Editions | Minimum RAM required | Minimum drive space |
---|---|---|---|---|---|---|
Windows 1.0 | 1.0 | November 20, 1985 [4] | Sold 500,000 copies [5] | |||
Windows 1.02 | 1.02 | May 1986 | Multilingual (international) release of 1.0 | |||
Windows 1.03 | 1.03 | August 1986 | Further upgrades for international use, including more drivers and European keyboard support | |||
Windows 1.04 | 1.04 | April 1987 | Further functionality additions, including support for IBM PS/2 computers | |||
Windows 2.0 | 2.11 | March 13, 1989 |
| |||
Windows 3.0 | NT 3.0 | May 22, 1990 |
| |||
Windows 3.1 | 3.1 | April 1992 | First MS operating system on CD-ROM |
| 1MB | i286 15MB |
Windows 3.2 | November 22, 1993 | Chinese version of Windows 3.1 | ||||
Windows NT 3.5 | 3.5.807 | September 21, 1994 |
| |||
Windows NT 3.51 | 3.51.1057 | May 30, 1995 |
|
| ||
Windows 95 | NT 4.0.950 | August 24, 1995 | Uses the same skin as 98, 2000, and ME | 4MB [7] | 40.8-76.2MB [8] | |
Windows NT 4.0 | NT 4.0 | July 29, 1996 |
| |||
Windows CE Alder [9] | CE 1.0 | November 16, 1996 [9] | 2MB | |||
Windows CE Birch [9] | CE 2.0 | November 1997 [9] | Auto PC platform introduced [10] | |||
Windows 98 | NT 4.1.1998 | June 25, 1998 | Uses the same skin as 95, 2000, and ME | 16MB | 500MB | |
Windows 98 Second Edition | NT 4.1.2222 | April 23, 1999 | Uses the same skin as 95, 2000, and ME | |||
Windows CE 2.1 | ||||||
Windows 2000 | NT 5.0.2195 | February 17, 2000 |
|
| ||
Windows CE Cedar | CE 3.0 | April 2000 | Windows CE for Automotive | |||
Windows ME | NT 4.90.3000 | September 14, 2000 |
| |||
Windows XP | 5.1.2600 | October 25, 2001 |
|
| x32/x86: 64MB [12] x64: 256MB | 1.5GB |
Windows CE Talisker [9] | CE 4.0 | January 7, 2002 | ||||
Windows CE Jameson [9] | CE 4.1 | June 2002 [9] | Windows Automotive | |||
Windows CE McKendric [9] | CE 4.2 | April 2003 [9] | Windows Automotive 4.2 | |||
Windows Server 2003 | NT 5.2 | 2003 | ||||
Windows CE Macallan [9] | CE 5.0 | August 2004 [9] | Windows Automotive 5.0 | 6MB [13] | ||
Windows Server 2003 R2 | 2006 | |||||
Windows CE Yamazaki [9] | CE 6.0 | September 2006 [9] |
| |||
Windows Vista | NT 6.0.6000 | January 30, 2007 |
|
| Home Basic: 512MB, All Others: 1GB [15] | 20GB |
Windows Server 2008 | February 27, 2008 | 512 MB | Foundation: 10GB, other x32/86: 20GB, other x64: 32GB | |||
Windows 7 | NT 6.1.7600 | October 22, 2009 |
|
| x32/x86: 1GB, x64: 2GB [12] | x32/x86: 16GB, x64: 20GB |
Windows Server 2008 R2 | 2010 |
| 512 MB | Foundation: 10GB, others: 32GB | ||
Windows Embedded Compact 7 | CE 6.0 R3 | 2011 |
| |||
Windows Server 2012 | NT 6.2 | 2012 |
| 512MB | 32GB | |
Windows 8 | NT 6.2 | October 26, 2012 |
|
| x32/x86: 1GB, x64: 2GB [16] | x32/x86: 16GB, x64: 20GB |
Windows RT | NT 6.3 | October 30, 2012 |
|
| 32-Bit: 2GB [16] | 32-Bit: 20GB, 32GB |
Windows Server 2012 R2 | NT 6.3 | 2013 |
| 512MB | 32GB | |
Windows 8.1 | NT 6.3 | October 17, 2013 | Slight update from 8.0 which brings back the Start button |
| x32/x86: 1GB, x64: 2GB [16] | |
Windows 10 | NT 6.4 [17] | July 29, 2015 |
|
| x32/x86: 1GB, x64: 2GB [19] | x32/x86: 16GB, x64: 20GB [20][21] |
Windows Server 2016 | October 12, 2016 (RTM: September 26, 2016) |
| ||||
Name | Version Number | Public Release | Notes | Editions | Minimum RAM required | Minimum drive space |
(Some popular NT releases are listed in bold and special server releases are listed in italic.) [22] [23] [24] [25]