AIT_GetOSType

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.

ValueDescription
5Windows XP
5Windows Server 2003
6Windows Vista
6Windows Server 2008
6Windows 7
6Windows Server 2012
6Windows Server 2012 R2
6Windows 8
6Windows 8.1

nMinorVersion (output)

Specify a variable to receive a minor OS version. When the function returns, the variable stores one of the following values.

ValueDescription
1Windows XP
2Windows Server 2003
0Windows Vista
0Windows Server 2008
1Windows Server 2008 R2
1Windows 7
2Windows Server 2012
3Windows Server 2012 R2
2Windows 8
3Windows 8.1

nPlatformID (output)

Specify a variable to receive an OS platform ID. When the function returns, the variable stores one of the following values.

ValueDescription
VER_PLATFORM_WIN32_NTWindows 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 numberError code
122ERROR_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.