OSVERSIONINFOEX ovi;
ZeroMemory(&ovi, sizeof(OSVERSIONINFOEX));
ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
GetVersionEx((OSVERSIONINFO*)&ovi);
printf("dwMajorVersion = %d\n", ovi.dwMajorVersion);
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);
}