Commit aa7f8e93 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Move critical section functions to kernelbase.

parent d33d05ce
......@@ -946,9 +946,9 @@
@ stdcall InitOnceInitialize(ptr) ntdll.RtlRunOnceInitialize
@ stdcall InitializeConditionVariable(ptr) ntdll.RtlInitializeConditionVariable
# @ stub InitializeContext
@ stdcall InitializeCriticalSection(ptr)
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long)
@ stdcall InitializeCriticalSectionEx(ptr long long)
@ stdcall InitializeCriticalSection(ptr) ntdll.RtlInitializeCriticalSection
@ stdcall -import InitializeCriticalSectionAndSpinCount(ptr long)
@ stdcall -import InitializeCriticalSectionEx(ptr long long)
@ stdcall InitializeProcThreadAttributeList(ptr long long ptr)
@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead
@ stdcall InitializeSRWLock(ptr) ntdll.RtlInitializeSRWLock
......
......@@ -308,67 +308,6 @@ DWORD WINAPI SignalObjectAndWait( HANDLE hObjectToSignal, HANDLE hObjectToWaitOn
}
/***********************************************************************
* InitializeCriticalSection (KERNEL32.@)
*
* Initialise a critical section before use.
*
* PARAMS
* crit [O] Critical section to initialise.
*
* RETURNS
* Nothing. If the function fails an exception is raised.
*/
void WINAPI InitializeCriticalSection( CRITICAL_SECTION *crit )
{
InitializeCriticalSectionEx( crit, 0, 0 );
}
/***********************************************************************
* InitializeCriticalSectionAndSpinCount (KERNEL32.@)
*
* Initialise a critical section with a spin count.
*
* PARAMS
* crit [O] Critical section to initialise.
* spincount [I] Number of times to spin upon contention.
*
* RETURNS
* Success: TRUE.
* Failure: Nothing. If the function fails an exception is raised.
*
* NOTES
* spincount is ignored on uni-processor systems.
*/
BOOL WINAPI InitializeCriticalSectionAndSpinCount( CRITICAL_SECTION *crit, DWORD spincount )
{
return InitializeCriticalSectionEx( crit, spincount, 0 );
}
/***********************************************************************
* InitializeCriticalSectionEx (KERNEL32.@)
*
* Initialise a critical section with a spin count and flags.
*
* PARAMS
* crit [O] Critical section to initialise.
* spincount [I] Number of times to spin upon contention.
* flags [I] CRITICAL_SECTION_ flags from winbase.h.
*
* RETURNS
* Success: TRUE.
* Failure: Nothing. If the function fails an exception is raised.
*
* NOTES
* spincount is ignored on uni-processor systems.
*/
BOOL WINAPI InitializeCriticalSectionEx( CRITICAL_SECTION *crit, DWORD spincount, DWORD flags )
{
NTSTATUS ret = RtlInitializeCriticalSectionEx( crit, spincount, flags );
if (ret) RtlRaiseStatus( ret );
return !ret;
}
/***********************************************************************
* MakeCriticalSectionGlobal (KERNEL32.@)
*/
void WINAPI MakeCriticalSectionGlobal( CRITICAL_SECTION *crit )
......
......@@ -802,8 +802,8 @@
@ stdcall InitializeConditionVariable(ptr) kernel32.InitializeConditionVariable
# @ stub InitializeContext
@ stdcall InitializeCriticalSection(ptr) kernel32.InitializeCriticalSection
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) kernel32.InitializeCriticalSectionAndSpinCount
@ stdcall InitializeCriticalSectionEx(ptr long long) kernel32.InitializeCriticalSectionEx
@ stdcall InitializeCriticalSectionAndSpinCount(ptr long)
@ stdcall InitializeCriticalSectionEx(ptr long long)
# @ stub InitializeEnclave
@ stdcall InitializeProcThreadAttributeList(ptr long long ptr) kernel32.InitializeProcThreadAttributeList
# @ stub InitializeProcessForWsWatch
......
......@@ -592,3 +592,28 @@ BOOL WINAPI DECLSPEC_HOTPATCH DeleteTimerQueueTimer( HANDLE queue, HANDLE timer,
{
return set_ntstatus( RtlDeleteTimer( queue, timer, event ));
}
/***********************************************************************
* Critical sections
***********************************************************************/
/***********************************************************************
* InitializeCriticalSectionAndSpinCount (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH InitializeCriticalSectionAndSpinCount( CRITICAL_SECTION *crit, DWORD count )
{
return !RtlInitializeCriticalSectionAndSpinCount( crit, count );
}
/***********************************************************************
* InitializeCriticalSectionEx (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH InitializeCriticalSectionEx( CRITICAL_SECTION *crit, DWORD spincount,
DWORD flags )
{
NTSTATUS ret = RtlInitializeCriticalSectionEx( crit, spincount, flags );
if (ret) RtlRaiseStatus( ret );
return !ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment