Index: src/config/mingw/os_stubs_c.c
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/config/mingw/os_stubs_c.c,v
retrieving revision 1.13
diff -u -r1.13 os_stubs_c.c
--- src/config/mingw/os_stubs_c.c	9 Oct 2005 15:53:36 -0000	1.13
+++ src/config/mingw/os_stubs_c.c	11 Feb 2006 12:02:49 -0000
@@ -148,9 +148,15 @@
 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getting_the_system_version.asp
 #define BUFSIZE 80
 
+#define SM_SERVERR2            89
+
+typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
+
 void os_uname(char buf[])
 {
    OSVERSIONINFOEX osvi;
+   SYSTEM_INFO si;
+   PGNSI pGNSI;
    BOOL bOsVersionInfoEx;
    char binull='\0';
 
@@ -167,14 +173,41 @@
          return;
    }
 
+   // Use GetProcAddress to avoid load issues on Windows 2000
+   pGNSI = (PGNSI) GetProcAddress(
+      GetModuleHandle("kernel32.dll"), 
+      "GetNativeSystemInfo");
+   if(NULL != pGNSI)
+      pGNSI(&si);
+
    switch (osvi.dwPlatformId)
    {
       // Test for the Windows NT product family.
+
       case VER_PLATFORM_WIN32_NT:
 
+ 			char tbuf[4096];
+
       // Test for the specific product.
+      if ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0 )
+      {
+         if( osvi.wProductType == VER_NT_WORKSTATION )
+             strcat(buf, "Microsoft Windows Vista \0");
+         else strcat(buf, "Microsoft Windows Server \"Longhorn\" \0" );
+      }
+
       if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
-         strcat(buf, "Microsoft Windows Server 2003, \0");
+      {
+         if( osvi.wProductType == VER_NT_WORKSTATION )
+         {
+            strcat(buf, "Microsoft Windows XP \0");
+         }
+         else strcat(buf, "Microsoft Windows Server 2003 \0");
+         if( GetSystemMetrics(SM_SERVERR2) )
+         {
+            strcat(buf, "\"R2\" \0");
+         }
+      }
 
       if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
          strcat(buf, "Microsoft Windows XP \0");
@@ -205,12 +238,12 @@
             if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion==2)
             {
                if( osvi.wSuiteMask & VER_SUITE_DATACENTER )
-                  strcat(buf, "Datacenter Edition \0" );
+                  strcat(buf, "Datacenter \0" );
                else if( osvi.wSuiteMask & VER_SUITE_ENTERPRISE )
-                  strcat(buf, "Enterprise Edition \0" );
+                  strcat(buf, "Enterprise \0" );
                else if ( osvi.wSuiteMask == VER_SUITE_BLADE )
-                  strcat(buf, "Web Edition \0" );
-               else strcat(buf, "Standard Edition \0" );
+                  strcat(buf, "Web \0" );
+               else strcat(buf, "Standard \0" );
             }
             else if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion==0)
             {
@@ -227,6 +260,25 @@
                else strcat(buf, "Server 4.0 \0" );
             }
          }
+
+         // Test for prozessor architecture on nt5.2
+         if(osvi.dwMajorVersion==5 && osvi.dwMinorVersion==2)
+         {
+            if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_IA64 )
+            {
+               strcat(buf, "Edition for Itanium-based Systems \0" );
+            }
+
+            else if ( si.wProcessorArchitecture==PROCESSOR_ARCHITECTURE_AMD64 )
+            {
+               strcat(buf, "x64 Edition \0" );
+            }
+
+            else
+            {
+               strcat(buf, "Edition \0" );
+            }
+         }
       }
       // Test for specific product on Windows NT 4.0 SP5 and earlier
       else  
@@ -255,11 +307,10 @@
             strcat(buf, "Server \0" );
          if ( lstrcmpi( "SERVERNT", szProductType) == 0 )
             strcat(buf, "Advanced Server \0" );
-         printf( "%d.%d", (int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion );
+         sprintf(tbuf, "%i.%i %c", (int)osvi.dwMajorVersion, (int)osvi.dwMinorVersion, binull );
       }
 
       // Display service pack (if any) and build number.
-			char tbuf[4096];
       if( osvi.dwMajorVersion == 4 && lstrcmpi( osvi.szCSDVersion, "Service Pack 6" ) == 0 )
       { 
          HKEY hKey;
@@ -283,6 +334,12 @@
          sprintf(tbuf, "%s (Build %lu)%c", osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF, binull);
       }
 
+      // Test for processor count.
+      if (si.dwNumberOfProcessors > 1)
+      {
+         sprintf(tbuf, " (CPUs: %u)%c", si.dwNumberOfProcessors, binull);
+      }
+      
       strcat(buf, tbuf);
       break;
 
