https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=63f19278b998b8145269662cc5a256020f6530bd

commit 63f19278b998b8145269662cc5a256020f6530bd
Author: Corinna Vinschen <cori...@vinschen.de>
Date:   Mon Apr 24 17:12:16 2017 +0200

    cygwin: wincap: fix evaluation of build number
    
    RtlGetNtVersionNumbers returns the build number with some upper bits
    set for no apparent reason.  The fact that RtlGetNtVersionNumbers is
    undocumented doesn't exactly help.
    
    Just filter out the upper WORD for now.  If build numbers are in
    danger to become 6 digit numbers, re-evaluate.

Diff:
---
 winsup/cygwin/wincap.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index cb52aad..c8799f3 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -118,6 +118,7 @@ wincapc::init ()
   RtlGetNtVersionNumbers (&version.dwMajorVersion,
                          &version.dwMinorVersion,
                          &version.dwBuildNumber);
+  version.dwBuildNumber &= 0xffff;
 
   switch (version.dwMajorVersion)
     {

Reply via email to