summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ntdll.h1
-rw-r--r--winsup/cygwin/wincap.cc5
2 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index 5cc7c46f7..2792112b5 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -1452,6 +1452,7 @@ extern "C"
PACL *, PBOOLEAN);
NTSTATUS NTAPI RtlGetGroupSecurityDescriptor (PSECURITY_DESCRIPTOR, PSID *,
PBOOLEAN);
+ NTSTATUS NTAPI RtlGetNtVersionNumbers (LPDWORD, LPDWORD, LPDWORD);
NTSTATUS NTAPI RtlGetOwnerSecurityDescriptor (PSECURITY_DESCRIPTOR, PSID *,
PBOOLEAN);
NTSTATUS NTAPI RtlGetVersion (PRTL_OSVERSIONINFOEXW);
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index c7c9f2e37..313d7f986 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -276,6 +276,11 @@ wincapc::init ()
GetSystemInfo (&system_info);
version.dwOSVersionInfoSize = sizeof (RTL_OSVERSIONINFOEXW);
RtlGetVersion (&version);
+ /* Overwrite unreliable kernel version with correct values returned by
+ RtlGetNtVersionNumbers. See git log of this change for a description. */
+ RtlGetNtVersionNumbers (&version.dwMajorVersion,
+ &version.dwMinorVersion,
+ &version.dwBuildNumber);
switch (version.dwMajorVersion)
{