Im using:
bool GetOS(LPTSTR pszOS)
{
OSVERSIONINFOEX osve;
BOOL bOsVersionInfoEx;
ZeroMemory(&osve, sizeof(OSVERSIONINFOEX));
osve.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osve)) )
return false;
TCHAR buf[80];
StringCchPrintf( buf, 80, TEXT("%u.%u.%u.%u"),
osve.dwPlatformId,
osve.dwMajorVersion,
osve.dwMinorVersion,
osve.dwBuildNumber);
StringCchCat(pszOS, BUFSIZE, buf);
return true;
}
to get the windows version, and I am planning to use pszOS every a few minutes,
Should I use pszOS as a global var or call GetOS() every time?
What's the best option from a performance point of view.