BUG #690: VerSetConditionMask (correct implementation)

Vincent Béron vberon at mecano.gme.usherb.ca
Sat May 18 14:16:24 CDT 2002


Please don't use my previous patch for it but this one instead.

Changelog
 - Correct implementation of VerSetConditionMask.
 - Declararation in winbase.h of the structures and defines needed for a
real implementation of VerifyVersionInfo{A,W}.

Vincent
-------------- next part --------------
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	Sat May 18 14:18:45 2002
@@ -744,6 +744,27 @@
 ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBitMask,
                                       BYTE dwConditionMask)
 {
-    FIXME("%llx %lu %u\n", dwlConditionMask, dwTypeBitMask, dwConditionMask);
+    if(dwTypeBitMask == 0)
+	return dwlConditionMask;
+    dwConditionMask &= 0x07;
+    if(dwConditionMask == 0)
+	return dwlConditionMask;
+
+    if(dwTypeBitMask & VER_PRODUCT_TYPE)
+	dwlConditionMask |= dwConditionMask << 7*3;
+    else if (dwTypeBitMask & VER_SUITENAME)
+	dwlConditionMask |= dwConditionMask << 6*3;
+    else if (dwTypeBitMask & VER_SERVICEPACKMAJOR)
+	dwlConditionMask |= dwConditionMask << 5*3;
+    else if (dwTypeBitMask & VER_SERVICEPACKMINOR)
+	dwlConditionMask |= dwConditionMask << 4*3;
+    else if (dwTypeBitMask & VER_PLATFORMID)
+	dwlConditionMask |= dwConditionMask << 3*3;
+    else if (dwTypeBitMask & VER_BUILDNUMBER)
+	dwlConditionMask |= dwConditionMask << 2*3;
+    else if (dwTypeBitMask & VER_MAJORVERSION)
+	dwlConditionMask |= dwConditionMask << 1*3;
+    else if (dwTypeBitMask & VER_MINORVERSION)
+	dwlConditionMask |= dwConditionMask << 0*3;
     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	Sat May 18 14:46:16 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
 {


More information about the wine-patches mailing list