- ported RtlVerifyVersionInfo from wine
authorThomas Bluemel <thomas@reactsoft.com>
Tue, 29 Mar 2005 15:22:44 +0000 (15:22 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Tue, 29 Mar 2005 15:22:44 +0000 (15:22 +0000)
- moved version functions in kernel32 into their own file

svn path=/trunk/; revision=14380

reactos/lib/kernel32/makefile
reactos/lib/kernel32/misc/env.c
reactos/lib/kernel32/misc/stubs.c
reactos/lib/kernel32/misc/version.c [new file with mode: 0644]
reactos/lib/ntdll/def/ntdll.def
reactos/lib/rtl/version.c
reactos/ntoskrnl/ntoskrnl.def

index 422caf1..05dc75e 100644 (file)
@@ -35,7 +35,7 @@ MISC_OBJECTS = misc/error.o misc/atom.o misc/handle.o misc/env.o \
                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 \
index 239448f..6dddc0c 100644 (file)
@@ -219,159 +219,6 @@ SetEnvironmentVariableW (
 }
 
 
-/*
- * @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
  */
index ae55a93..573a16f 100644 (file)
@@ -1278,21 +1278,6 @@ SetVolumeMountPointW(
     return 0;
 }
 
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-VerifyVersionInfoW(
-    LPOSVERSIONINFOEXW lpVersionInformation,
-    DWORD dwTypeMask,
-    DWORDLONG dwlConditionMask
-    )
-{
-    STUB;
-    return 0;
-}
-
 /*
  * @unimplemented
  */
@@ -1552,36 +1537,6 @@ SetVolumeMountPointA(
     return 0;
 }
 
-/*
- * @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
  */
diff --git a/reactos/lib/kernel32/misc/version.c b/reactos/lib/kernel32/misc/version.c
new file mode 100644 (file)
index 0000000..94952f6
--- /dev/null
@@ -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 */
index f7eb952..fd15330 100644 (file)
@@ -672,6 +672,7 @@ RtlValidSid@4
 RtlValidateHeap@12
 RtlValidateProcessHeaps@0
 RtlValidateUnicodeString@8
+RtlVerifyVersionInfo@16
 ;RtlWalkHeap
 RtlWriteRegistryValue@24
 ;RtlZeroHeap
index 5d954b4..49920db 100644 (file)
@@ -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
 
 /* 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
index a286f83..df78164 100644 (file)
@@ -1212,7 +1212,7 @@ RtlUpperString@8
 RtlValidRelativeSecurityDescriptor@12
 RtlValidSecurityDescriptor@4
 RtlValidSid@4
-;RtlVerifyVersionInfo@16
+RtlVerifyVersionInfo@16
 RtlVolumeDeviceToDosName@8
 RtlWalkFrameChain@12
 RtlWriteRegistryValue@24