[KERNEL32_VISTA][SDK] Move SRW definitions to NDK (#6806)

Move SRW and condition variable definitions out of kernel32_vista and into the NDK.

Essentially grabbed from PR #1190
Trying to reduce diff needed for Rtl/ntdll sync.
This commit is contained in:
Justin Miller 2024-06-11 20:03:57 +00:00 committed by GitHub
parent 4fe33fe9d5
commit bc6c731db3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 55 additions and 48 deletions

View file

@ -3,52 +3,6 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
VOID
NTAPI
RtlInitializeConditionVariable(OUT PRTL_CONDITION_VARIABLE ConditionVariable);
VOID
NTAPI
RtlWakeConditionVariable(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable);
VOID
NTAPI
RtlWakeAllConditionVariable(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable);
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);
VOID
NTAPI
RtlInitializeSRWLock(OUT PRTL_SRWLOCK SRWLock);
VOID
NTAPI
RtlAcquireSRWLockShared(IN OUT PRTL_SRWLOCK SRWLock);
VOID
NTAPI
RtlReleaseSRWLockShared(IN OUT PRTL_SRWLOCK SRWLock);
VOID
NTAPI
RtlAcquireSRWLockExclusive(IN OUT PRTL_SRWLOCK SRWLock);
VOID
NTAPI
RtlReleaseSRWLockExclusive(IN OUT PRTL_SRWLOCK SRWLock);
VOID VOID
WINAPI WINAPI
AcquireSRWLockExclusive(PSRWLOCK Lock) AcquireSRWLockExclusive(PSRWLOCK Lock)

View file

@ -4693,6 +4693,46 @@ BOOLEAN
NTAPI NTAPI
RtlGetNtProductType(_Out_ PNT_PRODUCT_TYPE ProductType); RtlGetNtProductType(_Out_ PNT_PRODUCT_TYPE ProductType);
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
//
// Synchronization functions
//
NTSYSAPI
VOID
NTAPI
RtlInitializeConditionVariable(
_Out_ PRTL_CONDITION_VARIABLE ConditionVariable);
NTSYSAPI
VOID
NTAPI
RtlWakeConditionVariable(
_Inout_ PRTL_CONDITION_VARIABLE ConditionVariable);
NTSYSAPI
VOID
NTAPI
RtlWakeAllConditionVariable(
_Inout_ PRTL_CONDITION_VARIABLE ConditionVariable);
NTSYSAPI
NTSTATUS
NTAPI
RtlSleepConditionVariableCS(
_Inout_ PRTL_CONDITION_VARIABLE ConditionVariable,
_Inout_ PRTL_CRITICAL_SECTION CriticalSection,
_In_opt_ PLARGE_INTEGER TimeOut);
NTSYSAPI
NTSTATUS
NTAPI
RtlSleepConditionVariableSRW(
_Inout_ PRTL_CONDITION_VARIABLE ConditionVariable,
_Inout_ PRTL_SRWLOCK SRWLock,
_In_opt_ PLARGE_INTEGER TimeOut,
_In_ ULONG Flags);
#endif
// //
// Secure Memory Functions // Secure Memory Functions
// //

View file

@ -279,6 +279,19 @@ typedef struct _OSVERSIONINFOEXW {
UCHAR wReserved; UCHAR wReserved;
} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW; } OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
#define RTL_CONDITION_VARIABLE_INIT {0}
#define RTL_CONDITION_VARIABLE_LOCKMODE_SHARED 0x1
typedef struct _RTL_CONDITION_VARIABLE {
PVOID Ptr;
} RTL_CONDITION_VARIABLE, *PRTL_CONDITION_VARIABLE;
#define RTL_SRWLOCK_INIT {0}
typedef struct _RTL_SRWLOCK {
PVOID Ptr;
} RTL_SRWLOCK, *PRTL_SRWLOCK;
#ifdef UNICODE #ifdef UNICODE
typedef OSVERSIONINFOEXW OSVERSIONINFOEX; typedef OSVERSIONINFOEXW OSVERSIONINFOEX;
typedef POSVERSIONINFOEXW POSVERSIONINFOEX; typedef POSVERSIONINFOEXW POSVERSIONINFOEX;

View file

@ -499,7 +499,7 @@ NTSTATUS
NTAPI NTAPI
RtlSleepConditionVariableCS(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable, RtlSleepConditionVariableCS(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable,
IN OUT PRTL_CRITICAL_SECTION CriticalSection, IN OUT PRTL_CRITICAL_SECTION CriticalSection,
IN const LARGE_INTEGER * TimeOut OPTIONAL) IN PLARGE_INTEGER TimeOut OPTIONAL)
{ {
return InternalSleep(ConditionVariable, return InternalSleep(ConditionVariable,
CriticalSection, CriticalSection,
@ -512,7 +512,7 @@ NTSTATUS
NTAPI NTAPI
RtlSleepConditionVariableSRW(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable, RtlSleepConditionVariableSRW(IN OUT PRTL_CONDITION_VARIABLE ConditionVariable,
IN OUT PRTL_SRWLOCK SRWLock, IN OUT PRTL_SRWLOCK SRWLock,
IN const LARGE_INTEGER * TimeOut OPTIONAL, IN PLARGE_INTEGER TimeOut OPTIONAL,
IN ULONG Flags) IN ULONG Flags)
{ {
return InternalSleep(ConditionVariable, return InternalSleep(ConditionVariable,