https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5aefc6f49a048c2d8b6ab…
commit 5aefc6f49a048c2d8b6ab91fbcda792dee63191b
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Apr 8 11:09:54 2018 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Apr 8 17:30:44 2018 +0200
[KERNEL32_VISTA] Export InitializeCriticalSectionEx.
---
dll/apisets/api-ms-win-core-synch-l1-1-0.spec | 2 +-
dll/apisets/api-ms-win-core-synch-l1-2-0.spec | 2 +-
dll/apisets/api-ms-win-core-synch-l1-2-1.spec | 2 +-
dll/win32/kernel32_vista/k32_vista.h | 1 +
dll/win32/kernel32_vista/kernel32_vista.spec | 2 ++
dll/win32/kernel32_vista/sync.c | 28 +++++++++++++++++++++++++++
6 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/dll/apisets/api-ms-win-core-synch-l1-1-0.spec
b/dll/apisets/api-ms-win-core-synch-l1-1-0.spec
index ab22da2ec4..de4c2f4f3e 100644
--- a/dll/apisets/api-ms-win-core-synch-l1-1-0.spec
+++ b/dll/apisets/api-ms-win-core-synch-l1-1-0.spec
@@ -18,7 +18,7 @@
@ stdcall EnterCriticalSection() kernel32.EnterCriticalSection
@ stdcall InitializeCriticalSection() kernel32.InitializeCriticalSection
@ stdcall InitializeCriticalSectionAndSpinCount()
kernel32.InitializeCriticalSectionAndSpinCount
-@ stub InitializeCriticalSectionEx
+@ stdcall InitializeCriticalSectionEx() kernel32_vista.InitializeCriticalSectionEx
@ stdcall InitializeSRWLock() kernel32_vista.InitializeSRWLock
@ stdcall LeaveCriticalSection() kernel32.LeaveCriticalSection
@ stdcall OpenEventA() kernel32.OpenEventA
diff --git a/dll/apisets/api-ms-win-core-synch-l1-2-0.spec
b/dll/apisets/api-ms-win-core-synch-l1-2-0.spec
index 78f9a6137c..778abd9aad 100644
--- a/dll/apisets/api-ms-win-core-synch-l1-2-0.spec
+++ b/dll/apisets/api-ms-win-core-synch-l1-2-0.spec
@@ -25,7 +25,7 @@
@ stdcall InitializeConditionVariable() kernel32_vista.InitializeConditionVariable
@ stdcall InitializeCriticalSection() kernel32.InitializeCriticalSection
@ stdcall InitializeCriticalSectionAndSpinCount()
kernel32.InitializeCriticalSectionAndSpinCount
-@ stub InitializeCriticalSectionEx
+@ stdcall InitializeCriticalSectionEx() kernel32_vista.InitializeCriticalSectionEx
@ stdcall InitializeSRWLock() kernel32_vista.InitializeSRWLock
@ stub InitializeSynchronizationBarrier
@ stdcall LeaveCriticalSection() kernel32.LeaveCriticalSection
diff --git a/dll/apisets/api-ms-win-core-synch-l1-2-1.spec
b/dll/apisets/api-ms-win-core-synch-l1-2-1.spec
index 37270fd434..d147b86c29 100644
--- a/dll/apisets/api-ms-win-core-synch-l1-2-1.spec
+++ b/dll/apisets/api-ms-win-core-synch-l1-2-1.spec
@@ -23,7 +23,7 @@
@ stdcall InitializeConditionVariable() kernel32_vista.InitializeConditionVariable
@ stdcall InitializeCriticalSection() kernel32.InitializeCriticalSection
@ stdcall InitializeCriticalSectionAndSpinCount()
kernel32.InitializeCriticalSectionAndSpinCount
-@ stub InitializeCriticalSectionEx
+@ stdcall InitializeCriticalSectionEx() kernel32_vista.InitializeCriticalSectionEx
@ stdcall InitializeSRWLock() kernel32_vista.InitializeSRWLock
@ stub InitializeSynchronizationBarrier
@ stub InitOnceBeginInitialize
diff --git a/dll/win32/kernel32_vista/k32_vista.h b/dll/win32/kernel32_vista/k32_vista.h
index 45c8bfe4c8..fff9ba8d0b 100644
--- a/dll/win32/kernel32_vista/k32_vista.h
+++ b/dll/win32/kernel32_vista/k32_vista.h
@@ -8,4 +8,5 @@
#include <ndk/kefuncs.h>
#include <ndk/psfuncs.h>
+#include <ndk/rtlfuncs.h>
diff --git a/dll/win32/kernel32_vista/kernel32_vista.spec
b/dll/win32/kernel32_vista/kernel32_vista.spec
index caa7adcf7f..f61e6e6dc3 100644
--- a/dll/win32/kernel32_vista/kernel32_vista.spec
+++ b/dll/win32/kernel32_vista/kernel32_vista.spec
@@ -14,3 +14,5 @@
@ stdcall SleepConditionVariableSRW(ptr ptr long long)
@ stdcall WakeAllConditionVariable(ptr)
@ stdcall WakeConditionVariable(ptr)
+
+@ stdcall InitializeCriticalSectionEx(ptr long long)
diff --git a/dll/win32/kernel32_vista/sync.c b/dll/win32/kernel32_vista/sync.c
index a13f984f34..17d394955d 100644
--- a/dll/win32/kernel32_vista/sync.c
+++ b/dll/win32/kernel32_vista/sync.c
@@ -148,3 +148,31 @@ WakeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
{
RtlWakeConditionVariable((PRTL_CONDITION_VARIABLE)ConditionVariable);
}
+
+
+/*
+* @implemented
+*/
+BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection,
+ IN DWORD dwSpinCount,
+ IN DWORD flags)
+{
+ NTSTATUS Status;
+
+ /* FIXME: Flags ignored */
+
+ /* Initialize the critical section */
+ Status = RtlInitializeCriticalSectionAndSpinCount(
+ (PRTL_CRITICAL_SECTION)lpCriticalSection,
+ dwSpinCount);
+ if (!NT_SUCCESS(Status))
+ {
+ /* Set failure code */
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ /* Success */
+ return TRUE;
+}
+