Changelog: - Implementation of VerSetConditionMask. Vincent
diff -urN wine-orig/dlls/ntdll/nt.c wine/dlls/ntdll/nt.c --- wine-orig/dlls/ntdll/nt.c Fri May 10 08:40:00 2002 +++ wine/dlls/ntdll/nt.c Fri May 17 17:34:22 2002 @@ -744,6 +744,41 @@ ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBitMask, BYTE dwConditionMask) { - FIXME("%llx %lu %u\n", dwlConditionMask, dwTypeBitMask, dwConditionMask); - return dwlConditionMask; + /* Verify that the condition is really cleared before the bitwise OR */ + switch(dwTypeBitMask) { + case VER_MINORVERSION: + dwlConditionMask &= 0xfffffffffffffff8LL; + dwlConditionMask |= dwConditionMask << 0*3; + return dwlConditionMask; + case VER_MAJORVERSION: + dwlConditionMask &= 0xffffffffffffffc7LL; + dwlConditionMask |= dwConditionMask << 1*3; + return dwlConditionMask; + case VER_BUILDNUMBER: + dwlConditionMask &= 0xfffffffffffffe3fLL; + dwlConditionMask |= dwConditionMask << 2*3; + return dwlConditionMask; + case VER_PLATFORMID: + dwlConditionMask &= 0xfffffffffffff1ffLL; + dwlConditionMask |= dwConditionMask << 3*3; + return dwlConditionMask; + case VER_SERVICEPACKMINOR: + dwlConditionMask &= 0xffffffffffff8fffLL; + dwlConditionMask |= dwConditionMask << 4*3; + return dwlConditionMask; + case VER_SERVICEPACKMAJOR: + dwlConditionMask &= 0xfffffffffffc7fffLL; + dwlConditionMask |= dwConditionMask << 5*3; + return dwlConditionMask; + case VER_SUITENAME: + dwlConditionMask &= 0xffffffffffe3ffffLL; + dwlConditionMask |= dwConditionMask << 6*3; + return dwlConditionMask; + case VER_PRODUCT_TYPE: + dwlConditionMask &= 0xffffffffff1fffffLL; + dwlConditionMask |= dwConditionMask << 7*3; + return dwlConditionMask; + default: + return dwlConditionMask; + } } diff -urN wine-orig/include/winbase.h wine/include/winbase.h --- wine-orig/include/winbase.h Sat May 11 20:04:31 2002 +++ wine/include/winbase.h Fri May 17 13:12:21 2002 @@ -838,9 +838,77 @@ DECL_WINELIB_TYPE_AW(POSVERSIONINFO) DECL_WINELIB_TYPE_AW(LPOSVERSIONINFO) -#define VER_PLATFORM_WIN32s 0 -#define VER_PLATFORM_WIN32_WINDOWS 1 -#define VER_PLATFORM_WIN32_NT 2 +typedef struct { + DWORD dwOSVersionInfoSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformId; + CHAR szCSDVersion[128]; + WORD wServicePackMajor; + WORD wServicePackMinor; + WORD wSuiteMask; + BYTE wProductType; + BYTE wReserved; +} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA; + +typedef struct { + DWORD dwOSVersionInfoSize; + DWORD dwMajorVersion; + DWORD dwMinorVersion; + DWORD dwBuildNumber; + DWORD dwPlatformId; + WCHAR szCSDVersion[128]; + WORD wServicePackMajor; + WORD wServicePackMinor; + WORD wSuiteMask; + BYTE wProductType; + BYTE wReserved; +} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW; + +DECL_WINELIB_TYPE_AW(OSVERSIONINFOEX) +DECL_WINELIB_TYPE_AW(POSVERSIONINFOEX) +DECL_WINELIB_TYPE_AW(LPOSVERSIONINFOEX) + +ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE); + +#define VER_SET_CONDITION(_m_,_t_,_c_) ((_m_)=VerSetConditionMask((_m_),(_t_),(_c_))) + +#define VER_PLATFORM_WIN32s 0 +#define VER_PLATFORM_WIN32_WINDOWS 1 +#define VER_PLATFORM_WIN32_NT 2 + +#define VER_MINORVERSION 0x00000001 +#define VER_MAJORVERSION 0x00000002 +#define VER_BUILDNUMBER 0x00000004 +#define VER_PLATFORMID 0x00000008 +#define VER_SERVICEPACKMINOR 0x00000010 +#define VER_SERVICEPACKMAJOR 0x00000020 +#define VER_SUITENAME 0x00000040 +#define VER_PRODUCT_TYPE 0x00000080 + +#define VER_NT_WORKSTATION 1 +#define VER_NT_DOMAIN_CONTROLLER 2 +#define VER_NT_SERVER 3 + +#define VER_SUITE_SMALLBUSINESS 0x00000001 +#define VER_SUITE_ENTERPRISE 0x00000002 +#define VER_SUITE_BACKOFFICE 0x00000004 +#define VER_SUITE_COMMUNICATIONS 0x00000008 +#define VER_SUITE_TERMINAL 0x00000010 +#define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020 +#define VER_SUITE_EMBEDDEDNT 0x00000040 +#define VER_SUITE_DATACENTER 0x00000080 +#define VER_SUITE_SINGLEUSERTS 0x00000100 +#define VER_SUITE_PERSONAL 0x00000200 + +#define VER_EQUAL 1 +#define VER_GREATER 2 +#define VER_GREATER_EQUAL 3 +#define VER_LESS 4 +#define VER_LESS_EQUAL 5 +#define VER_AND 6 +#define VER_OR 7 typedef struct tagCOMSTAT {