22 #define _OSVERPACK(BASE, MAJOR, MINOR, IS64) \
23 MAKELONG(MAKEWORD(MINOR, MAJOR), MAKEWORD(BASE, IS64))
73 OSVERSIONINFO* P =
reinterpret_cast<OSVERSIONINFO*
>(&m_info);
74 ::ZeroMemory(&m_info,
sizeof(OSVERSIONINFOEX));
75 m_info.dwOSVersionInfoSize =
sizeof(OSVERSIONINFOEX);
76 if ( ! ::GetVersionEx(P) )
78 ::ZeroMemory(&m_info,
sizeof(OSVERSIONINFOEX));
79 m_info.dwOSVersionInfoSize =
sizeof(OSVERSIONINFO);
82 m_boIsWow64 = m_IsWow64();
101 return m_GetOsVersion();
118 return m_info.dwMinorVersion;
131 return m_info.dwMajorVersion;
151 return m_info.szCSDVersion;
160 return MAKELONG(m_info.wServicePackMinor, m_info.wServicePackMajor);
169 return m_info.dwBuildNumber;
179 if ( m_GetOsVersion() ==
WIN98 )
181 return (m_info.szCSDVersion[0] ==
'A' && m_info.szCSDVersion[1] == 0);
195 return _T(
"Windows 98SE");
197 switch ( m_GetOsVersion() )
199 case WINNT351:
return _T(
"Windows NT 3.51");
200 case WIN95:
return _T(
"Windows 95");
201 case WIN98:
return _T(
"Windows 98");
202 case WINME:
return _T(
"Windows ME");
203 case WINNT4:
return _T(
"Windows NT 4.0");
204 case WIN2000:
return _T(
"Windows 2000");
205 case WINXP:
return _T(
"Windows XP");
206 case WINVISTA:
return _T(
"Windows Vista");
207 case WIN7:
return _T(
"Windows 7");
208 case WINXP64:
return _T(
"Windows XP64");
210 case WIN7_64:
return _T(
"Windows 7 64");
217 OSVERSIONINFOEX m_info;
249 bool m_IsWow64(
void)
const
251 typedef BOOL (WINAPI *P_ISWOW64PROCESS)(HANDLE, PBOOL);
252 P_ISWOW64PROCESS pIsWow64Process
253 =
reinterpret_cast<P_ISWOW64PROCESS
>(::GetProcAddress(::GetModuleHandleA(
"kernel32"),
"IsWow64Process"));
254 BOOL bIsWow64 = FALSE;
255 if ( NULL != pIsWow64Process )
257 VERIFY( pIsWow64Process(::GetCurrentProcess(), &bIsWow64) );
EPlatformType GetPlatform(void) const
[取得] プラットフォーム
DWORD GetMajorVersion(void) const
[取得] メジャーバージョン取得.
DWORD GetMinorVersion(void) const
[取得] マイナーバージョン取得.
DWORD GetServicePackVersion(void) const
[取得] サービスパックバージョン
@ WIN9x_BASE
Windows 9xベース
@ WINNT_BASE
Windows NT ベース
EOsVersion GetOsVersion(void) const
[取得] OSバージョン取得
LPCTSTR GetOsVersionString(void) const
[取得] OSバージョン文字列取得.
bool IsWindows98SE(void) const
[確認] Windows98 SE チェック
LPCTSTR GetAdditionalString(void) const
[取得] 追加文字列.
@ WINVISTA_64
Windows Vista (64bit)
@ WINNT351
Windows NT 3.51
@ WIN7_64
Windows 7 (64bit)
@ WINXP64
Windows XP (64bit)
CWindowsVersion(void)
コンストラクタ.
bool IsWow64(void) const
[確認] 64bitチェック
DWORD GetBuildNumber(void) const
[取得] ビルドナンバー