GetVersion에 대한 리턴 값(DWORD)으로 Build Number, Major Version, Minor Version가 들어 있음.
_______________________________________
| build number | minor | major |
---------------------------------------
DWORD dwVersion = 0; DWORD dwMajorVersion = 0; DWORD dwMinorVersion = 0; DWORD dwBuild = 0; dwVersion = GetVersion(); dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); dwBuild = (DWORD)(HIWORD(dwVersion));
[*] MajorVersion, MinorVersion에 대응하는 Windows 버전은 아래와 같다.
Operating system | Version number | dwMajorVersion | dwMinorVersion | Other |
---|---|---|---|---|
Windows 8.1 | 6.3* | 6 | 3 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows Server 2012 R2 | 6.3* | 6 | 3 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
Windows 8 | 6.2 | 6 | 2 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows Server 2012 | 6.2 | 6 | 2 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
Windows 7 | 6.1 | 6 | 1 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows Server 2008 R2 | 6.1 | 6 | 1 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
Windows Server 2008 | 6.0 | 6 | 0 | OSVERSIONINFOEX.wProductType != VER_NT_WORKSTATION |
Windows Vista | 6.0 | 6 | 0 | OSVERSIONINFOEX.wProductType == VER_NT_WORKSTATION |
Windows Server 2003 R2 | 5.2 | 5 | 2 | GetSystemMetrics(SM_SERVERR2) != 0 |
Windows Server 2003 | 5.2 | 5 | 2 | GetSystemMetrics(SM_SERVERR2) == 0 |
Windows XP | 5.1 | 5 | 1 | Not applicable |
Windows 2000 | 5.0 | 5 | 0 | Not applicable |
ref : http://msdn.microsoft.com/en-us/library/windows/desktop/ms724834(v=vs.85).aspx
'Programming > Win_API' 카테고리의 다른 글
Windows 서비스 프로그램 (0) | 2014.03.22 |
---|---|
Windows API - 서비스 제어 (0) | 2014.01.21 |
ANSI, WIDE, TCHAR 함수들 (0) | 2014.01.08 |
실행 중인 Class, Caption, Process 이름 구하기 (0) | 2014.01.08 |
API Hooking - [3] DLL Injection + Trampoline Code Hooking (0) | 2013.12.07 |