aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/os_version_info.c
diff options
context:
space:
mode:
authorGraham Bloice <graham.bloice@trihedral.com>2018-06-27 00:37:13 +0100
committerAnders Broman <a.broman58@gmail.com>2018-06-27 03:17:35 +0000
commitbd3188b072bfc765cca5eec7a7a22fb14718f0a8 (patch)
treec91cc21049d71915c75c0ec1a506774171e9d6ff /wsutil/os_version_info.c
parent1f5c42050858e06f982d632a01fee7d8a2fb56da (diff)
Add Windows 10 Release ID to About info
Adds the Windows 10 (and Server 2016) Release ID to the info in the About Wireshark blurb. The ID displayed in parentheses, e.g. Running on 64-bit Windows 10 (1803), build 17134 Change-Id: I1bbce27e149dbf6da6da7847ad1f7dd861176ece Reviewed-on: https://code.wireshark.org/review/28475 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wsutil/os_version_info.c')
-rw-r--r--wsutil/os_version_info.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/wsutil/os_version_info.c b/wsutil/os_version_info.c
index 0f8ac7f1e0..1cfb811b90 100644
--- a/wsutil/os_version_info.c
+++ b/wsutil/os_version_info.c
@@ -184,6 +184,7 @@ typedef LONG (WINAPI * RtlGetVersionProc) (OSVERSIONINFOEX *);
#ifndef STATUS_SUCCESS
#define STATUS_SUCCESS 0
#endif
+#include <stdlib.h>
#endif // _WIN32
/*
@@ -350,6 +351,8 @@ get_os_version_info(GString *str)
case 10: {
gboolean is_nt_workstation;
+ TCHAR ReleaseId[10];
+ DWORD ridSize = _countof(ReleaseId);
if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
g_string_append(str, "64-bit ");
@@ -359,6 +362,10 @@ get_os_version_info(GString *str)
switch (win_version_info.dwMinorVersion) {
case 0:
g_string_append_printf(str, is_nt_workstation ? "Windows 10" : "Windows Server 2016");
+ if (RegGetValue(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
+ L"ReleaseId", RRF_RT_REG_SZ, NULL, &ReleaseId, &ridSize) == ERROR_SUCCESS) {
+ g_string_append_printf(str, " (%s)", utf_16to8(ReleaseId));
+ }
break;
default:
g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",