Skip to content

Commit 0e76054

Browse files
committed
Feedback plugin : add support for Windows 10 / Server 2016.
Also add fallback version string for unknown future versions.
1 parent b38d3c3 commit 0e76054

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

plugin/feedback/utils.cc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ static const char *get_os_version_name(OSVERSIONINFOEX *ver)
4343
{
4444
DWORD major = ver->dwMajorVersion;
4545
DWORD minor = ver->dwMinorVersion;
46-
46+
if (major == 10 && minor == 0)
47+
{
48+
return (ver->wProductType == VER_NT_WORKSTATION) ?
49+
"Windows 10" : "Windows Server 2016";
50+
}
4751
if (major == 6 && minor == 3)
4852
{
4953
return (ver->wProductType == VER_NT_WORKSTATION)?
@@ -102,7 +106,12 @@ static int uname(struct utsname *buf)
102106
if(version_str && version_str[0])
103107
sprintf(buf->version, "%s %s",version_str, ver.szCSDVersion);
104108
else
105-
sprintf(buf->version, "%s", ver.szCSDVersion);
109+
{
110+
/* Fallback for unknown versions, e.g "Windows <major_ver>.<minor_ver>" */
111+
sprintf(buf->version, "Windows %d.%d%s",
112+
ver.dwMajorVersion, ver.dwMinorVersion,
113+
(ver.wProductType == VER_NT_WORKSTATION ? "" : " Server"));
114+
}
106115

107116
#ifdef _WIN64
108117
strcpy(buf->machine, "x64");

0 commit comments

Comments
 (0)