Author: weiden
Date: Thu Aug 31 20:56:49 2006
New Revision: 23844
URL:
http://svn.reactos.org/svn/reactos?rev=23844&view=rev
Log:
Add stubs for the condition variable functions
Added:
trunk/reactos/dll/win32/kernel32/synch/condvar.c (with props)
trunk/reactos/lib/rtl/condvar.c (with props)
Modified:
trunk/reactos/dll/ntdll/def/ntdll.def
trunk/reactos/dll/win32/kernel32/kernel32.def
trunk/reactos/dll/win32/kernel32/kernel32.rbuild
trunk/reactos/include/psdk/winbase.h
trunk/reactos/lib/rtl/rtl.rbuild
Modified: trunk/reactos/dll/ntdll/def/ntdll.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.def?re…
==============================================================================
--- trunk/reactos/dll/ntdll/def/ntdll.def (original)
+++ trunk/reactos/dll/ntdll/def/ntdll.def Thu Aug 31 20:56:49 2006
@@ -505,6 +505,7 @@
RtlInitUnicodeStringEx@8
;RtlInitializeAtomPackage
RtlInitializeBitMap@12
+RtlInitializeConditionVariable@4
RtlInitializeContext@20
RtlInitializeCriticalSection@4
RtlInitializeCriticalSectionAndSpinCount@8
@@ -650,6 +651,8 @@
;RtlSetUserFlagsHeap
RtlSetUserValueHeap@16
RtlSizeHeap@12
+RtlSleepConditionVariableCS@12
+RtlSleepConditionVariableSRW@16
RtlSplay@4
;RtlStartRXact
RtlStringFromGUID@8
@@ -703,6 +706,8 @@
RtlValidateUnicodeString@8
RtlVerifyVersionInfo@16
;RtlWalkHeap
+RtlWakeAllConditionVariable@4
+RtlWakeConditionVariable@4
RtlWriteRegistryValue@24
;RtlZeroHeap
RtlZeroMemory@8
Modified: trunk/reactos/dll/win32/kernel32/kernel32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/kernel32.def (original)
+++ trunk/reactos/dll/win32/kernel32/kernel32.def Thu Aug 31 20:56:49 2006
@@ -586,6 +586,7 @@
HeapValidate@12
HeapWalk@8
InitAtomTable@4
+InitializeConditionVariable(a)4=NTDLL.RtlInitializeConditionVariable
InitializeCriticalSection@4
InitializeCriticalSectionAndSpinCount@8
InitializeSListHead(a)4=NTDLL.RtlInitializeSListHead
@@ -900,6 +901,8 @@
SignalObjectAndWait@16
SizeofResource@8
Sleep@4
+SleepConditionVariableCS@12
+SleepConditionVariableSRW@16
SleepEx@8
SuspendThread@4
SwitchToFiber@4
@@ -954,6 +957,8 @@
VirtualQuery@12
VirtualQueryEx@16
VirtualUnlock@8
+WakeAllConditionVariable(a)4=NTDLL.RtlWakeAllConditionVariable
+WakeConditionVariable(a)4=NTDLL.RtlWakeConditionVariable
WaitCommEvent@12
WaitForDebugEvent@8
WaitForMultipleObjects@16
Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/kernel32.rbuild (original)
+++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild Thu Aug 31 20:56:49 2006
@@ -94,6 +94,7 @@
<file>lstring.c</file>
</directory>
<directory name="synch">
+ <file>condvar.c</file>
<file>critical.c</file>
<file>event.c</file>
<file>mutex.c</file>
Added: trunk/reactos/dll/win32/kernel32/synch/condvar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/synch/c…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/synch/condvar.c (added)
+++ trunk/reactos/dll/win32/kernel32/synch/condvar.c Thu Aug 31 20:56:49 2006
@@ -1,0 +1,97 @@
+/* COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * PURPOSE: Condition Variable functions
+ * PROGRAMMER: Thomas Weidenmueller <w3seek(a)reactos.com>
+ */
+
+/* File contains Vista Semantics */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+
+#include <k32.h>
+
+#define NDEBUG
+#include "../include/debug.h"
+
+/* FIXME: Move these RTL declarations to the NDK */
+NTSTATUS
+NTAPI
+RtlSleepConditionVariableCS(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable,
+ IN OUT PRTL_CRITICAL_SECTION CriticalSection,
+ IN PLARGE_INTEGER TimeOut OPTIONAL);
+
+NTSTATUS
+NTAPI
+RtlSleepConditionVariableSRW(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable,
+ IN OUT PRTL_SRWLOCK SRWLock,
+ IN PLARGE_INTEGER TimeOut OPTIONAL,
+ IN ULONG Flags);
+
+/* PUBLIC FUNCTIONS ***********************************************************/
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+SleepConditionVariableCS(IN OUT PCONDITION_VARIABLE ConditionVariable,
+ IN OUT PCRITICAL_SECTION CriticalSection,
+ IN DWORD dwMilliseconds)
+{
+ NTSTATUS Status;
+ LARGE_INTEGER TimeOut;
+ PLARGE_INTEGER TimeOutPtr = NULL;
+
+ if (dwMilliseconds != INFINITE)
+ {
+ TimeOut.QuadPart = UInt32x32To64(-10000, dwMilliseconds);
+ TimeOutPtr = &TimeOut;
+ }
+
+ Status = RtlSleepConditionVariableCS((PRTL_CONDITION_VARIABLE)ConditionVariable,
+ (PRTL_CRITICAL_SECTION)CriticalSection,
+ TimeOutPtr);
+
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+WINAPI
+SleepConditionVariableSRW(IN OUT PCONDITION_VARIABLE ConditionVariable,
+ IN OUT PSRWLOCK SRWLock,
+ IN DWORD dwMilliseconds,
+ IN ULONG Flags)
+{
+ NTSTATUS Status;
+ LARGE_INTEGER TimeOut;
+ PLARGE_INTEGER TimeOutPtr = NULL;
+
+ if (dwMilliseconds != INFINITE)
+ {
+ TimeOut.QuadPart = UInt32x32To64(-10000, dwMilliseconds);
+ TimeOutPtr = &TimeOut;
+ }
+
+ Status = RtlSleepConditionVariableSRW((PRTL_CONDITION_VARIABLE)ConditionVariable,
+ (PRTL_SRWLOCK)SRWLock,
+ TimeOutPtr,
+ Flags);
+
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastErrorByStatus(Status);
+ return FALSE;
+ }
+
+ return TRUE;
+}
Propchange: trunk/reactos/dll/win32/kernel32/synch/condvar.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/include/psdk/winbase.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winbase.h?rev…
==============================================================================
--- trunk/reactos/include/psdk/winbase.h (original)
+++ trunk/reactos/include/psdk/winbase.h Thu Aug 31 20:56:49 2006
@@ -1058,6 +1058,7 @@
} JOB_SET_ARRAY, *PJOB_SET_ARRAY;
#if (_WIN32_WINNT >= 0x0600)
typedef RTL_SRWLOCK SRWLOCK, *PSRWLOCK;
+typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE;
#endif
typedef DWORD(WINAPI
*LPPROGRESS_ROUTINE)(LARGE_INTEGER,LARGE_INTEGER,LARGE_INTEGER,LARGE_INTEGER,DWORD,DWORD,HANDLE,HANDLE,LPVOID);
typedef void(WINAPI *LPFIBER_START_ROUTINE)(PVOID);
@@ -1662,6 +1663,9 @@
BOOL WINAPI ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL);
BOOL WINAPI InitAtomTable(DWORD);
BOOL WINAPI InitializeAcl(PACL,DWORD,DWORD);
+#if (_WIN32_WINNT >= 0x0600)
+VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE);
+#endif
VOID WINAPI InitializeCriticalSection(LPCRITICAL_SECTION);
BOOL WINAPI InitializeCriticalSectionAndSpinCount(LPCRITICAL_SECTION,DWORD);
DWORD WINAPI SetCriticalSectionSpinCount(LPCRITICAL_SECTION,DWORD);
@@ -1978,6 +1982,10 @@
DWORD WINAPI SignalObjectAndWait(HANDLE,HANDLE,DWORD,BOOL);
DWORD WINAPI SizeofResource(HINSTANCE,HRSRC);
void WINAPI Sleep(DWORD);
+#if (_WIN32_WINNT >= 0x0600)
+BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE,PCRITICAL_SECTION,DWORD);
+BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE,PSRWLOCK,DWORD,ULONG);
+#endif
DWORD WINAPI SleepEx(DWORD,BOOL);
DWORD WINAPI SuspendThread(HANDLE);
void WINAPI SwitchToFiber(PVOID);
@@ -2024,6 +2032,10 @@
DWORD WINAPI WaitForSingleObjectEx(HANDLE,DWORD,BOOL);
BOOL WINAPI WaitNamedPipeA(LPCSTR,DWORD);
BOOL WINAPI WaitNamedPipeW(LPCWSTR,DWORD);
+#if (_WIN32_WINNT >= 0x0600)
+VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE);
+VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE);
+#endif
BOOL WINAPI WinLoadTrustProvider(GUID*);
BOOL WINAPI WriteFile(HANDLE,PCVOID,DWORD,PDWORD,LPOVERLAPPED);
BOOL WINAPI
WriteFileEx(HANDLE,PCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE);
Added: trunk/reactos/lib/rtl/condvar.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/condvar.c?rev=2384…
==============================================================================
--- trunk/reactos/lib/rtl/condvar.c (added)
+++ trunk/reactos/lib/rtl/condvar.c Thu Aug 31 20:56:49 2006
@@ -1,0 +1,61 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * PURPOSE: Condition Variable Routines
+ * PROGRAMMER: Thomas Weidenmueller <w3seek(a)reactos.com>
+ */
+
+/* INCLUDES *****************************************************************/
+
+#include <rtl.h>
+
+#define NDEBUG
+#include <debug.h>
+
+/* FUNCTIONS *****************************************************************/
+
+VOID
+NTAPI
+RtlInitializeConditionVariable(OUT PRTL_CONDITION_VARIABLE ConditionVariable)
+{
+ ConditionVariable->Ptr = NULL;
+}
+
+
+VOID
+NTAPI
+RtlWakeConditionVariable(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable)
+{
+ UNIMPLEMENTED;
+}
+
+
+VOID
+NTAPI
+RtlWakeAllConditionVariable(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable)
+{
+ UNIMPLEMENTED;
+}
+
+
+NTSTATUS
+NTAPI
+RtlSleepConditionVariableCS(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable,
+ IN OUT PRTL_CRITICAL_SECTION CriticalSection,
+ IN PLARGE_INTEGER TimeOut OPTIONAL)
+{
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+NTSTATUS
+NTAPI
+RtlSleepConditionVariableSRW(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable,
+ IN OUT PRTL_SRWLOCK SRWLock,
+ IN PLARGE_INTEGER TimeOut OPTIONAL,
+ IN ULONG Flags)
+{
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
Propchange: trunk/reactos/lib/rtl/condvar.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/lib/rtl/rtl.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=238…
==============================================================================
--- trunk/reactos/lib/rtl/rtl.rbuild (original)
+++ trunk/reactos/lib/rtl/rtl.rbuild Thu Aug 31 20:56:49 2006
@@ -47,6 +47,7 @@
<file>bitmap.c</file>
<file>bootdata.c</file>
<file>compress.c</file>
+ <file>condvar.c</file>
<file>crc32.c</file>
<file>critical.c</file>
<file>dbgbuffer.c</file>