@@ -121,56 +121,6 @@ static BOOL IsWow64()
121
121
return bIsWow64;
122
122
}
123
123
124
- std::string platformid_sysinfo (OSVERSIONINFOEX &osinfo)
125
- {
126
- std::string result (" " );
127
- unsigned int version = osinfo.dwMajorVersion * 1000 + osinfo.dwMinorVersion ;
128
- switch (version) {
129
- case 5000 :
130
- result += " Windows 2000" ;
131
- break ;
132
- case 5001 :
133
- result += " Windows XP" ;
134
- break ;
135
- case 5002 :
136
- result += " Windows Server 2003" ;
137
- break ;
138
- case 6000 :
139
- result += (osinfo.wProductType == VER_NT_WORKSTATION ? " Windows Vista" : " Windows Server 2008" );
140
- break ;
141
- case 6001 :
142
- result += (osinfo.wProductType == VER_NT_WORKSTATION ? " Windows 7" : " Windows Server 2008 R2" );
143
- break ;
144
- case 6002 :
145
- result += (osinfo.wProductType == VER_NT_WORKSTATION ? " Windows 8" : " Windows Server 2012" );
146
- break ;
147
- case 6003 :
148
- // For applications that have been manifested for Windows 8.1.
149
- result += (osinfo.wProductType == VER_NT_WORKSTATION ? " Windows 8.1" : " Windows Server 2012 R2" );
150
- break ;
151
- default :
152
- result += " Unknown Windows" ;
153
- break ;
154
- }
155
-
156
- if (osinfo.wServicePackMajor > 0 ) {
157
- boost::format fmtServicePack;
158
- if (osinfo.wServicePackMinor == 0 ) {
159
- fmtServicePack = boost::format (" SP%d" );
160
- fmtServicePack % osinfo.wServicePackMajor ;
161
- } else {
162
- fmtServicePack = boost::format (" SP%d.%d" );
163
- fmtServicePack % osinfo.wServicePackMajor % osinfo.wServicePackMinor ;
164
- }
165
- result += fmtServicePack.str ();
166
- }
167
-
168
- boost::format fmt (" (v%d.%d.%d.%d)" );
169
- fmt % osinfo.dwMajorVersion % osinfo.dwMinorVersion % osinfo.wServicePackMajor % osinfo.wServicePackMinor ;
170
- result += fmt.str ();
171
- return result;
172
- }
173
-
174
124
std::string PlatformUtils::sysinfo (bool extended)
175
125
{
176
126
std::string result;
@@ -179,15 +129,15 @@ std::string PlatformUtils::sysinfo(bool extended)
179
129
osinfo.dwOSVersionInfoSize = sizeof (osinfo);
180
130
181
131
if (GetVersionExEx (&osinfo) == 0 ) {
182
- result += " Unknown Windows" ;
132
+ result += " Unknown Windows(TM) " ;
183
133
} else {
184
- if (osinfo. dwPlatformId == VER_PLATFORM_WIN32_NT) {
185
- result += platformid_sysinfo ( osinfo );
186
- } else {
187
- boost::format fmt ( " Unknown Windows (dwPlatformId = %d, dwMajorVersion = %d, dwMinorVersion = %d " );
188
- fmt % osinfo.dwPlatformId % osinfo. dwMajorVersion % osinfo. dwMinorVersion ;
189
- result += fmt. str () ;
190
- }
134
+ boost::format fmt ( " Windows(TM) %d.%d SP %d.%d " );
135
+ fmt % osinfo. dwMajorVersion % osinfo. dwMinorVersion
136
+ % osinfo. wServicePackMajor % osinfo. wServicePackMinor ;
137
+ result += fmt. str ( );
138
+ if ( osinfo.wProductType == VER_NT_WORKSTATION)
139
+ result += " NT_WORKSTATION " ;
140
+ result += " (MSDN 724833) " ;
191
141
}
192
142
193
143
SYSTEM_INFO systeminfo;
0 commit comments