mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
- ported RtlVerifyVersionInfo from wine
- moved version functions in kernel32 into their own file svn path=/trunk/; revision=14380
This commit is contained in:
parent
911b9d27ae
commit
9ad486dd0a
7 changed files with 428 additions and 206 deletions
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
236
reactos/lib/kernel32/misc/version.c
Normal file
236
reactos/lib/kernel32/misc/version.c
Normal file
|
@ -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 */
|
|
@ -672,6 +672,7 @@ RtlValidSid@4
|
|||
RtlValidateHeap@12
|
||||
RtlValidateProcessHeaps@0
|
||||
RtlValidateUnicodeString@8
|
||||
RtlVerifyVersionInfo@16
|
||||
;RtlWalkHeap
|
||||
RtlWriteRegistryValue@24
|
||||
;RtlZeroHeap
|
||||
|
|
|
@ -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,25 +40,204 @@
|
|||
|
||||
/* 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
|
||||
|
|
|
@ -1212,7 +1212,7 @@ RtlUpperString@8
|
|||
RtlValidRelativeSecurityDescriptor@12
|
||||
RtlValidSecurityDescriptor@4
|
||||
RtlValidSid@4
|
||||
;RtlVerifyVersionInfo@16
|
||||
RtlVerifyVersionInfo@16
|
||||
RtlVolumeDeviceToDosName@8
|
||||
RtlWalkFrameChain@12
|
||||
RtlWriteRegistryValue@24
|
||||
|
|
Loading…
Reference in a new issue