Sebastian Lackner : kernel32: Forward condition variable functions to ntdll.

Alexandre Julliard julliard at winehq.org
Wed Jan 8 13:41:31 CST 2014


Module: wine
Branch: master
Commit: ddc7f300e2cd5dd2e17783739fabbf74491e9eec
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ddc7f300e2cd5dd2e17783739fabbf74491e9eec

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Sun Jan  5 03:53:12 2014 +0100

kernel32: Forward condition variable functions to ntdll.

---

 dlls/kernel32/kernel32.spec |    4 ++++
 dlls/kernel32/sync.c        |   18 ++++++++++++++++++
 dlls/kernel32/tests/sync.c  |    6 ++----
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 7779a75..02b1bdb 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -750,6 +750,7 @@
 @ stdcall InitOnceComplete(ptr long ptr)
 @ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr)
 @ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
+@ stdcall InitializeConditionVariable(ptr) ntdll.RtlInitializeConditionVariable
 @ stdcall InitializeCriticalSection(ptr)
 @ stdcall InitializeCriticalSectionAndSpinCount(ptr long)
 @ stdcall InitializeCriticalSectionEx(ptr long long)
@@ -1194,6 +1195,7 @@
 @ stdcall SignalObjectAndWait(long long long long)
 @ stdcall SizeofResource(long long)
 @ stdcall Sleep(long)
+@ stdcall SleepConditionVariableCS(ptr ptr long)
 @ stdcall SleepEx(long long)
 @ stdcall SuspendThread(long)
 @ stdcall SwitchToFiber(ptr)
@@ -1263,6 +1265,8 @@
 @ stdcall WaitForSingleObjectEx(long long long)
 @ stdcall WaitNamedPipeA (str long)
 @ stdcall WaitNamedPipeW (wstr long)
+@ stdcall WakeAllConditionVariable(ptr) ntdll.RtlWakeAllConditionVariable
+@ stdcall WakeConditionVariable(ptr) ntdll.RtlWakeConditionVariable
 @ stdcall WerRegisterFile(wstr long long)
 @ stdcall WerRegisterMemoryBlock(ptr long)
 @ stdcall WerRegisterRuntimeExceptionModule(wstr ptr)
diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c
index 5b7f810..2b7f4b0 100644
--- a/dlls/kernel32/sync.c
+++ b/dlls/kernel32/sync.c
@@ -2321,3 +2321,21 @@ __ASM_STDCALL_FUNC(InterlockedDecrement, 4,
                   "ret $4")
 
 #endif  /* __i386__ */
+
+/***********************************************************************
+ *           SleepConditionVariableCS   (KERNEL32.@)
+ */
+BOOL WINAPI SleepConditionVariableCS( CONDITION_VARIABLE *variable, CRITICAL_SECTION *crit, DWORD timeout )
+{
+    NTSTATUS status;
+    LARGE_INTEGER time;
+
+    status = RtlSleepConditionVariableCS( variable, crit, get_nt_timeout( &time, timeout ) );
+
+    if (status != STATUS_SUCCESS)
+    {
+        SetLastError( RtlNtStatusToDosError(status) );
+        return FALSE;
+    }
+    return TRUE;
+}
diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c
index 84c44e0..d76aa16 100644
--- a/dlls/kernel32/tests/sync.c
+++ b/dlls/kernel32/tests/sync.c
@@ -1477,8 +1477,7 @@ static void test_condvars_consumer_producer(void)
 
     if (!pInitializeConditionVariable) {
         /* function is not yet in XP, only in newer Windows */
-        /* and not yet implemented in Wine for some days/weeks */
-        todo_wine win_skip("no condition variable support.\n");
+        win_skip("no condition variable support.\n");
         return;
     }
 
@@ -1640,8 +1639,7 @@ static void test_condvars_base(void) {
 
     if (!pInitializeConditionVariable) {
         /* function is not yet in XP, only in newer Windows */
-        /* and not yet implemented in Wine for some days/weeks */
-        todo_wine win_skip("no condition variable support.\n");
+        win_skip("no condition variable support.\n");
         return;
     }
 




More information about the wine-cvs mailing list