2014년 5월 13일 화요일

[미완] [API] 윈도우 버전 구하기

[미완] [API] 윈도우 버전 구하기

#include <windows.h>

int main ( void )
{
   OSVERSIONINFOEX  osvi;
   memset( &osvi, 0, sizeof(OSVERSIONINFOEX ) );
   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX );
   GetVersionEx( (OSVERSIONINFO*)&osvi );

   // 만일 Win7이면
   // osvi.dwMajorVersion == 6
   // osvi.dwMinorVersion == 1

   return 0;
}

OS별 값
Operating systemVersion numberdwMajorVersiondwMinorVersionOther
Windows 8.16.3*63OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2012 R26.3*63OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows 86.262OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 20126.262OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows 76.161OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2008 R26.161OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows Server 20086.060OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION
Windows Vista6.060OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION
Windows Server 2003 R25.252GetSystemMetrics(SM_SERVERR2) != 0
Windows Home Server5.252OSVERSIONINFOEX.wSuiteMask & VER_SUITE_WH_SERVER
Windows Server 20035.252GetSystemMetrics(SM_SERVERR2) == 0
Windows XP Professional x64 Edition5.252(OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION) && (SYSTEM_INFO.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64)
Windows XP5.151Not applicable
Windows 20005.050Not applicable












댓글 없음:

댓글 쓰기