Commit b3158377 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Store the PEB lock pointer in the PEB.

parent 844b57e4
......@@ -49,15 +49,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
static RTL_CRITICAL_SECTION peb_lock;
static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &peb_lock,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": peb_lock") }
};
static RTL_CRITICAL_SECTION peb_lock = { &critsect_debug, -1, 0, 0, 0, 0 };
#ifdef __i386__
#define DEFINE_FASTCALL4_ENTRYPOINT( name ) \
__ASM_STDCALL_FUNC( name, 16, \
......@@ -380,7 +371,7 @@ NTSTATUS WINAPI vDbgPrintExWithPrefix( LPCSTR prefix, ULONG id, ULONG level, LPC
*/
VOID WINAPI RtlAcquirePebLock(void)
{
RtlEnterCriticalSection( &peb_lock );
RtlEnterCriticalSection( NtCurrentTeb()->Peb->FastPebLock );
}
/******************************************************************************
......@@ -388,7 +379,7 @@ VOID WINAPI RtlAcquirePebLock(void)
*/
VOID WINAPI RtlReleasePebLock(void)
{
RtlLeaveCriticalSection( &peb_lock );
RtlLeaveCriticalSection( NtCurrentTeb()->Peb->FastPebLock );
}
/******************************************************************************
......
......@@ -69,6 +69,15 @@ static RTL_BITMAP tls_expansion_bitmap;
static RTL_BITMAP fls_bitmap;
static int nb_threads = 1;
static RTL_CRITICAL_SECTION peb_lock;
static RTL_CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &peb_lock,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": peb_lock") }
};
static RTL_CRITICAL_SECTION peb_lock = { &critsect_debug, -1, 0, 0, 0, 0 };
/***********************************************************************
* get_unicode_string
*
......@@ -292,6 +301,7 @@ HANDLE thread_init(void)
MEM_COMMIT | MEM_TOP_DOWN, PAGE_READWRITE );
peb = addr;
peb->FastPebLock = &peb_lock;
peb->ProcessParameters = &params;
peb->TlsBitmap = &tls_bitmap;
peb->TlsExpansionBitmap = &tls_expansion_bitmap;
......
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