https://git.reactos.org/?p=reactos.git;a=commitdiff;h=86f2d4cd4ed5f306aafcc…
commit 86f2d4cd4ed5f306aafcce362bdebd63f9283f7b
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Aug 12 19:33:46 2023 +0300
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Dec 16 13:52:15 2023 +0200
[NTDLL] Initialize keyed event for condition variables
---
dll/ntdll/include/ntdllp.h | 5 +++++
dll/ntdll/ldr/ldrinit.c | 5 +++++
dll/ntdll/nt_0600/DllMain.c | 2 ++
dll/win32/kernel32/kernel32.spec | 2 +-
sdk/lib/rtl/condvar.c | 2 ++
5 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/dll/ntdll/include/ntdllp.h b/dll/ntdll/include/ntdllp.h
index 42a164514b0..cb5b6cad02f 100644
--- a/dll/ntdll/include/ntdllp.h
+++ b/dll/ntdll/include/ntdllp.h
@@ -226,4 +226,9 @@ RtlDoesFileExists_UStr(
IN PUNICODE_STRING FileName
);
+VOID
+NTAPI
+RtlpInitializeKeyedEvent(
+ VOID);
+
/* EOF */
diff --git a/dll/ntdll/ldr/ldrinit.c b/dll/ntdll/ldr/ldrinit.c
index 03e80968f3d..24730bb80da 100644
--- a/dll/ntdll/ldr/ldrinit.c
+++ b/dll/ntdll/ldr/ldrinit.c
@@ -2405,6 +2405,11 @@ LdrpInitializeProcess(IN PCONTEXT Context,
/* Check whether all static imports were properly loaded and return here */
if (!NT_SUCCESS(ImportStatus)) return ImportStatus;
+#if (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA)
+ /* Initialize the keyed event for condition variables */
+ RtlpInitializeKeyedEvent();
+#endif
+
/* Initialize TLS */
Status = LdrpInitializeTls();
if (!NT_SUCCESS(Status))
diff --git a/dll/ntdll/nt_0600/DllMain.c b/dll/ntdll/nt_0600/DllMain.c
index 9266b525aa4..90a01419b97 100644
--- a/dll/ntdll/nt_0600/DllMain.c
+++ b/dll/ntdll/nt_0600/DllMain.c
@@ -14,9 +14,11 @@
#include <debug.h>
VOID
+NTAPI
RtlpInitializeKeyedEvent(VOID);
VOID
+NTAPI
RtlpCloseKeyedEvent(VOID);
BOOL
diff --git a/dll/win32/kernel32/kernel32.spec b/dll/win32/kernel32/kernel32.spec
index 5fe3047cb42..6c963fe5b6e 100644
--- a/dll/win32/kernel32/kernel32.spec
+++ b/dll/win32/kernel32/kernel32.spec
@@ -711,7 +711,7 @@
@ stdcall -version=0x600+ InitOnceBeginInitialize(ptr long ptr ptr)
@ stdcall -version=0x600+ InitOnceComplete(ptr long ptr)
@ stdcall -version=0x600+ InitOnceExecuteOnce(ptr ptr ptr ptr)
-@ stdcall -version=0x600+ InitOnceInitialize(ptr) NTDLL.RtlRunOnceInitialize
+@ stdcall -version=0x600+ InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
@ stdcall -version=0x600+ InitializeConditionVariable(ptr)
ntdll.RtlInitializeConditionVariable
@ stdcall InitializeCriticalSection(ptr)
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long)
diff --git a/sdk/lib/rtl/condvar.c b/sdk/lib/rtl/condvar.c
index edbe074cd99..f7f9d01533c 100644
--- a/sdk/lib/rtl/condvar.c
+++ b/sdk/lib/rtl/condvar.c
@@ -456,6 +456,7 @@ InternalSleep(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable,
}
VOID
+NTAPI
RtlpInitializeKeyedEvent(VOID)
{
ASSERT(CondVarKeyedEventHandle == NULL);
@@ -463,6 +464,7 @@ RtlpInitializeKeyedEvent(VOID)
}
VOID
+NTAPI
RtlpCloseKeyedEvent(VOID)
{
ASSERT(CondVarKeyedEventHandle != NULL);