Answer the question
In order to leave comments, you need to log in
Why might GetVersionEx not work correctly?
OSVERSIONINFOEX ovi;
ZeroMemory(&ovi, sizeof(OSVERSIONINFOEX));
ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
GetVersionEx((OSVERSIONINFO*)&ovi);
printf("dwMajorVersion = %d\n", ovi.dwMajorVersion);
Answer the question
In order to leave comments, you need to log in
According to the documentation, starting with Win8.1, this function returns the version from the application manifest, or 6.2 if it doesn't exist
https://msdn.microsoft.com/en-us/library/windows/d...
Ibid to determine the version system is recommended to use this feature set
https://msdn.microsoft.com/en-us/library/windows/d...
LPBYTE pinfoRawData{};
if (NERR_Success == NetWkstaGetInfo(NULL, 100, &pinfoRawData))
{
WKSTA_INFO_100* pworkstationInfo = (WKSTA_INFO_100*)pinfoRawData;
int major = pworkstationInfo->wki100_ver_major;
int minor = pworkstationInfo->wki100_ver_minor;
printf("major = %d\n", major);
printf("minor = %d\n", minor);
NetApiBufferFree(pinfoRawData);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question