AIT_GetOSType
- Organization of this page
Description
Acquires major and minor OS versions, and a platform ID.
Format
bool AIT_GetOSType ( integer nMajorVersion, // Major OS version integer nMinorVersion, // Minor OS version integer nPlatformID // Platform ID );
Parameters
nMajorVersion (output)
Specify a variable to receive a major OS version. When the function returns, the variable stores one of the following values.
Value |
Description |
---|---|
5 |
Windows XP |
5 |
Windows Server 2003 |
6 |
Windows Vista |
6 |
Windows Server 2008 |
6 |
Windows 7 |
6 |
Windows Server 2012 |
6 |
Windows Server 2012 R2 |
6 |
Windows 8 |
6 |
Windows 8.1 |
10 |
Windows 10 |
10 |
Windows Server 2016 |
nMinorVersion (output)
Specify a variable to receive a minor OS version. When the function returns, the variable stores one of the following values.
Value |
Description |
---|---|
1 |
Windows XP |
2 |
Windows Server 2003 |
0 |
Windows Vista |
0 |
Windows Server 2008 |
1 |
Windows Server 2008 R2 |
1 |
Windows 7 |
2 |
Windows Server 2012 |
3 |
Windows Server 2012 R2 |
2 |
Windows 8 |
3 |
Windows 8.1 |
0 |
Windows 10 |
0 |
Windows Server 2016 |
nPlatformID (output)
Specify a variable to receive an OS platform ID. When the function returns, the variable stores one of the following values.
Value |
Description |
---|---|
VER_PLATFORM_WIN32_NT |
Windows Server 2016, Windows 10, Windows 8.1, Windows 8, Windows Server 2012 R2, Windows Server 2012, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003, or Windows XP |
Return values
The return value is true if the function was executed normally, and false if not. If the function has returned false, you can use AIT_GetLastError to acquire an extended error code. The following gives the error code that AIT_GetLastError might return:
Extended error number |
Error code |
---|---|
122 |
ERROR_INSUFFICIENT_BUFFER |
Note
You have to use a desired version number or a greater number to identify what OS version the application is working on. This allows you to test even a new OS version in the same way.