File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,11 @@ static const char *get_os_version_name(OSVERSIONINFOEX *ver)
43
43
{
44
44
DWORD major = ver->dwMajorVersion ;
45
45
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
+ }
47
51
if (major == 6 && minor == 3 )
48
52
{
49
53
return (ver->wProductType == VER_NT_WORKSTATION)?
@@ -102,7 +106,12 @@ static int uname(struct utsname *buf)
102
106
if (version_str && version_str[0 ])
103
107
sprintf (buf->version , " %s %s" ,version_str, ver.szCSDVersion );
104
108
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
+ }
106
115
107
116
#ifdef _WIN64
108
117
strcpy (buf->machine , " x64" );
You can’t perform that action at this time.
0 commit comments