GetWinOSVersion
int GetWinOSVersion (unsigned long *majorVersion, unsigned long *minorVersion, unsigned long *build, unsigned long *platform);
Purpose
This function returns detailed information about the current Windows operating system version. It does not return service pack information. The following table lists the parameter values for the operating systems LabWindows/CVI supports.
Operating System | Major Version | Minor Version | Build | Platform |
---|---|---|---|---|
Windows 10 | 10 | 0 | <build number> | PLATFORM_WINNT |
Windows 8.1 | 6 | 3 | <build number> | PLATFORM_WINNT |
Windows 7 | 6 | 1 | <build number> | PLATFORM_WINNT |
Windows Server 2012 | 6 | 2 | <build number> | PLATFORM_WINNT |
Windows Server 2008 | 6 | 1 | <build number> | PLATFORM_WINNT |
(Linux) This function is not supported.
Parameters
Output | ||
Name | Type | Description |
majorVersion | unsigned long | Returns the major version of the operating system. This parameter will contain 6 for Windows 10/8/7/Server 2012/Server 2008. You can pass NULL for this parameter. |
minorVersion | unsigned long | Returns the minor version of the operating system. On Windows 7/Server 2008, for example, this parameter contains 1. On Windows 10, 8.1, and Server 2012, this parameter contains 2. You can pass NULL for this parameter. |
build | unsigned long | Returns the build number of the operating system. You can pass NULL for this parameter. |
platform | unsigned long | Returns the platform ID of the operating system. This parameter contains the value PLATFORM_WINNT. You can pass NULL for this parameter. |
Return Value
Name | Type | Description |
status | int | The status code that the function returns. 0 indicates success. A negative value indicates an error. This function may return a Programmer's Toolbox or UI Library error code. Call GetGeneralErrorString to obtain a text description of the error. |
Additional Information
Library: Programmer's Toolbox
Include file: toolbox\toolbox.h
LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later