diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-09-27 12:14:56 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-09-27 12:14:56 +0400 |
commit | 658b4ff8fd6654aac15f84a93954f974de984b33 (patch) | |
tree | 7cef68f27269348dfd3e260e02cb7c6c02cdcd2f | |
parent | 341d29542235fd18b184b5bffb02d06e3b1e0fab (diff) |
* wincap.cc (wincapc::init): Allow requesting server info for NT4 SP6.
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/wincap.cc | 17 |
2 files changed, 17 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6f09fbd08..d2924ade9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2003-09-27 Corinna Vinschen <corinna@vinschen.de> + + * wincap.cc (wincapc::init): Allow requesting server info for NT4 SP6. + 2003-09-27 Christopher Faylor <cgf@redhat.com> * path.cc (symlink_info::check): Use new introducer for mknod'ed files. diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc index 0f69abee9..a56f0a159 100644 --- a/winsup/cygwin/wincap.cc +++ b/winsup/cygwin/wincap.cc @@ -533,13 +533,15 @@ void wincapc::init () { const char *os; + bool has_osversioninfoex = false; if (caps) return; // already initialized memset (&version, 0, sizeof version); + /* Request simple version info first. */ version.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - GetVersionEx (reinterpret_cast<LPOSVERSIONINFO> (&version)); + GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version)); switch (version.dwPlatformId) { @@ -555,10 +557,15 @@ wincapc::init () if (strcmp (version.szCSDVersion, "Service Pack 4") < 0) caps = &wincap_nt4; else - caps = &wincap_nt4sp4; + { + caps = &wincap_nt4sp4; + if (strcmp (version.szCSDVersion, "Service Pack 6") >= 0) + has_osversioninfoex = true; + } break; case 5: os = "NT"; + has_osversioninfoex = true; switch (version.dwMinorVersion) { case 0: @@ -612,9 +619,11 @@ wincapc::init () break; } - if (((wincaps *)this->caps)->is_winnt && version.dwMajorVersion > 4) + if (has_osversioninfoex) { - version.dwOSVersionInfoSize = sizeof version; + /* Request extended version to get server info. + Available since NT4 SP6. */ + version.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX); GetVersionEx (reinterpret_cast<LPOSVERSIONINFO>(&version)); if (version.wProductType != VER_NT_WORKSTATION) ((wincaps *)this->caps)->is_server = true; |