Author: tfaber
Date: Thu Jun 15 06:47:42 2017
New Revision: 75043
URL:
http://svn.reactos.org/svn/reactos?rev=75043&view=rev
Log:
[RTL]
- Implement RtlIsCriticalSectionLocked and RtlIsCriticalSectionLockedByThread
CORE-13436 #resolve
Modified:
trunk/reactos/dll/ntdll/def/ntdll.spec
trunk/reactos/sdk/include/ndk/rtlfuncs.h
trunk/reactos/sdk/lib/rtl/critical.c
Modified: trunk/reactos/dll/ntdll/def/ntdll.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/def/ntdll.spec?r…
==============================================================================
--- trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/ntdll/def/ntdll.spec [iso-8859-1] Thu Jun 15 06:47:42 2017
@@ -736,8 +736,8 @@
732 stdcall RtlIpv6StringToAddressExW(wstr ptr ptr ptr)
733 stdcall RtlIpv6StringToAddressW(wstr ptr ptr)
734 stdcall RtlIsActivationContextActive(ptr)
-# stdcall RtlIsCriticalSectionLocked
-# stdcall RtlIsCriticalSectionLockedByThread
+735 stdcall RtlIsCriticalSectionLocked(ptr)
+736 stdcall RtlIsCriticalSectionLockedByThread(ptr)
737 stdcall RtlIsDosDeviceName_U(wstr)
738 stdcall RtlIsGenericTableEmpty(ptr)
739 stdcall RtlIsGenericTableEmptyAvl(ptr)
Modified: trunk/reactos/sdk/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/include/ndk/rtlfuncs.h…
==============================================================================
--- trunk/reactos/sdk/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/sdk/include/ndk/rtlfuncs.h [iso-8859-1] Thu Jun 15 06:47:42 2017
@@ -3023,6 +3023,20 @@
RtlInitializeCriticalSectionAndSpinCount(
_In_ PRTL_CRITICAL_SECTION CriticalSection,
_In_ ULONG SpinCount
+);
+
+NTSYSAPI
+ULONG
+NTAPI
+RtlIsCriticalSectionLocked(
+ _In_ PRTL_CRITICAL_SECTION CriticalSection
+);
+
+NTSYSAPI
+ULONG
+NTAPI
+RtlIsCriticalSectionLockedByThread(
+ _In_ PRTL_CRITICAL_SECTION CriticalSection
);
NTSYSAPI
Modified: trunk/reactos/sdk/lib/rtl/critical.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/rtl/critical.c?rev…
==============================================================================
--- trunk/reactos/sdk/lib/rtl/critical.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/rtl/critical.c [iso-8859-1] Thu Jun 15 06:47:42 2017
@@ -786,4 +786,19 @@
UNIMPLEMENTED;
}
+ULONG
+NTAPI
+RtlIsCriticalSectionLocked(PRTL_CRITICAL_SECTION CriticalSection)
+{
+ return CriticalSection->RecursionCount != 0;
+}
+
+ULONG
+NTAPI
+RtlIsCriticalSectionLockedByThread(PRTL_CRITICAL_SECTION CriticalSection)
+{
+ return CriticalSection->OwningThread == NtCurrentTeb()->ClientId.UniqueThread
&&
+ CriticalSection->RecursionCount != 0;
+}
+
/* EOF */