ReactOS 0.4.15-dev-8127-g6338913
sync.c
Go to the documentation of this file.
1#include "k32_vista.h"
2
3#define NDEBUG
4#include <debug.h>
5
9
10VOID
13
14VOID
17
22 IN PLARGE_INTEGER TimeOut OPTIONAL);
23
27 IN OUT PRTL_SRWLOCK SRWLock,
29 IN ULONG Flags);
30
31VOID
34
35VOID
38
39VOID
42
43VOID
46
47VOID
50
51
52VOID
55{
57}
58
59VOID
62{
64}
65
66VOID
68InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
69{
71}
72
73VOID
76{
78}
79
80VOID
83{
85}
86
87VOID
90{
92}
93
97{
98 if (Timeout == INFINITE) return NULL;
99 Time->QuadPart = (ULONGLONG)Timeout * -10000;
100 return Time;
101}
102
103BOOL
104WINAPI
106{
109
112 {
114 return FALSE;
115 }
116 return TRUE;
117}
118
119BOOL
120WINAPI
121SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK Lock, DWORD Timeout, ULONG Flags)
122{
125
128 {
130 return FALSE;
131 }
132 return TRUE;
133}
134
135VOID
136WINAPI
137WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
138{
140}
141
142VOID
143WINAPI
144WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
145{
147}
148
149
150/*
151* @implemented
152*/
154 IN DWORD dwSpinCount,
155 IN DWORD flags)
156{
158
159 /* FIXME: Flags ignored */
160
161 /* Initialize the critical section */
163 (PRTL_CRITICAL_SECTION)lpCriticalSection,
164 dwSpinCount);
165 if (!NT_SUCCESS(Status))
166 {
167 /* Set failure code */
169 return FALSE;
170 }
171
172 /* Success */
173 return TRUE;
174}
175
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SetLastError(x)
Definition: compat.h:752
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:89
FORCEINLINE PLARGE_INTEGER GetNtTimeout(PLARGE_INTEGER Time, DWORD Timeout)
Definition: sync.c:96
NTSTATUS NTAPI RtlSleepConditionVariableSRW(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable, IN OUT PRTL_SRWLOCK SRWLock, IN PLARGE_INTEGER TimeOut OPTIONAL, IN ULONG Flags)
NTSTATUS NTAPI RtlSleepConditionVariableCS(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable, IN OUT PRTL_CRITICAL_SECTION CriticalSection, IN PLARGE_INTEGER TimeOut OPTIONAL)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:54
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
Definition: sync.c:61
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
Definition: sync.c:82
VOID NTAPI RtlReleaseSRWLockExclusive(IN OUT PRTL_SRWLOCK SRWLock)
Definition: srw.c:710
VOID NTAPI RtlInitializeConditionVariable(OUT PRTL_CONDITION_VARIABLE ConditionVariable)
Definition: condvar.c:479
BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD Timeout)
Definition: sync.c:105
VOID WINAPI InitializeSRWLock(PSRWLOCK Lock)
Definition: sync.c:75
VOID NTAPI RtlInitializeSRWLock(OUT PRTL_SRWLOCK SRWLock)
Definition: srw.c:317
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:137
VOID NTAPI RtlAcquireSRWLockExclusive(IN OUT PRTL_SRWLOCK SRWLock)
Definition: srw.c:591
BOOL WINAPI SleepConditionVariableSRW(PCONDITION_VARIABLE ConditionVariable, PSRWLOCK Lock, DWORD Timeout, ULONG Flags)
Definition: sync.c:121
VOID NTAPI RtlWakeAllConditionVariable(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable)
Definition: condvar.c:493
VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:68
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:153
VOID NTAPI RtlWakeConditionVariable(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable)
Definition: condvar.c:486
VOID NTAPI RtlReleaseSRWLockShared(IN OUT PRTL_SRWLOCK SRWLock)
Definition: srw.c:526
VOID NTAPI RtlAcquireSRWLockShared(IN OUT PRTL_SRWLOCK SRWLock)
Definition: srw.c:325
VOID WINAPI WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:144
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
GLbitfield flags
Definition: glext.h:7161
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
CRITICAL_SECTION CriticalSection
Definition: iprtprio.c:40
static PSRWLOCK
Definition: sync.c:49
static PLARGE_INTEGER Time
Definition: time.c:105
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSectionAndSpinCount(_In_ PRTL_CRITICAL_SECTION CriticalSection, _In_ ULONG SpinCount)
#define STATUS_TIMEOUT
Definition: ntstatus.h:81
static ULONG Timeout
Definition: ping.c:61
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
#define OUT
Definition: typedefs.h:40
LONGLONG QuadPart
Definition: typedefs.h:114
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
#define FORCEINLINE
Definition: wdftypes.h:67
#define WINAPI
Definition: msvc.h:6
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170