VirtualBox

source: vbox/trunk/src/VBox/Runtime/r3/win/RTSystemQueryOSInfo-win.cpp@ 47020

Last change on this file since 47020 was 47011, checked in by vboxsync, 12 years ago

IPRT/RTSystemQueryOSInfo-win.cpp: Must be sizeof(OSVERSIONINFOEX).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.2 KB
Line 
1/* $Id: RTSystemQueryOSInfo-win.cpp 47011 2013-07-05 15:34:09Z vboxsync $ */
2/** @file
3 * IPRT - RTSystemQueryOSInfo, generic stub.
4 */
5
6/*
7 * Copyright (C) 2008-2011 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27/*******************************************************************************
28* Header Files *
29*******************************************************************************/
30#include <Windows.h>
31#include <WinUser.h>
32
33#include <iprt/system.h>
34#include <iprt/assert.h>
35#include <iprt/string.h>
36#include <iprt/ctype.h>
37
38
39/*******************************************************************************
40* Structures and Typedefs *
41*******************************************************************************/
42/**
43 * Windows OS type as determined by rtSystemWinOSType().
44 */
45typedef enum RTWINOSTYPE
46{
47 kRTWinOSType_UNKNOWN = 0,
48 kRTWinOSType_9XFIRST = 1,
49 kRTWinOSType_95 = kRTWinOSType_9XFIRST,
50 kRTWinOSType_95SP1,
51 kRTWinOSType_95OSR2,
52 kRTWinOSType_98,
53 kRTWinOSType_98SP1,
54 kRTWinOSType_98SE,
55 kRTWinOSType_ME,
56 kRTWinOSType_9XLAST = 99,
57 kRTWinOSType_NTFIRST = 100,
58 kRTWinOSType_NT31 = kRTWinOSType_NTFIRST,
59 kRTWinOSType_NT351,
60 kRTWinOSType_NT4,
61 kRTWinOSType_2K,
62 kRTWinOSType_XP,
63 kRTWinOSType_2003,
64 kRTWinOSType_VISTA,
65 kRTWinOSType_2008,
66 kRTWinOSType_7,
67 kRTWinOSType_8,
68 kRTWinOSType_81,
69 kRTWinOSType_NT_UNKNOWN = 199,
70 kRTWinOSType_NT_LAST = kRTWinOSType_UNKNOWN
71} RTWINOSTYPE;
72
73/**
74 * These are the PRODUCT_* defines found in the Vista Platform SDK and returned
75 * by GetProductInfo().
76 *
77 * We define them ourselves because we don't necessarily have any Vista PSDK around.
78 */
79typedef enum RTWINPRODTYPE
80{
81 kRTWinProdType_UNDEFINED = 0x00000000, ///< An unknown product
82 kRTWinProdType_BUSINESS = 0x00000006, ///< Business Edition
83 kRTWinProdType_BUSINESS_N = 0x00000010, ///< Business Edition
84 kRTWinProdType_CLUSTER_SERVER = 0x00000012, ///< Cluster Server Edition
85 kRTWinProdType_DATACENTER_SERVER = 0x00000008, ///< Server Datacenter Edition (full installation)
86 kRTWinProdType_DATACENTER_SERVER_CORE = 0x0000000C, ///< Server Datacenter Edition (core installation)
87 kRTWinProdType_ENTERPRISE = 0x00000004, ///< Enterprise Edition
88 kRTWinProdType_ENTERPRISE_N = 0x0000001B, ///< Enterprise Edition
89 kRTWinProdType_ENTERPRISE_SERVER = 0x0000000A, ///< Server Enterprise Edition (full installation)
90 kRTWinProdType_ENTERPRISE_SERVER_CORE = 0x0000000E, ///< Server Enterprise Edition (core installation)
91 kRTWinProdType_ENTERPRISE_SERVER_IA64 = 0x0000000F, ///< Server Enterprise Edition for Itanium-based Systems
92 kRTWinProdType_HOME_BASIC = 0x00000002, ///< Home Basic Edition
93 kRTWinProdType_HOME_BASIC_N = 0x00000005, ///< Home Basic Edition
94 kRTWinProdType_HOME_PREMIUM = 0x00000003, ///< Home Premium Edition
95 kRTWinProdType_HOME_PREMIUM_N = 0x0000001A, ///< Home Premium Edition
96 kRTWinProdType_HOME_SERVER = 0x00000013, ///< Home Server Edition
97 kRTWinProdType_SERVER_FOR_SMALLBUSINESS = 0x00000018, ///< Server for Small Business Edition
98 kRTWinProdType_SMALLBUSINESS_SERVER = 0x00000009, ///< Small Business Server
99 kRTWinProdType_SMALLBUSINESS_SERVER_PREMIUM = 0x00000019, ///< Small Business Server Premium Edition
100 kRTWinProdType_STANDARD_SERVER = 0x00000007, ///< Server Standard Edition (full installation)
101 kRTWinProdType_STANDARD_SERVER_CORE = 0x0000000D, ///< Server Standard Edition (core installation)
102 kRTWinProdType_STARTER = 0x0000000B, ///< Starter Edition
103 kRTWinProdType_STORAGE_ENTERPRISE_SERVER = 0x00000017, ///< Storage Server Enterprise Edition
104 kRTWinProdType_STORAGE_EXPRESS_SERVER = 0x00000014, ///< Storage Server Express Edition
105 kRTWinProdType_STORAGE_STANDARD_SERVER = 0x00000015, ///< Storage Server Standard Edition
106 kRTWinProdType_STORAGE_WORKGROUP_SERVER = 0x00000016, ///< Storage Server Workgroup Edition
107 kRTWinProdType_ULTIMATE = 0x00000001, ///< Ultimate Edition
108 kRTWinProdType_ULTIMATE_N = 0x0000001C, ///< Ultimate Edition
109 kRTWinProdType_WEB_SERVER = 0x00000011, ///< Web Server Edition (full)
110 kRTWinProdType_WEB_SERVER_CORE = 0x0000001D ///< Web Server Edition (core)
111} RTWINPRODTYPE;
112
113
114/**
115 * Translates OSVERSIONINOFEX into a Windows OS type.
116 *
117 * @returns The Windows OS type.
118 * @param pOSInfoEx The OS info returned by Windows.
119 *
120 * @remarks This table has been assembled from Usenet postings, personal
121 * observations, and reading other people's code. Please feel
122 * free to add to it or correct it.
123 * <pre>
124 dwPlatFormID dwMajorVersion dwMinorVersion dwBuildNumber
12595 1 4 0 950
12695 SP1 1 4 0 >950 && <=1080
12795 OSR2 1 4 <10 >1080
12898 1 4 10 1998
12998 SP1 1 4 10 >1998 && <2183
13098 SE 1 4 10 >=2183
131ME 1 4 90 3000
132
133NT 3.51 2 3 51 1057
134NT 4 2 4 0 1381
1352000 2 5 0 2195
136XP 2 5 1 2600
1372003 2 5 2 3790
138Vista 2 6 0
139
140CE 1.0 3 1 0
141CE 2.0 3 2 0
142CE 2.1 3 2 1
143CE 3.0 3 3 0
144</pre>
145 */
146static RTWINOSTYPE rtSystemWinOSType(OSVERSIONINFOEX const *pOSInfoEx)
147{
148 RTWINOSTYPE enmVer = kRTWinOSType_UNKNOWN;
149 BYTE const bProductType = pOSInfoEx->wProductType;
150 DWORD const dwPlatformId = pOSInfoEx->dwPlatformId;
151 DWORD const dwMinorVersion = pOSInfoEx->dwMinorVersion;
152 DWORD const dwMajorVersion = pOSInfoEx->dwMajorVersion;
153 DWORD const dwBuildNumber = pOSInfoEx->dwBuildNumber & 0xFFFF; /* Win 9x needs this. */
154
155 if ( dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
156 && dwMajorVersion == 4)
157 {
158 if ( dwMinorVersion < 10
159 && dwBuildNumber == 950)
160 enmVer = kRTWinOSType_95;
161 else if ( dwMinorVersion < 10
162 && dwBuildNumber > 950
163 && dwBuildNumber <= 1080)
164 enmVer = kRTWinOSType_95SP1;
165 else if ( dwMinorVersion < 10
166 && dwBuildNumber > 1080)
167 enmVer = kRTWinOSType_95OSR2;
168 else if ( dwMinorVersion == 10
169 && dwBuildNumber == 1998)
170 enmVer = kRTWinOSType_98;
171 else if ( dwMinorVersion == 10
172 && dwBuildNumber > 1998
173 && dwBuildNumber < 2183)
174 enmVer = kRTWinOSType_98SP1;
175 else if ( dwMinorVersion == 10
176 && dwBuildNumber >= 2183)
177 enmVer = kRTWinOSType_98SE;
178 else if (dwMinorVersion == 90)
179 enmVer = kRTWinOSType_ME;
180 }
181 else if (dwPlatformId == VER_PLATFORM_WIN32_NT)
182 {
183 if ( dwMajorVersion == 3
184 && dwMinorVersion == 51)
185 enmVer = kRTWinOSType_NT351;
186 else if ( dwMajorVersion == 4
187 && dwMinorVersion == 0)
188 enmVer = kRTWinOSType_NT4;
189 else if ( dwMajorVersion == 5
190 && dwMinorVersion == 0)
191 enmVer = kRTWinOSType_2K;
192 else if ( dwMajorVersion == 5
193 && dwMinorVersion == 1)
194 enmVer = kRTWinOSType_XP;
195 else if ( dwMajorVersion == 5
196 && dwMinorVersion == 2)
197 enmVer = kRTWinOSType_2003;
198 else if ( dwMajorVersion == 6
199 && dwMinorVersion == 0)
200 {
201 if (bProductType != VER_NT_WORKSTATION)
202 enmVer = kRTWinOSType_2008;
203 else
204 enmVer = kRTWinOSType_VISTA;
205 }
206 else if ( dwMajorVersion == 6
207 && dwMinorVersion == 1)
208 enmVer = kRTWinOSType_7;
209 else if ( dwMajorVersion == 6
210 && dwMinorVersion == 2)
211 enmVer = kRTWinOSType_8;
212 else if ( dwMajorVersion == 6
213 && dwMinorVersion == 3)
214 enmVer = kRTWinOSType_81;
215 else
216 enmVer = kRTWinOSType_NT_UNKNOWN;
217 }
218
219 return enmVer;
220}
221
222
223/**
224 * Wrapper around the GetProductInfo API.
225 *
226 * @returns The vista type.
227 */
228static RTWINPRODTYPE rtSystemWinGetProductInfo(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dwSpMajorVersion, DWORD dwSpMinorVersion)
229{
230 BOOL (WINAPI *pfnGetProductInfo)(DWORD, DWORD, DWORD, DWORD, PDWORD);
231 pfnGetProductInfo = (BOOL (WINAPI *)(DWORD, DWORD, DWORD, DWORD, PDWORD))GetProcAddress(GetModuleHandle("kernel32.dll"), "GetProductInfo");
232 if (pfnGetProductInfo)
233 {
234 DWORD dwProductType = kRTWinProdType_UNDEFINED;
235 if (pfnGetProductInfo(dwOSMajorVersion, dwOSMinorVersion, dwSpMajorVersion, dwSpMinorVersion, &dwProductType))
236 return (RTWINPRODTYPE)dwProductType;
237 }
238 return kRTWinProdType_UNDEFINED;
239}
240
241
242
243/**
244 * Appends the product type if available.
245 *
246 * @param pszTmp The buffer. Assumes it's big enough.
247 */
248static void rtSystemWinAppendProductType(char *pszTmp)
249{
250 RTWINPRODTYPE enmVistaType = rtSystemWinGetProductInfo(6, 0, 0, 0);
251 switch (enmVistaType)
252 {
253 case kRTWinProdType_BUSINESS: strcat(pszTmp, " Business Edition"); break;
254 case kRTWinProdType_BUSINESS_N: strcat(pszTmp, " Business Edition"); break;
255 case kRTWinProdType_CLUSTER_SERVER: strcat(pszTmp, " Cluster Server Edition"); break;
256 case kRTWinProdType_DATACENTER_SERVER: strcat(pszTmp, " Server Datacenter Edition (full installation)"); break;
257 case kRTWinProdType_DATACENTER_SERVER_CORE: strcat(pszTmp, " Server Datacenter Edition (core installation)"); break;
258 case kRTWinProdType_ENTERPRISE: strcat(pszTmp, " Enterprise Edition"); break;
259 case kRTWinProdType_ENTERPRISE_N: strcat(pszTmp, " Enterprise Edition"); break;
260 case kRTWinProdType_ENTERPRISE_SERVER: strcat(pszTmp, " Server Enterprise Edition (full installation)"); break;
261 case kRTWinProdType_ENTERPRISE_SERVER_CORE: strcat(pszTmp, " Server Enterprise Edition (core installation)"); break;
262 case kRTWinProdType_ENTERPRISE_SERVER_IA64: strcat(pszTmp, " Server Enterprise Edition for Itanium-based Systems"); break;
263 case kRTWinProdType_HOME_BASIC: strcat(pszTmp, " Home Basic Edition"); break;
264 case kRTWinProdType_HOME_BASIC_N: strcat(pszTmp, " Home Basic Edition"); break;
265 case kRTWinProdType_HOME_PREMIUM: strcat(pszTmp, " Home Premium Edition"); break;
266 case kRTWinProdType_HOME_PREMIUM_N: strcat(pszTmp, " Home Premium Edition"); break;
267 case kRTWinProdType_HOME_SERVER: strcat(pszTmp, " Home Server Edition"); break;
268 case kRTWinProdType_SERVER_FOR_SMALLBUSINESS: strcat(pszTmp, " Server for Small Business Edition"); break;
269 case kRTWinProdType_SMALLBUSINESS_SERVER: strcat(pszTmp, " Small Business Server"); break;
270 case kRTWinProdType_SMALLBUSINESS_SERVER_PREMIUM: strcat(pszTmp, " Small Business Server Premium Edition"); break;
271 case kRTWinProdType_STANDARD_SERVER: strcat(pszTmp, " Server Standard Edition (full installation)"); break;
272 case kRTWinProdType_STANDARD_SERVER_CORE: strcat(pszTmp, " Server Standard Edition (core installation)"); break;
273 case kRTWinProdType_STARTER: strcat(pszTmp, " Starter Edition"); break;
274 case kRTWinProdType_STORAGE_ENTERPRISE_SERVER: strcat(pszTmp, " Storage Server Enterprise Edition"); break;
275 case kRTWinProdType_STORAGE_EXPRESS_SERVER: strcat(pszTmp, " Storage Server Express Edition"); break;
276 case kRTWinProdType_STORAGE_STANDARD_SERVER: strcat(pszTmp, " Storage Server Standard Edition"); break;
277 case kRTWinProdType_STORAGE_WORKGROUP_SERVER: strcat(pszTmp, " Storage Server Workgroup Edition"); break;
278 case kRTWinProdType_ULTIMATE: strcat(pszTmp, " Ultimate Edition"); break;
279 case kRTWinProdType_ULTIMATE_N: strcat(pszTmp, " Ultimate Edition"); break;
280 case kRTWinProdType_WEB_SERVER: strcat(pszTmp, " Web Server Edition (full installation)"); break;
281 case kRTWinProdType_WEB_SERVER_CORE: strcat(pszTmp, " Web Server Edition (core installation)"); break;
282 case kRTWinProdType_UNDEFINED: break;
283 }
284}
285
286
287/**
288 * Services the RTSYSOSINFO_PRODUCT, RTSYSOSINFO_RELEASE
289 * and RTSYSOSINFO_SERVICE_PACK requests.
290 *
291 * @returns See RTSystemQueryOSInfo.
292 * @param enmInfo See RTSystemQueryOSInfo.
293 * @param pszInfo See RTSystemQueryOSInfo.
294 * @param cchInfo See RTSystemQueryOSInfo.
295 */
296static int rtSystemWinQueryOSVersion(RTSYSOSINFO enmInfo, char *pszInfo, size_t cchInfo)
297{
298 int rc;
299
300 /*
301 * Make sure it's terminated correctly in case of error.
302 */
303 *pszInfo = '\0';
304
305 /*
306 * Query the Windows version.
307 *
308 * ASSUMES OSVERSIONINFOEX starts with the exact same layout as OSVERSIONINFO (safe).
309 */
310 OSVERSIONINFOEX OSInfoEx;
311 RT_ZERO(OSInfoEx);
312 OSInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
313 if (!GetVersionEx((LPOSVERSIONINFO) &OSInfoEx))
314 {
315 DWORD err = GetLastError();
316 rc = RTErrConvertFromWin32(err);
317 AssertMsgFailedReturn(("err=%d\n", err), rc == VERR_BUFFER_OVERFLOW ? VERR_INTERNAL_ERROR : rc);
318 }
319
320 /* Get extended version info for 2000 and later. */
321 if ( OSInfoEx.dwPlatformId == VER_PLATFORM_WIN32_NT
322 && OSInfoEx.dwMajorVersion >= 5)
323 {
324 RT_ZERO(OSInfoEx);
325 OSInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
326 if (!GetVersionEx((LPOSVERSIONINFO) &OSInfoEx))
327 {
328 DWORD err = GetLastError();
329 rc = RTErrConvertFromWin32(err);
330 AssertMsgFailedReturn(("err=%d\n", err), rc == VERR_BUFFER_OVERFLOW ? VERR_INTERNAL_ERROR : rc);
331 }
332 }
333
334 /*
335 * Service the request.
336 */
337 char szTmp[512];
338 szTmp[0] = '\0';
339 rc = VINF_SUCCESS;
340 switch (enmInfo)
341 {
342 /*
343 * The product name.
344 */
345 case RTSYSOSINFO_PRODUCT:
346 {
347 RTWINOSTYPE enmVer = rtSystemWinOSType(&OSInfoEx);
348 switch (enmVer)
349 {
350 case kRTWinOSType_95: strcpy(szTmp, "Windows 95"); break;
351 case kRTWinOSType_95SP1: strcpy(szTmp, "Windows 95 (Service Pack 1)"); break;
352 case kRTWinOSType_95OSR2: strcpy(szTmp, "Windows 95 (OSR 2)"); break;
353 case kRTWinOSType_98: strcpy(szTmp, "Windows 98"); break;
354 case kRTWinOSType_98SP1: strcpy(szTmp, "Windows 98 (Service Pack 1)"); break;
355 case kRTWinOSType_98SE: strcpy(szTmp, "Windows 98 (Second Edition)"); break;
356 case kRTWinOSType_ME: strcpy(szTmp, "Windows Me"); break;
357 case kRTWinOSType_NT351: strcpy(szTmp, "Windows NT 3.51"); break;
358 case kRTWinOSType_NT4: strcpy(szTmp, "Windows NT 4.0"); break;
359 case kRTWinOSType_2K: strcpy(szTmp, "Windows 2000"); break;
360 case kRTWinOSType_XP:
361 strcpy(szTmp, "Windows XP");
362 if (OSInfoEx.wSuiteMask & VER_SUITE_PERSONAL)
363 strcat(szTmp, " Home");
364 if ( OSInfoEx.wProductType == VER_NT_WORKSTATION
365 && !(OSInfoEx.wSuiteMask & VER_SUITE_PERSONAL))
366 strcat(szTmp, " Professional");
367#if 0 /** @todo fixme */
368 if (GetSystemMetrics(SM_MEDIACENTER))
369 strcat(szTmp, " Media Center");
370#endif
371 break;
372
373 case kRTWinOSType_2003: strcpy(szTmp, "Windows 2003"); break;
374 case kRTWinOSType_VISTA:
375 {
376 strcpy(szTmp, "Windows Vista");
377 rtSystemWinAppendProductType(szTmp);
378 break;
379 }
380 case kRTWinOSType_2008: strcpy(szTmp, "Windows 2008"); break;
381 case kRTWinOSType_7: strcpy(szTmp, "Windows 7"); break;
382 case kRTWinOSType_8: strcpy(szTmp, "Windows 8"); break;
383 case kRTWinOSType_81: strcpy(szTmp, "Windows 8.1"); break;
384
385 case kRTWinOSType_NT_UNKNOWN:
386 RTStrPrintf(szTmp, sizeof(szTmp), "Unknown NT v%u.%u", OSInfoEx.dwMajorVersion, OSInfoEx.dwMinorVersion);
387 break;
388
389 default:
390 AssertFailed();
391 case kRTWinOSType_UNKNOWN:
392 RTStrPrintf(szTmp, sizeof(szTmp), "Unknown %d v%u.%u", OSInfoEx.dwPlatformId, OSInfoEx.dwMajorVersion, OSInfoEx.dwMinorVersion);
393 break;
394 }
395 break;
396 }
397
398 /*
399 * The release.
400 */
401 case RTSYSOSINFO_RELEASE:
402 {
403 RTWINOSTYPE enmVer = rtSystemWinOSType(&OSInfoEx);
404 RTStrPrintf(szTmp, sizeof(szTmp), "%u.%u.%u", OSInfoEx.dwMajorVersion, OSInfoEx.dwMinorVersion, OSInfoEx.dwBuildNumber);
405 break;
406 }
407
408
409 /*
410 * Get the service pack.
411 */
412 case RTSYSOSINFO_SERVICE_PACK:
413 {
414 if (OSInfoEx.wServicePackMajor)
415 {
416 if (OSInfoEx.wServicePackMinor)
417 RTStrPrintf(szTmp, sizeof(szTmp), "%u.%u", (unsigned)OSInfoEx.wServicePackMajor, (unsigned)OSInfoEx.wServicePackMinor);
418 else
419 RTStrPrintf(szTmp, sizeof(szTmp), "%u", (unsigned)OSInfoEx.wServicePackMajor);
420 }
421 else if (OSInfoEx.szCSDVersion[0])
422 {
423 /* just copy the entire string. */
424 memcpy(szTmp, OSInfoEx.szCSDVersion, sizeof(OSInfoEx.szCSDVersion));
425 szTmp[sizeof(OSInfoEx.szCSDVersion)] = '\0';
426 AssertCompile(sizeof(szTmp) > sizeof(OSInfoEx.szCSDVersion));
427 }
428 else
429 {
430 RTWINOSTYPE enmVer = rtSystemWinOSType(&OSInfoEx);
431 switch (enmVer)
432 {
433 case kRTWinOSType_95SP1: strcpy(szTmp, "1"); break;
434 case kRTWinOSType_98SP1: strcpy(szTmp, "1"); break;
435 default:
436 break;
437 }
438 }
439 break;
440 }
441
442 default:
443 AssertFatalFailed();
444 }
445
446 /*
447 * Copy the result to the return buffer.
448 */
449 size_t cchTmp = strlen(szTmp);
450 Assert(cchTmp < sizeof(szTmp));
451 if (cchTmp < cchInfo)
452 memcpy(pszInfo, szTmp, cchTmp + 1);
453 else
454 {
455 memcpy(pszInfo, szTmp, cchInfo - 1);
456 pszInfo[cchInfo - 1] = '\0';
457 if (RT_SUCCESS(rc))
458 rc = VERR_BUFFER_OVERFLOW;
459 }
460 return VINF_SUCCESS;
461}
462
463
464
465RTDECL(int) RTSystemQueryOSInfo(RTSYSOSINFO enmInfo, char *pszInfo, size_t cchInfo)
466{
467 /*
468 * Quick validation.
469 */
470 AssertReturn(enmInfo > RTSYSOSINFO_INVALID && enmInfo < RTSYSOSINFO_END, VERR_INVALID_PARAMETER);
471 AssertPtrReturn(pszInfo, VERR_INVALID_POINTER);
472 if (!cchInfo)
473 return VERR_BUFFER_OVERFLOW;
474
475
476 /*
477 * Handle the request.
478 */
479 switch (enmInfo)
480 {
481 case RTSYSOSINFO_PRODUCT:
482 case RTSYSOSINFO_RELEASE:
483 case RTSYSOSINFO_SERVICE_PACK:
484 return rtSystemWinQueryOSVersion(enmInfo, pszInfo, cchInfo);
485
486 case RTSYSOSINFO_VERSION:
487 default:
488 *pszInfo = '\0';
489 }
490
491 return VERR_NOT_SUPPORTED;
492}
493
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette