switch (osvi.dwPlatformId) { // Tests for Windows NT product family. case VER_PLATFORM_WIN32_NT:
g_bIsNT = true;
// Test for the product.
if ( osvi.dwMajorVersion <= 4 ) DebugShowConsoleAndOutputDebugString ("Microsoft Windows NT ");
if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 ) DebugShowConsoleAndOutputDebugString ("Microsoft Windows 2000 ");
if (osvi.dwMajorVersion == 6) // windows vista { DebugShowConsoleAndOutputDebugString ("Microsoft Windows Vista "); g_bIsVista = true; }
if( bOsVersionInfoEx ) // Use information from GetVersionEx. { // Test for the workstation type. if ( osvi.wProductType == VER_NT_WORKSTATION ) { if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 ) DebugShowConsoleAndOutputDebugString ("Microsoft Windows XP ");
// Test for the server type. else if ( osvi.wProductType == VER_NT_SERVER ) { if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 ) DebugShowConsoleAndOutputDebugString ("Microsoft Windows .NET ");
if( osvi.wSuiteMask & VER_SUITE_DATACENTER ) DebugShowConsoleAndOutputDebugString ( "DataCenter Server " ); else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE ) if( osvi.dwMajorVersion == 4 ) DebugShowConsoleAndOutputDebugString ("Advanced Server " ); else DebugShowConsoleAndOutputDebugString ( "Enterprise Server " ); else if ( osvi.wSuiteMask == VER_SUITE_BLADE ) DebugShowConsoleAndOutputDebugString ( "Web Server " ); else DebugShowConsoleAndOutputDebugString ( "Server " ); } } else // Use the registry on early versions of Windows NT. { HKEY hKey; char szProductType[BUFSIZE]; DWORD dwBufLen=BUFSIZE; LONG lRet;
// 각종 정보를 OutputDebugString()만 호출하는게 아니라 화면에도 출력 하기 위해서... void DebugShowConsoleAndOutputDebugString(const char* buf) { //printf(buf); cout << buf << endl; OutputDebugString(buf); }