mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[RTL]
- Implement and export RtlGetCriticalSectionRecursionCount (introduced in NT 5.2 SP1, see http://www.geoffchappell.com/studies/windows/win32/ntdll/history/names52.htm) which definition comes from http://processhacker.sourceforge.net/doc/ntrtl_8h.html#a26bd65dfad63985a247700c2c2ab9e86. - Fix the return type of RtlSetCriticalSectionSpinCount. - Export the already-existing RtlQueryInformationActiveActivationContext API. RtlQueryInformationActiveActivationContext and RtlGetCriticalSectionRecursionCount are needed by Win2k3 user32.dll and winsrv.dll . svn path=/trunk/; revision=60302
This commit is contained in:
parent
cb93b06d35
commit
5b90b42861
2 changed files with 43 additions and 4 deletions
|
@ -614,7 +614,7 @@
|
||||||
@ stdcall RtlGetCallersAddress(ptr ptr)
|
@ stdcall RtlGetCallersAddress(ptr ptr)
|
||||||
@ stdcall RtlGetCompressionWorkSpaceSize(long ptr ptr)
|
@ stdcall RtlGetCompressionWorkSpaceSize(long ptr ptr)
|
||||||
@ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr)
|
@ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr)
|
||||||
;@ stdcall RtlGetCriticalSectionRecursionCount
|
@ stdcall RtlGetCriticalSectionRecursionCount(ptr)
|
||||||
@ stdcall RtlGetCurrentDirectory_U(long ptr)
|
@ stdcall RtlGetCurrentDirectory_U(long ptr)
|
||||||
@ stdcall RtlGetCurrentPeb()
|
@ stdcall RtlGetCurrentPeb()
|
||||||
@ stdcall RtlGetCurrentProcessorNumber() ; 5.2 SP1 and higher
|
@ stdcall RtlGetCurrentProcessorNumber() ; 5.2 SP1 and higher
|
||||||
|
@ -780,7 +780,7 @@
|
||||||
@ stdcall RtlQueryHeapInformation(long long ptr long ptr)
|
@ stdcall RtlQueryHeapInformation(long long ptr long ptr)
|
||||||
@ stdcall RtlQueryInformationAcl(ptr ptr long long)
|
@ stdcall RtlQueryInformationAcl(ptr ptr long long)
|
||||||
@ stdcall RtlQueryInformationActivationContext(long long ptr long ptr long ptr)
|
@ stdcall RtlQueryInformationActivationContext(long long ptr long ptr long ptr)
|
||||||
;@ stdcall RtlQueryInformationActiveActivationContext
|
@ stdcall RtlQueryInformationActiveActivationContext(long ptr long ptr)
|
||||||
;@ stdcall RtlQueryInterfaceMemoryStream
|
;@ stdcall RtlQueryInterfaceMemoryStream
|
||||||
;@ stdcall RtlQueryProcessBackTraceInformation
|
;@ stdcall RtlQueryProcessBackTraceInformation
|
||||||
@ stdcall RtlQueryProcessDebugInformation(long long ptr)
|
@ stdcall RtlQueryProcessDebugInformation(long long ptr)
|
||||||
|
|
|
@ -299,7 +299,7 @@ RtlpAllocateDebugInfo(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We are out of static buffer, allocate dynamic */
|
/* We are out of static buffer, allocate dynamic */
|
||||||
return RtlAllocateHeap(NtCurrentPeb()->ProcessHeap,
|
return RtlAllocateHeap(RtlGetProcessHeap(),
|
||||||
0,
|
0,
|
||||||
sizeof(RTL_CRITICAL_SECTION_DEBUG));
|
sizeof(RTL_CRITICAL_SECTION_DEBUG));
|
||||||
}
|
}
|
||||||
|
@ -436,7 +436,7 @@ RtlDeleteCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
|
||||||
* SpinCount is ignored on single-processor systems.
|
* SpinCount is ignored on single-processor systems.
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
DWORD
|
ULONG
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlSetCriticalSectionSpinCount(PRTL_CRITICAL_SECTION CriticalSection,
|
RtlSetCriticalSectionSpinCount(PRTL_CRITICAL_SECTION CriticalSection,
|
||||||
ULONG SpinCount)
|
ULONG SpinCount)
|
||||||
|
@ -618,6 +618,45 @@ RtlInitializeCriticalSectionAndSpinCount(PRTL_CRITICAL_SECTION CriticalSection,
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*++
|
||||||
|
* RtlGetCriticalSectionRecursionCount
|
||||||
|
* @implemented NT5.2 SP1
|
||||||
|
*
|
||||||
|
* Retrieves the recursion count of a given critical section.
|
||||||
|
*
|
||||||
|
* Params:
|
||||||
|
* CriticalSection - Critical section to retrieve its recursion count.
|
||||||
|
*
|
||||||
|
* Returns:
|
||||||
|
* The recursion count.
|
||||||
|
*
|
||||||
|
* Remarks:
|
||||||
|
* We return the recursion count of the critical section if it is owned
|
||||||
|
* by the current thread, and otherwise we return zero.
|
||||||
|
*
|
||||||
|
*--*/
|
||||||
|
LONG
|
||||||
|
NTAPI
|
||||||
|
RtlGetCriticalSectionRecursionCount(PRTL_CRITICAL_SECTION CriticalSection)
|
||||||
|
{
|
||||||
|
if (CriticalSection->OwningThread == NtCurrentTeb()->ClientId.UniqueThread)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* The critical section is owned by the current thread,
|
||||||
|
* therefore retrieve its actual recursion count.
|
||||||
|
*/
|
||||||
|
return CriticalSection->RecursionCount;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* It is not owned by the current thread, so
|
||||||
|
* for this thread there is no recursion.
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*++
|
/*++
|
||||||
* RtlLeaveCriticalSection
|
* RtlLeaveCriticalSection
|
||||||
* @implemented NT4
|
* @implemented NT4
|
||||||
|
|
Loading…
Reference in a new issue