diff --git a/dlls/gdi32/gdiobj.c b/dlls/gdi32/gdiobj.c index a255a4c2ad..e861f24014 100644 --- a/dlls/gdi32/gdiobj.c +++ b/dlls/gdi32/gdiobj.c @@ -867,7 +867,7 @@ void GDI_ReleaseObj( HGDIOBJ handle ) */ void GDI_CheckNotLock(void) { - if (gdi_section.OwningThread == ULongToHandle(GetCurrentThreadId()) && gdi_section.RecursionCount) + if (RtlIsCriticalSectionLockedByThread(&gdi_section)) { ERR( "BUG: holding GDI lock\n" ); DebugBreak();