p; strcat(szname, "Enterprise Edition " );
else if ( osvi.wSuiteMask == VER_SUITE_BLADE )
strcat(szname, "Web Edition " );
else
strcat(szname, "Standard Edition " );
}
else if( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
{
if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
strcat(szname, "Datacenter Server " );
else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
strcat(szname, "Advanced Server " );
else
strcat(szname, "Server " );
}
else // Windows NT 4.0
{
if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
strcat(szname,"Server 4.0, Enterprise Edition " );
else
strcat(szname, "Server 4.0 " );
}
}
}
else // Test for specific product on Windows NT 4.0 SP5 and earlier
{
HKEY hKey;
char szProductType[BUFSIZE];
DWORD dwBufLen=BUFSIZE;
LONG lRet;
lRet = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
"SYSTEM\\CurrentControlSet\\Control\\ProductOptions",
0, KEY_QUERY_VALUE, &hKey );
if( lRet != ERROR_SUCCESS )
return FALSE;
lRet = RegQueryValueEx( hKey, "ProductType", NULL, NULL,
(LPBYTE) szProductType, &dwBufLen);
if( (lRet != ERROR_SUCCESS) || (dwBufLen > BUFSIZE) )
return FALSE;
RegCloseKey( hKey );