Index: trunk/src/kernel32/version.cpp
===================================================================
--- trunk/src/kernel32/version.cpp	(revision 7575)
+++ trunk/src/kernel32/version.cpp	(revision 7577)
@@ -1,3 +1,3 @@
-/* $Id: version.cpp,v 1.5 2001-12-08 12:01:28 sandervl Exp $ */
+/* $Id: version.cpp,v 1.6 2001-12-08 14:48:54 sandervl Exp $ */
 
 /*
@@ -42,7 +42,7 @@
 typedef struct
 {
-    LONG           getVersion16;
-    LONG           getVersion;
-    OSVERSIONINFOA getVersionEx;
+    LONG             getVersion16;
+    LONG             getVersion;
+    OSVERSIONINFOEXA getVersionEx;
 } VERSION_DATA;
 
@@ -55,5 +55,6 @@
 	{
 	    sizeof(OSVERSIONINFOA), 4, 10, 0x40A07CE,
-	    VER_PLATFORM_WIN32_WINDOWS, "Win98"
+	    VER_PLATFORM_WIN32_WINDOWS, "Win98",
+            0, 0, 0, 0
 	}
     },
@@ -64,5 +65,6 @@
         {
             sizeof(OSVERSIONINFOA), 4, 90, 0x45A0BB8,
-            VER_PLATFORM_WIN32_WINDOWS, " "
+            VER_PLATFORM_WIN32_WINDOWS, " ",
+            0, 0, 0, 0
         }
     },
@@ -73,5 +75,6 @@
         {
             sizeof(OSVERSIONINFOA), ODINNT_MAJOR_VERSION, ODINNT_MINOR_VERSION, 
-            ODINNT_BUILD_NR, VER_PLATFORM_WIN32_NT, ODINNT_CSDVERSION
+            ODINNT_BUILD_NR, VER_PLATFORM_WIN32_NT, ODINNT_CSDVERSION,
+            6, 0, 0, 0
         }
     },
@@ -82,5 +85,6 @@
         {
             sizeof(OSVERSIONINFOA), 5, 0, 0x893,
-            VER_PLATFORM_WIN32_NT, "Service Pack 2"
+            VER_PLATFORM_WIN32_NT, "Service Pack 2",
+            2, 0, 0, 0
         }
     },
@@ -91,5 +95,6 @@
         {
             sizeof(OSVERSIONINFOA), 5, 1, 0xA28,
-            VER_PLATFORM_WIN32_NT, ""
+            VER_PLATFORM_WIN32_NT, "",
+            0, 0, 0, 0
         }
     }
@@ -155,5 +160,5 @@
         return(FALSE);
    }
-   if(lpVersionInformation->dwOSVersionInfoSize != sizeof(OSVERSIONINFOA))
+   if(lpVersionInformation->dwOSVersionInfoSize < sizeof(OSVERSIONINFOA))
    {
 	dprintf(("ERROR: buffer too small (%d != %d)", lpVersionInformation->dwOSVersionInfoSize, sizeof(OSVERSIONINFOA)));
@@ -171,4 +176,13 @@
    strcpy(lpVersionInformation->szCSDVersion, VersionData[winversion].getVersionEx.szCSDVersion );
 
+   if(lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXA)) 
+   {//Windows 2000 (and up) extension
+       LPOSVERSIONINFOEXA lpVersionExInformation = (LPOSVERSIONINFOEXA)lpVersionInformation;
+
+       lpVersionExInformation->wServicePackMajor = VersionData[winversion].getVersionEx.wServicePackMajor;
+       lpVersionExInformation->wServicePackMinor = VersionData[winversion].getVersionEx.wServicePackMinor;
+       lpVersionExInformation->wReserved[0]      = VersionData[winversion].getVersionEx.wReserved[0];
+       lpVersionExInformation->wReserved[1]      = VersionData[winversion].getVersionEx.wReserved[1];
+   }
    SetLastError(ERROR_SUCCESS);
    return(TRUE);
@@ -186,5 +200,5 @@
         return(FALSE);
    }
-   if(lpVersionInformation->dwOSVersionInfoSize != sizeof(OSVERSIONINFOW))
+   if(lpVersionInformation->dwOSVersionInfoSize < sizeof(OSVERSIONINFOW))
    {
 	dprintf(("ERROR: buffer too small"));
@@ -201,4 +215,14 @@
    lpVersionInformation->dwPlatformId   = VersionData[winversion].getVersionEx.dwPlatformId;
    lstrcpyAtoW(lpVersionInformation->szCSDVersion, VersionData[winversion].getVersionEx.szCSDVersion);
+
+   if(lpVersionInformation->dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW)) 
+   {//Windows 2000 (and up) extension
+       LPOSVERSIONINFOEXW lpVersionExInformation = (LPOSVERSIONINFOEXW)lpVersionInformation;
+
+       lpVersionExInformation->wServicePackMajor = VersionData[winversion].getVersionEx.wServicePackMajor;
+       lpVersionExInformation->wServicePackMinor = VersionData[winversion].getVersionEx.wServicePackMinor;
+       lpVersionExInformation->wReserved[0]      = VersionData[winversion].getVersionEx.wReserved[0];
+       lpVersionExInformation->wReserved[1]      = VersionData[winversion].getVersionEx.wReserved[1];
+   }
    SetLastError(ERROR_SUCCESS);
    return(TRUE);
