Commit 5d929319 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Use a standard critical section instead of a syslevel for the USER lock.

parent 0d07420e
......@@ -39,14 +39,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(graphics);
HMODULE user32_module = 0;
static SYSLEVEL USER_SysLevel;
static CRITICAL_SECTION user_section;
static CRITICAL_SECTION_DEBUG critsect_debug =
{
0, 0, &USER_SysLevel.crst,
0, 0, &user_section,
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": USER_SysLevel") }
0, 0, { (DWORD_PTR)(__FILE__ ": user_section") }
};
static SYSLEVEL USER_SysLevel = { { &critsect_debug, -1, 0, 0, 0, 0 }, 2 };
static CRITICAL_SECTION user_section = { &critsect_debug, -1, 0, 0, 0, 0 };
static HPALETTE (WINAPI *pfnGDISelectPalette)( HDC hdc, HPALETTE hpal, WORD bkgnd );
static UINT (WINAPI *pfnGDIRealizePalette)( HDC hdc );
......@@ -62,7 +62,7 @@ extern void WDML_NotifyThreadDetach(void);
*/
void USER_Lock(void)
{
_EnterSysLevel( &USER_SysLevel );
EnterCriticalSection( &user_section );
}
......@@ -71,7 +71,7 @@ void USER_Lock(void)
*/
void USER_Unlock(void)
{
_LeaveSysLevel( &USER_SysLevel );
LeaveCriticalSection( &user_section );
}
......@@ -82,7 +82,11 @@ void USER_Unlock(void)
*/
void USER_CheckNotLock(void)
{
_CheckNotSysLevel( &USER_SysLevel );
if (user_section.OwningThread == ULongToHandle(GetCurrentThreadId()) && user_section.RecursionCount)
{
ERR( "BUG: holding USER lock\n" );
DebugBreak();
}
}
......
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