MCPcopy Create free account
hub / github.com/LegacyUpdate/LegacyUpdate / GetOSVersionInfo

Method GetOSVersionInfo

LegacyUpdate/LegacyUpdateCtrl.cpp:290–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288}
289
290STDMETHODIMP CLegacyUpdateCtrl::GetOSVersionInfo(OSVersionField osField, LONG systemMetric, VARIANT *retval) {
291 DoIsPermittedCheck();
292
293 if (retval == NULL) {
294 return E_POINTER;
295 }
296
297 VariantInit(retval);
298 OSVERSIONINFOEX *versionInfo = GetVersionInfo();
299
300 switch (osField) {
301 case e_majorVer:
302 retval->vt = VT_UI4;
303 retval->ulVal = versionInfo->dwMajorVersion;
304 break;
305
306 case e_minorVer:
307 retval->vt = VT_UI4;
308 retval->ulVal = versionInfo->dwMinorVersion;
309 break;
310
311 case e_buildNumber:
312 retval->vt = VT_UI4;
313 retval->ulVal = versionInfo->dwBuildNumber;
314 break;
315
316 case e_platform:
317 retval->vt = VT_UI4;
318 retval->ulVal = versionInfo->dwPlatformId;
319 break;
320
321 case e_SPMajor:
322 retval->vt = VT_I4;
323 retval->lVal = versionInfo->wServicePackMajor;
324 break;
325
326 case e_SPMinor:
327 retval->vt = VT_I4;
328 retval->lVal = versionInfo->wServicePackMinor;
329 break;
330
331 case e_productSuite:
332 retval->vt = VT_I4;
333 retval->lVal = versionInfo->wSuiteMask;
334 break;
335
336 case e_productType:
337 retval->vt = VT_I4;
338 retval->lVal = versionInfo->wProductType;
339 break;
340
341 case e_systemMetric:
342 retval->vt = VT_I4;
343 retval->lVal = GetSystemMetrics(systemMetric);
344 break;
345
346 case e_SPVersionString: {
347 LPWSTR data = NULL;

Callers

nothing calls this directly

Calls 3

GetRegistryStringFunction · 0.85
GetVistaProductInfoFunction · 0.85
GetOSProductNameFunction · 0.85

Tested by

no test coverage detected