mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
Implementation of InitializeCriticalSectionAndSpinCount and RtlInitializeCriticalSectionAndSpinCount.
svn path=/trunk/; revision=7914
This commit is contained in:
parent
7ecc5dcb3f
commit
de69dfa6c7
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: rtl.h,v 1.40 2003/09/12 17:51:46 vizzini Exp $
|
/* $Id: rtl.h,v 1.41 2004/01/29 23:41:36 navaraf Exp $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ typedef struct _CRITICAL_SECTION {
|
||||||
LONG RecursionCount;
|
LONG RecursionCount;
|
||||||
HANDLE OwningThread;
|
HANDLE OwningThread;
|
||||||
HANDLE LockSemaphore;
|
HANDLE LockSemaphore;
|
||||||
DWORD Reserved;
|
ULONG_PTR SpinCount;
|
||||||
} CRITICAL_SECTION, *PCRITICAL_SECTION, *LPCRITICAL_SECTION;
|
} CRITICAL_SECTION, *PCRITICAL_SECTION, *LPCRITICAL_SECTION;
|
||||||
|
|
||||||
typedef CRITICAL_SECTION RTL_CRITICAL_SECTION;
|
typedef CRITICAL_SECTION RTL_CRITICAL_SECTION;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubs.c,v 1.60 2004/01/23 17:15:23 ekohl Exp $
|
/* $Id: stubs.c,v 1.61 2004/01/29 23:41:36 navaraf Exp $
|
||||||
*
|
*
|
||||||
* KERNEL32.DLL stubs (unimplemented functions)
|
* KERNEL32.DLL stubs (unimplemented functions)
|
||||||
* Remove from this file, if you implement them.
|
* Remove from this file, if you implement them.
|
||||||
|
@ -1104,20 +1104,6 @@ HeapSetInformation (
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
BOOL
|
|
||||||
STDCALL
|
|
||||||
InitializeCriticalSectionAndSpinCount(
|
|
||||||
LPCRITICAL_SECTION lpCriticalSection,
|
|
||||||
DWORD dwSpinCount
|
|
||||||
)
|
|
||||||
{
|
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: critical.c,v 1.15 2004/01/23 21:16:04 ekohl Exp $
|
/* $Id: critical.c,v 1.16 2004/01/29 23:41:36 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -33,4 +33,24 @@ InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
BOOL
|
||||||
|
STDCALL
|
||||||
|
InitializeCriticalSectionAndSpinCount(
|
||||||
|
LPCRITICAL_SECTION lpCriticalSection,
|
||||||
|
DWORD dwSpinCount
|
||||||
|
)
|
||||||
|
{
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
Status = RtlInitializeCriticalSectionAndSpinCount(lpCriticalSection, dwSpinCount);
|
||||||
|
if (Status)
|
||||||
|
{
|
||||||
|
RtlRaiseStatus(Status);
|
||||||
|
}
|
||||||
|
return NT_SUCCESS(Status);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: critical.c,v 1.15 2003/09/12 17:51:48 vizzini Exp $
|
/* $Id: critical.c,v 1.16 2004/01/29 23:41:36 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -25,7 +25,7 @@ VOID STDCALL
|
||||||
RtlDeleteCriticalSection(PCRITICAL_SECTION CriticalSection)
|
RtlDeleteCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||||
{
|
{
|
||||||
NtClose(CriticalSection->LockSemaphore);
|
NtClose(CriticalSection->LockSemaphore);
|
||||||
CriticalSection->Reserved = -1;
|
CriticalSection->SpinCount = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -90,7 +90,7 @@ RtlInitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||||
CriticalSection->LockCount = -1;
|
CriticalSection->LockCount = -1;
|
||||||
CriticalSection->RecursionCount = 0;
|
CriticalSection->RecursionCount = 0;
|
||||||
CriticalSection->OwningThread = (HANDLE)0;
|
CriticalSection->OwningThread = (HANDLE)0;
|
||||||
CriticalSection->Reserved = 0;
|
CriticalSection->SpinCount = 0;
|
||||||
|
|
||||||
Status = NtCreateSemaphore(&CriticalSection->LockSemaphore,
|
Status = NtCreateSemaphore(&CriticalSection->LockSemaphore,
|
||||||
SEMAPHORE_ALL_ACCESS,
|
SEMAPHORE_ALL_ACCESS,
|
||||||
|
@ -177,4 +177,14 @@ RtlTryEnterCriticalSection(PCRITICAL_SECTION CriticalSection)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @implemented
|
||||||
|
*/
|
||||||
|
NTSTATUS STDCALL
|
||||||
|
RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *crit, DWORD spincount)
|
||||||
|
{
|
||||||
|
crit->SpinCount = spincount;
|
||||||
|
return RtlInitializeCriticalSection(crit);
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -278,14 +278,6 @@ NTSTATUS STDCALL RtlInitUnicodeStringEx(PUNICODE_STRING target,PCWSTR source)
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
NTSTATUS STDCALL RtlInitializeCriticalSectionAndSpinCount(RTL_CRITICAL_SECTION *crit, DWORD spincount)
|
|
||||||
{
|
|
||||||
return(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue