diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 718abe0e83..45aea81ec1 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -81,7 +81,7 @@ void USER_Unlock(void) */ void USER_CheckNotLock(void) { - if (user_section.OwningThread == ULongToHandle(GetCurrentThreadId()) && user_section.RecursionCount) + if (RtlIsCriticalSectionLockedByThread(&user_section)) { ERR( "BUG: holding USER lock\n" ); DebugBreak();