Every link I look at always mentions GetVersionEx, but that doesn’t seem very helpful.
My method looks like this,
static int windowsVersion() {
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
return osvi.dwMajorVersion;
}
Which I am running Windows 8 and instead it returns 6.
If I’m trying to accurately get their version of Windows, that isn’t very helpful.
Note: I’ve also checked all the other variables. the dwMinorVersion returns a 4, build number returns something like 8400.
You need to use both the Major and Minor Version Numbers.