Kernel32GetVersionEx Method

Returns version information about the current operating system.

With the release of Windows 8.1, the behavior of the GetVersionEx(OsVersionInfoEx) API has changed in the value it will return for the OS version. The value returned by the GetVersionEx(OsVersionInfoEx) function now depends on how the application is manifested.

Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). Once an application is manifested for a given operating system version, GetVersionEx(OsVersionInfoEx) will always return the version that the application is manifested for in future releases.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static bool GetVersionEx(
	ref OsVersionInfoEx refOsVersionInfo
)

Parameters

refOsVersionInfo  OsVersionInfoEx
An OsVersionInfoEx structure that receives the operating system information.

Before calling the GetVersionEx(OsVersionInfoEx) function, set the SizeOfStruct member as appropriate to indicate which data structure is being passed to this function.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also