Implement kernel32.VerSetConditionMask

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch "implements" kernel32.VerSetConditionMask by moving around the ntdll version. Is this OK ? Is it allowed to call kernel32 from ntdll ?

Changelog: Implement kernel32.VerSetConditionMask by moving and forwarding ntdll.VerSetConditionMask

Regards

Dominik
Index: dlls/kernel/kernel32.spec
===================================================================
RCS file: /home/wine/wine/dlls/kernel/kernel32.spec,v
retrieving revision 1.87
diff -u -3 -p -r1.87 kernel32.spec
--- dlls/kernel/kernel32.spec	19 Dec 2002 04:12:42 -0000	1.87
+++ dlls/kernel/kernel32.spec	29 Dec 2002 09:51:43 -0000
@@ -835,7 +835,7 @@
 @ stub ValidateLocale
 @ stdcall VerLanguageNameA(long str long) VerLanguageNameA
 @ stdcall VerLanguageNameW(long wstr long) VerLanguageNameW
-@ stub VerSetConditionMask
+@ stdcall -ret64 VerSetConditionMask(long long long long) VerSetConditionMask
 @ stdcall VirtualAlloc(ptr long long long) VirtualAlloc
 @ stdcall VirtualFree(ptr long long) VirtualFree
 @ stdcall VirtualLock(ptr long) VirtualLock
Index: dlls/ntdll/nt.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/nt.c,v
retrieving revision 1.48
diff -u -3 -p -r1.48 nt.c
--- dlls/ntdll/nt.c	10 Dec 2002 20:04:40 -0000	1.48
+++ dlls/ntdll/nt.c	29 Dec 2002 09:51:43 -0000
@@ -719,33 +719,3 @@ NTSTATUS WINAPI NtAllocateLocallyUniqueI
     return STATUS_SUCCESS;
 }
 
-/******************************************************************************
- *        VerSetConditionMask   (NTDLL.@)
- */
-ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBitMask,
-                                      BYTE 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;
-}
Index: dlls/ntdll/ntdll.spec
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/ntdll.spec,v
retrieving revision 1.86
diff -u -3 -p -r1.86 ntdll.spec
--- dlls/ntdll/ntdll.spec	12 Dec 2002 02:20:47 -0000	1.86
+++ dlls/ntdll/ntdll.spec	29 Dec 2002 09:51:44 -0000
@@ -1018,7 +1018,7 @@
 @ stub RtlCreatePropertySet
 @ stub RtlSetPropertySetClassId
 @ stdcall NtPowerInformation(long long long long long) NtPowerInformation
-@ stdcall -ret64 VerSetConditionMask(long long long long) VerSetConditionMask
+@ forward VerSetConditionMask kernel32.VerSetConditionMask
 
 ##################
 # Wine extensions
Index: misc/version.c
===================================================================
RCS file: /home/wine/wine/misc/version.c,v
retrieving revision 1.61
diff -u -3 -p -r1.61 version.c
--- misc/version.c	13 Sep 2002 17:47:44 -0000	1.61
+++ misc/version.c	29 Dec 2002 09:51:44 -0000
@@ -697,6 +697,38 @@ BOOL WINAPI VerifyVersionInfoA( LPOSVERS
 
 
 /******************************************************************************
+ *        VerSetConditionMask   (NTDLL.@)
+ *        VerSetConditionMask   (KERNEL32.@)
+ */
+ULONGLONG WINAPI VerSetConditionMask( ULONGLONG dwlConditionMask, DWORD dwTypeBitMask,
+                                      BYTE 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;
+}
+
+/******************************************************************************
  *        VerifyVersionInfoW   (KERNEL32.@)
  */
 BOOL WINAPI VerifyVersionInfoW( LPOSVERSIONINFOEXW lpVersionInfo, DWORD dwTypeMask,

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux