Skip to content
Snippets Groups Projects
Commit 449ca2fb authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard
Browse files

user32: Leave critical section before calling callbacks in EnumDisplayMonitors().


Previously, callbacks were called with a critical section held. It was
intended that monitor handles passed to callbacks should always be valid.
But it created a deadlock condition when callbacks call other functions
which try to grab the critical section using a different thread. Tests
also show that a monitor handle can be invalid after a display change.
So do not hold the critical section when calling callbacks. Monitor
handles will be checked when passed to GetMonitorInfo(), which is the
sole function that consumes HMONITORs.

Signed-off-by: default avatarZhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard's avatarAlexandre Julliard <julliard@winehq.org>
parent 065690be
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment