]> sourceware.org Git - newlib-cygwin.git/commitdiff
* wincap.cc (wincapc::init): Allow requesting server info for NT4 SP6.
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 27 Sep 2003 08:14:56 +0000 (08:14 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 27 Sep 2003 08:14:56 +0000 (08:14 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/wincap.cc

index 6f09fbd08c94d922aee02bf27a8f335def9247f6..d2924ade91314b5c9bf956150ec9b2e906de6400 100644 (file)
@@ -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.
index 0f69abee96ff3e88d06bac3755a979f72ce15090..a56f0a159f6105c1ab9bfa2cbca992e1b0d11511 100644 (file)
@@ -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;
This page took 0.038486 seconds and 5 git commands to generate.