- ported RtlVerifyVersionInfo from wine
- moved version functions in kernel32 into their own file
Modified: trunk/reactos/lib/kernel32/makefile
Modified: trunk/reactos/lib/kernel32/misc/env.c
Modified: trunk/reactos/lib/kernel32/misc/stubs.c
Added: trunk/reactos/lib/kernel32/misc/version.c
Modified: trunk/reactos/lib/ntdll/def/ntdll.def
Modified: trunk/reactos/lib/rtl/version.c
Modified: trunk/reactos/ntoskrnl/ntoskrnl.def

Modified: trunk/reactos/lib/kernel32/makefile
--- trunk/reactos/lib/kernel32/makefile	2005-03-29 14:27:46 UTC (rev 14379)
+++ trunk/reactos/lib/kernel32/makefile	2005-03-29 15:22:44 UTC (rev 14380)
@@ -35,7 +35,7 @@
                misc/sysinfo.o misc/profile.o \
                misc/muldiv.o misc/nls.o misc/computername.o \
                misc/perfcnt.o misc/lzexpand_main.o misc/lcformat.o \
-               misc/chartype.o
+               misc/chartype.o misc/version.o
 
 FILE_OBJECTS = file/file.o file/curdir.o file/lfile.o file/dir.o \
                file/iocompl.o file/volume.o file/deviceio.o file/dosdev.o \

Modified: trunk/reactos/lib/kernel32/misc/env.c
--- trunk/reactos/lib/kernel32/misc/env.c	2005-03-29 14:27:46 UTC (rev 14379)
+++ trunk/reactos/lib/kernel32/misc/env.c	2005-03-29 15:22:44 UTC (rev 14380)
@@ -222,159 +222,6 @@
 /*
  * @implemented
  */
-DWORD
-STDCALL
-GetVersion(VOID)
-{
-  PPEB pPeb = NtCurrentPeb();
-  DWORD nVersion;
-
-  nVersion = MAKEWORD(pPeb->OSMajorVersion, pPeb->OSMinorVersion);
-
-  /* behave consistently when posing as another operating system */
-  /* build number */
-  if(pPeb->OSPlatformId != VER_PLATFORM_WIN32_WINDOWS)
-    nVersion |= ((DWORD)(pPeb->OSBuildNumber)) << 16;
- 
-  /* non-NT platform flag */
-  if(pPeb->OSPlatformId != VER_PLATFORM_WIN32_NT)
-    nVersion |= 0x80000000;
-
-  return nVersion;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-GetVersionExW(
-    LPOSVERSIONINFOW lpVersionInformation
-    )
-{
-  NTSTATUS Status;
-  
-  if(lpVersionInformation->dwOSVersionInfoSize != sizeof(OSVERSIONINFOW) &&
-     lpVersionInformation->dwOSVersionInfoSize != sizeof(OSVERSIONINFOEXW))
-  {
-    /* for some reason win sets ERROR_INSUFFICIENT_BUFFER even if it is large
-       enough but doesn't match the exact sizes supported, ERROR_INVALID_PARAMETER
-       would've been much more appropriate... */
-    SetLastError(ERROR_INSUFFICIENT_BUFFER);
-    return FALSE;
-  }
-
-  Status = RtlGetVersion((PRTL_OSVERSIONINFOW)lpVersionInformation);
-  if(NT_SUCCESS(Status))
-  {
-    int ln, maxlen;
-    
-    /* append a reactos specific string to the szCSDVersion string */
-
-    /* FIXME - we shouldn't do this when there is a (ros-specific) compatibility
-               flag set so we don't screw applications that might depend on a
-               certain string */
-
-    ln = wcslen(lpVersionInformation->szCSDVersion) + 1;
-    maxlen = (sizeof(lpVersionInformation->szCSDVersion) / sizeof(lpVersionInformation->szCSDVersion[0]) - 1);
-    if(maxlen > ln)
-    {
-      PWCHAR szVer = lpVersionInformation->szCSDVersion + ln;
-      RtlZeroMemory(szVer, (maxlen - ln + 1) * sizeof(WCHAR));
-      wcsncpy(szVer,
-              L"ReactOS " KERNEL_VERSION_STR L" (Build " KERNEL_VERSION_BUILD_STR L")",
-              maxlen - ln);
-    }
-    
-    return TRUE;
-  }
-
-  return FALSE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-GetVersionExA(
-    LPOSVERSIONINFOA lpVersionInformation
-    )
-{
-  OSVERSIONINFOEXW viw;
-  
-  RtlZeroMemory(&viw, sizeof(viw));
-  
-  switch(lpVersionInformation->dwOSVersionInfoSize)
-  {
-    case sizeof(OSVERSIONINFOA):
-      viw.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
-      break;
-
-    case sizeof(OSVERSIONINFOEXA):
-      viw.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
-      break;
-
-    default:
-      /* for some reason win sets ERROR_INSUFFICIENT_BUFFER even if it is large
-         enough but doesn't match the exact sizes supported, ERROR_INVALID_PARAMETER
-         would've been much more appropriate... */
-      SetLastError(ERROR_INSUFFICIENT_BUFFER);
-      return FALSE;
-  }
-  
-  if(GetVersionExW((LPOSVERSIONINFOW)&viw))
-  {
-    ANSI_STRING CSDVersionA;
-    UNICODE_STRING CSDVersionW;
-    
-    /* copy back fields that match both supported structures */
-    lpVersionInformation->dwMajorVersion = viw.dwMajorVersion;
-    lpVersionInformation->dwMinorVersion = viw.dwMinorVersion;
-    lpVersionInformation->dwBuildNumber = viw.dwBuildNumber;
-    lpVersionInformation->dwPlatformId = viw.dwPlatformId;
-    
-    /* convert the win version string */
-    RtlInitUnicodeString(&CSDVersionW, viw.szCSDVersion);
-    
-    CSDVersionA.Length = 0;
-    CSDVersionA.MaximumLength = sizeof(lpVersionInformation->szCSDVersion);
-    CSDVersionA.Buffer = lpVersionInformation->szCSDVersion;
-    
-    RtlUnicodeStringToAnsiString(&CSDVersionA, &CSDVersionW, FALSE);
-
-    /* convert the ReactOS version string */
-    CSDVersionW.Buffer = viw.szCSDVersion + CSDVersionW.Length / sizeof(WCHAR) + 1;
-    CSDVersionW.MaximumLength = sizeof(viw.szCSDVersion) - (CSDVersionW.Length + sizeof(WCHAR));
-    CSDVersionW.Length = wcslen(CSDVersionW.Buffer) * sizeof(WCHAR);
-    CSDVersionA.Buffer = lpVersionInformation->szCSDVersion + CSDVersionA.Length + 1;
-    CSDVersionA.MaximumLength = sizeof(lpVersionInformation->szCSDVersion) - (CSDVersionA.Length + 1);
-    CSDVersionA.Length = 0;
-
-    RtlUnicodeStringToAnsiString(&CSDVersionA, &CSDVersionW, FALSE);
-    
-    /* copy back the extended fields */
-    if(viw.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
-    {
-      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wServicePackMajor = viw.wServicePackMajor;
-      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wServicePackMinor = viw.wServicePackMinor;
-      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wSuiteMask = viw.wSuiteMask;
-      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wProductType = viw.wProductType;
-      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wReserved = viw.wReserved;
-    }
-    
-    return TRUE;
-  }
-  
-  return FALSE;
-}
-
-
-/*
- * @implemented
- */
 LPSTR
 STDCALL
 GetEnvironmentStringsA (

Modified: trunk/reactos/lib/kernel32/misc/stubs.c
--- trunk/reactos/lib/kernel32/misc/stubs.c	2005-03-29 14:27:46 UTC (rev 14379)
+++ trunk/reactos/lib/kernel32/misc/stubs.c	2005-03-29 15:22:44 UTC (rev 14380)
@@ -1283,21 +1283,6 @@
  */
 BOOL
 STDCALL
-VerifyVersionInfoW(
-    LPOSVERSIONINFOEXW lpVersionInformation,
-    DWORD dwTypeMask,
-    DWORDLONG dwlConditionMask
-    )
-{
-    STUB;
-    return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
 DeleteVolumeMountPointA(
     LPCSTR lpszVolumeMountPoint
     )
@@ -1555,36 +1540,6 @@
 /*
  * @unimplemented
  */
-BOOL
-STDCALL
-VerifyVersionInfoA(
-    LPOSVERSIONINFOEXA lpVersionInformation,
-    DWORD dwTypeMask,
-    DWORDLONG dwlConditionMask
-    )
-{
-    STUB;
-    return 0;
-}
-
-/*
- * @unimplemented
- */
-ULONGLONG
-STDCALL
-VerSetConditionMask(
-        ULONGLONG   ConditionMask,
-        DWORD   TypeMask,
-        BYTE    Condition
-        )
-{
-    STUB;
-    return 0;
-}
-
-/*
- * @unimplemented
- */
 BOOL STDCALL GetConsoleKeyboardLayoutNameA(LPSTR name)
 {
     STUB;

Added: trunk/reactos/lib/kernel32/misc/version.c
--- trunk/reactos/lib/kernel32/misc/version.c	2005-03-29 14:27:46 UTC (rev 14379)
+++ trunk/reactos/lib/kernel32/misc/version.c	2005-03-29 15:22:44 UTC (rev 14380)
@@ -0,0 +1,236 @@
+/* $Id$
+ *
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS system libraries
+ * FILE:            lib/kernel32/misc/version.c
+ * PURPOSE:         Version functions
+ * PROGRAMMER:      Ariadne ( ariadne@xs4all.nl)
+ * UPDATE HISTORY:
+ *                  Created 01/11/98
+ */
+
+#include <k32.h>
+
+#define NDEBUG
+#include "../include/debug.h"
+
+
+/* FUNCTIONS ******************************************************************/
+
+
+/*
+ * @implemented
+ */
+DWORD
+STDCALL
+GetVersion(VOID)
+{
+  PPEB pPeb = NtCurrentPeb();
+  DWORD nVersion;
+
+  nVersion = MAKEWORD(pPeb->OSMajorVersion, pPeb->OSMinorVersion);
+
+  /* behave consistently when posing as another operating system */
+  /* build number */
+  if(pPeb->OSPlatformId != VER_PLATFORM_WIN32_WINDOWS)
+    nVersion |= ((DWORD)(pPeb->OSBuildNumber)) << 16;
+ 
+  /* non-NT platform flag */
+  if(pPeb->OSPlatformId != VER_PLATFORM_WIN32_NT)
+    nVersion |= 0x80000000;
+
+  return nVersion;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+GetVersionExW(
+    LPOSVERSIONINFOW lpVersionInformation
+    )
+{
+  NTSTATUS Status;
+  
+  if(lpVersionInformation->dwOSVersionInfoSize != sizeof(OSVERSIONINFOW) &&
+     lpVersionInformation->dwOSVersionInfoSize != sizeof(OSVERSIONINFOEXW))
+  {
+    /* for some reason win sets ERROR_INSUFFICIENT_BUFFER even if it is large
+       enough but doesn't match the exact sizes supported, ERROR_INVALID_PARAMETER
+       would've been much more appropriate... */
+    SetLastError(ERROR_INSUFFICIENT_BUFFER);
+    return FALSE;
+  }
+
+  Status = RtlGetVersion((PRTL_OSVERSIONINFOW)lpVersionInformation);
+  if(NT_SUCCESS(Status))
+  {
+    int ln, maxlen;
+    
+    /* append a reactos specific string to the szCSDVersion string */
+
+    /* FIXME - we shouldn't do this when there is a (ros-specific) compatibility
+               flag set so we don't screw applications that might depend on a
+               certain string */
+
+    ln = wcslen(lpVersionInformation->szCSDVersion) + 1;
+    maxlen = (sizeof(lpVersionInformation->szCSDVersion) / sizeof(lpVersionInformation->szCSDVersion[0]) - 1);
+    if(maxlen > ln)
+    {
+      PWCHAR szVer = lpVersionInformation->szCSDVersion + ln;
+      RtlZeroMemory(szVer, (maxlen - ln + 1) * sizeof(WCHAR));
+      wcsncpy(szVer,
+              L"ReactOS " KERNEL_VERSION_STR L" (Build " KERNEL_VERSION_BUILD_STR L")",
+              maxlen - ln);
+    }
+    
+    return TRUE;
+  }
+
+  return FALSE;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+GetVersionExA(
+    LPOSVERSIONINFOA lpVersionInformation
+    )
+{
+  OSVERSIONINFOEXW viw;
+  
+  RtlZeroMemory(&viw, sizeof(viw));
+  
+  switch(lpVersionInformation->dwOSVersionInfoSize)
+  {
+    case sizeof(OSVERSIONINFOA):
+      viw.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
+      break;
+
+    case sizeof(OSVERSIONINFOEXA):
+      viw.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
+      break;
+
+    default:
+      /* for some reason win sets ERROR_INSUFFICIENT_BUFFER even if it is large
+         enough but doesn't match the exact sizes supported, ERROR_INVALID_PARAMETER
+         would've been much more appropriate... */
+      SetLastError(ERROR_INSUFFICIENT_BUFFER);
+      return FALSE;
+  }
+  
+  if(GetVersionExW((LPOSVERSIONINFOW)&viw))
+  {
+    ANSI_STRING CSDVersionA;
+    UNICODE_STRING CSDVersionW;
+    
+    /* copy back fields that match both supported structures */
+    lpVersionInformation->dwMajorVersion = viw.dwMajorVersion;
+    lpVersionInformation->dwMinorVersion = viw.dwMinorVersion;
+    lpVersionInformation->dwBuildNumber = viw.dwBuildNumber;
+    lpVersionInformation->dwPlatformId = viw.dwPlatformId;
+    
+    /* convert the win version string */
+    RtlInitUnicodeString(&CSDVersionW, viw.szCSDVersion);
+    
+    CSDVersionA.Length = 0;
+    CSDVersionA.MaximumLength = sizeof(lpVersionInformation->szCSDVersion);
+    CSDVersionA.Buffer = lpVersionInformation->szCSDVersion;
+    
+    RtlUnicodeStringToAnsiString(&CSDVersionA, &CSDVersionW, FALSE);
+
+    /* convert the ReactOS version string */
+    CSDVersionW.Buffer = viw.szCSDVersion + CSDVersionW.Length / sizeof(WCHAR) + 1;
+    CSDVersionW.MaximumLength = sizeof(viw.szCSDVersion) - (CSDVersionW.Length + sizeof(WCHAR));
+    CSDVersionW.Length = wcslen(CSDVersionW.Buffer) * sizeof(WCHAR);
+    CSDVersionA.Buffer = lpVersionInformation->szCSDVersion + CSDVersionA.Length + 1;
+    CSDVersionA.MaximumLength = sizeof(lpVersionInformation->szCSDVersion) - (CSDVersionA.Length + 1);
+    CSDVersionA.Length = 0;
+
+    RtlUnicodeStringToAnsiString(&CSDVersionA, &CSDVersionW, FALSE);
+    
+    /* copy back the extended fields */
+    if(viw.dwOSVersionInfoSize == sizeof(OSVERSIONINFOEXW))
+    {
+      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wServicePackMajor = viw.wServicePackMajor;
+      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wServicePackMinor = viw.wServicePackMinor;
+      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wSuiteMask = viw.wSuiteMask;
+      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wProductType = viw.wProductType;
+      ((LPOSVERSIONINFOEXA)lpVersionInformation)->wReserved = viw.wReserved;
+    }
+    
+    return TRUE;
+  }
+  
+  return FALSE;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+VerifyVersionInfoW(
+    LPOSVERSIONINFOEXW lpVersionInformation,
+    DWORD dwTypeMask,
+    DWORDLONG dwlConditionMask
+    )
+{
+  NTSTATUS Status;
+  
+  Status = RtlVerifyVersionInfo((PRTL_OSVERSIONINFOEXW)lpVersionInformation,
+                                dwTypeMask,
+                                dwlConditionMask);
+  switch(Status)
+  {
+    case STATUS_INVALID_PARAMETER:
+      SetLastError(ERROR_BAD_ARGUMENTS);
+      return FALSE;
+
+    case STATUS_REVISION_MISMATCH:
+      SetLastError(ERROR_OLD_WIN_VERSION);
+      return FALSE;
+
+    default:
+      /* RtlVerifyVersionInfo shouldn't report any other failure code! */
+      ASSERT(NT_SUCCESS(Status));
+      return TRUE;
+  }
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+VerifyVersionInfoA(
+    LPOSVERSIONINFOEXA lpVersionInformation,
+    DWORD dwTypeMask,
+    DWORDLONG dwlConditionMask
+    )
+{
+  OSVERSIONINFOEXW viex;
+  
+  viex.dwOSVersionInfoSize = sizeof(viex);
+  viex.dwMajorVersion = lpVersionInformation->dwMajorVersion;
+  viex.dwMinorVersion = lpVersionInformation->dwMinorVersion;
+  viex.dwBuildNumber = lpVersionInformation->dwBuildNumber;
+  viex.dwPlatformId = lpVersionInformation->dwPlatformId;
+  /* NOTE: szCSDVersion is ignored, we don't need to convert it to unicode */
+  viex.wServicePackMajor = lpVersionInformation->wServicePackMajor;
+  viex.wServicePackMinor = lpVersionInformation->wServicePackMinor;
+  viex.wSuiteMask = lpVersionInformation->wSuiteMask;
+  viex.wProductType = lpVersionInformation->wProductType;
+  viex.wReserved = lpVersionInformation->wReserved;
+  
+  return VerifyVersionInfoW(&viex, dwTypeMask, dwlConditionMask);
+}
+
+/* EOF */
Property changes on: trunk/reactos/lib/kernel32/misc/version.c
___________________________________________________________________
Name: svn:keywords
   + author date id revision
Name: svn:eol-style
   + native

Modified: trunk/reactos/lib/ntdll/def/ntdll.def
--- trunk/reactos/lib/ntdll/def/ntdll.def	2005-03-29 14:27:46 UTC (rev 14379)
+++ trunk/reactos/lib/ntdll/def/ntdll.def	2005-03-29 15:22:44 UTC (rev 14380)
@@ -672,6 +672,7 @@
 RtlValidateHeap@12
 RtlValidateProcessHeaps@0
 RtlValidateUnicodeString@8
+RtlVerifyVersionInfo@16
 ;RtlWalkHeap
 RtlWriteRegistryValue@24
 ;RtlZeroHeap

Modified: trunk/reactos/lib/rtl/version.c
--- trunk/reactos/lib/rtl/version.c	2005-03-29 14:27:46 UTC (rev 14379)
+++ trunk/reactos/lib/rtl/version.c	2005-03-29 15:22:44 UTC (rev 14380)
@@ -1,6 +1,10 @@
 /*
  *  ReactOS kernel
  *  Copyright (C) 2004 ReactOS Team
+ *  Copyright 1997 Marcus Meissner
+ *  Copyright 1998 Patrik Stridvall
+ *  Copyright 1998, 2003 Andreas Mohr
+ *  Copyright 1997, 2003 Alexandre Julliard
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -36,26 +40,205 @@
 
 /* GLOBALS ******************************************************************/
 
+NTSTATUS
+STDCALL
+RtlGetVersion(
+    OUT PRTL_OSVERSIONINFOW lpVersionInformation
+    );
 
 /* FUNCTIONS ****************************************************************/
 
 /*
-* @unimplemented
+* @implemented
 */
-/*
 NTSTATUS
 STDCALL
 RtlVerifyVersionInfo(
 	IN PRTL_OSVERSIONINFOEXW VersionInfo,
 	IN ULONG TypeMask,
-	IN ULONGLONG  ConditionMask
+	IN ULONGLONG ConditionMask
 	)
 {
-	UNIMPLEMENTED;
-	return STATUS_NOT_IMPLEMENTED;
+    RTL_OSVERSIONINFOEXW ver;
+    NTSTATUS status;
+
+    /* FIXME:
+        - Check the following special case on Windows (various versions):
+          o lp->wSuiteMask == 0 and ver.wSuiteMask != 0 and VER_AND/VER_OR
+          o lp->dwOSVersionInfoSize != sizeof(OSVERSIONINFOEXW)
+        - MSDN talks about some tests being impossible. Check what really happens.
+     */
+
+    ver.dwOSVersionInfoSize = sizeof(ver);
+    if ((status = RtlGetVersion( (PRTL_OSVERSIONINFOW)&ver )) != STATUS_SUCCESS) return status;
+
+    if(!(TypeMask && ConditionMask)) return STATUS_INVALID_PARAMETER;
+
+    if(TypeMask & VER_PRODUCT_TYPE)
+        switch(ConditionMask >> 7*3 & 0x07) {
+            case VER_EQUAL:
+                if(ver.wProductType != VersionInfo->wProductType) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER:
+                if(ver.wProductType <= VersionInfo->wProductType) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER_EQUAL:
+                if(ver.wProductType < VersionInfo->wProductType) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS:
+                if(ver.wProductType >= VersionInfo->wProductType) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS_EQUAL:
+                if(ver.wProductType > VersionInfo->wProductType) return STATUS_REVISION_MISMATCH;
+                break;
+            default:
+                return STATUS_INVALID_PARAMETER;
+        }
+    if(TypeMask & VER_SUITENAME)
+        switch(ConditionMask >> 6*3 & 0x07)
+        {
+            case VER_AND:
+                if((VersionInfo->wSuiteMask & ver.wSuiteMask) != VersionInfo->wSuiteMask)
+                    return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_OR:
+                if(!(VersionInfo->wSuiteMask & ver.wSuiteMask) && VersionInfo->wSuiteMask)
+                    return STATUS_REVISION_MISMATCH;
+                break;
+            default:
+                return STATUS_INVALID_PARAMETER;
+        }
+    if(TypeMask & VER_PLATFORMID)
+        switch(ConditionMask >> 3*3 & 0x07)
+        {
+            case VER_EQUAL:
+                if(ver.dwPlatformId != VersionInfo->dwPlatformId) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER:
+                if(ver.dwPlatformId <= VersionInfo->dwPlatformId) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER_EQUAL:
+                if(ver.dwPlatformId < VersionInfo->dwPlatformId) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS:
+                if(ver.dwPlatformId >= VersionInfo->dwPlatformId) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS_EQUAL:
+                if(ver.dwPlatformId > VersionInfo->dwPlatformId) return STATUS_REVISION_MISMATCH;
+                break;
+            default:
+                return STATUS_INVALID_PARAMETER;
+        }
+    if(TypeMask & VER_BUILDNUMBER)
+        switch(ConditionMask >> 2*3 & 0x07)
+        {
+            case VER_EQUAL:
+                if(ver.dwBuildNumber != VersionInfo->dwBuildNumber) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER:
+                if(ver.dwBuildNumber <= VersionInfo->dwBuildNumber) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER_EQUAL:
+                if(ver.dwBuildNumber < VersionInfo->dwBuildNumber) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS:
+                if(ver.dwBuildNumber >= VersionInfo->dwBuildNumber) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS_EQUAL:
+                if(ver.dwBuildNumber > VersionInfo->dwBuildNumber) return STATUS_REVISION_MISMATCH;
+                break;
+            default:
+                return STATUS_INVALID_PARAMETER;
+        }
+    if(TypeMask & VER_MAJORVERSION)
+        switch(ConditionMask >> 1*3 & 0x07)
+        {
+            case VER_EQUAL:
+                if(ver.dwMajorVersion != VersionInfo->dwMajorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER:
+                if(ver.dwMajorVersion <= VersionInfo->dwMajorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER_EQUAL:
+                if(ver.dwMajorVersion < VersionInfo->dwMajorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS:
+                if(ver.dwMajorVersion >= VersionInfo->dwMajorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS_EQUAL:
+                if(ver.dwMajorVersion > VersionInfo->dwMajorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            default:
+                return STATUS_INVALID_PARAMETER;
+        }
+    if(TypeMask & VER_MINORVERSION)
+        switch(ConditionMask >> 0*3 & 0x07)
+        {
+            case VER_EQUAL:
+                if(ver.dwMinorVersion != VersionInfo->dwMinorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER:
+                if(ver.dwMinorVersion <= VersionInfo->dwMinorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER_EQUAL:
+                if(ver.dwMinorVersion < VersionInfo->dwMinorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS:
+                if(ver.dwMinorVersion >= VersionInfo->dwMinorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS_EQUAL:
+                if(ver.dwMinorVersion > VersionInfo->dwMinorVersion) return STATUS_REVISION_MISMATCH;
+                break;
+            default:
+                return STATUS_INVALID_PARAMETER;
+        }
+    if(TypeMask & VER_SERVICEPACKMAJOR)
+        switch(ConditionMask >> 5*3 & 0x07)
+        {
+            case VER_EQUAL:
+                if(ver.wServicePackMajor != VersionInfo->wServicePackMajor) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER:
+                if(ver.wServicePackMajor <= VersionInfo->wServicePackMajor) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER_EQUAL:
+                if(ver.wServicePackMajor < VersionInfo->wServicePackMajor) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS:
+                if(ver.wServicePackMajor >= VersionInfo->wServicePackMajor) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS_EQUAL:
+                if(ver.wServicePackMajor > VersionInfo->wServicePackMajor) return STATUS_REVISION_MISMATCH;
+                break;
+            default:
+                return STATUS_INVALID_PARAMETER;
+        }
+    if(TypeMask & VER_SERVICEPACKMINOR)
+        switch(ConditionMask >> 4*3 & 0x07)
+        {
+            case VER_EQUAL:
+                if(ver.wServicePackMinor != VersionInfo->wServicePackMinor) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER:
+                if(ver.wServicePackMinor <= VersionInfo->wServicePackMinor) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_GREATER_EQUAL:
+                if(ver.wServicePackMinor < VersionInfo->wServicePackMinor) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS:
+                if(ver.wServicePackMinor >= VersionInfo->wServicePackMinor) return STATUS_REVISION_MISMATCH;
+                break;
+            case VER_LESS_EQUAL:
+                if(ver.wServicePackMinor > VersionInfo->wServicePackMinor) return STATUS_REVISION_MISMATCH;
+                break;
+            default:
+                return STATUS_INVALID_PARAMETER;
+        }
+
+    return STATUS_SUCCESS;
 }
-*/
 
+
 /*
  Header hell made me do it, don't blame me. Please move these somewhere more
  sensible

Modified: trunk/reactos/ntoskrnl/ntoskrnl.def
--- trunk/reactos/ntoskrnl/ntoskrnl.def	2005-03-29 14:27:46 UTC (rev 14379)
+++ trunk/reactos/ntoskrnl/ntoskrnl.def	2005-03-29 15:22:44 UTC (rev 14380)
@@ -1212,7 +1212,7 @@
 RtlValidRelativeSecurityDescriptor@12
 RtlValidSecurityDescriptor@4
 RtlValidSid@4
-;RtlVerifyVersionInfo@16
+RtlVerifyVersionInfo@16
 RtlVolumeDeviceToDosName@8
 RtlWalkFrameChain@12
 RtlWriteRegistryValue@24