[Git][wine/wine][master] 2 commits: comctl32/tests: Add more RegisterClassNameW() tests.
Alexandre Julliard pushed to branch master at wine / wine Commits: fbadf504 by Zhiyi Zhang at 2026-01-02T17:41:45+01:00 comctl32/tests: Add more RegisterClassNameW() tests. - - - - - 05421efd by Zhiyi Zhang at 2026-01-02T17:41:45+01:00 comctl32: Register window classes in RegisterClassNameW() instead of DllMain(). Registering window classes in DllMain() is prone to deadlocks. Tests show that comctl32 window classes should probably be registered in RegisterClassNameW(). Fix possible EA launcher hangs due to deadlocks. A deadlock can happen, like the following, based on Tim Clem's findings. Say there are two threads, T1 and T2. T1: does some COM stuff that results in registering the window class OleMainThreadWndClass. T1: NtUserRegisterClassExWOW() does get_desktop_window(). Because this is not a built-in class. T1: doesn't yet have a desktop window, so it makes one and calls register_builtin_classes(). T1: starts the pthread_once in register_builtin_classes() to actually register the classes. T1: starts calling NtUserRegisterClassExWOW() with its classes. T2: loads comctl32.dll, calls its PROCESS_ATTACH. It grabs the loader lock. T2: comctl32's DllMain starts registering its classes. T2: comctl32's attempts to register classes also call get_desktop_window(). T2: get_desktop_window hits the pthread_once in register_builtin_classes() and starts waiting for T1 to finish it. T1: some built-in class registration results in a LoadImageW call for a class's cursor. T1: LoadImage has to grab a resource, so it tries to grab the loader lock. T1: the loader lock is held by T2. Deadlock; T2 is waiting on T1, which is waiting on T2. - - - - - 23 changed files: - dlls/comctl32/animate.c - dlls/comctl32/comboex.c - dlls/comctl32/comctl32.h - dlls/comctl32/commctrl.c - dlls/comctl32/datetime.c - dlls/comctl32/header.c - dlls/comctl32/hotkey.c - dlls/comctl32/ipaddress.c - dlls/comctl32/listview.c - dlls/comctl32/monthcal.c - dlls/comctl32/nativefont.c - dlls/comctl32/pager.c - dlls/comctl32/progress.c - dlls/comctl32/rebar.c - dlls/comctl32/status.c - dlls/comctl32/tab.c - dlls/comctl32/tests/misc.c - dlls/comctl32/toolbar.c - dlls/comctl32/tooltips.c - dlls/comctl32/trackbar.c - dlls/comctl32/treeview.c - dlls/comctl32/updown.c - dlls/comctl32_v6/syslink.c View it on GitLab: https://gitlab.winehq.org/wine/wine/-/compare/d571e86bf4e8e0d751f5a501cd38a4... -- View it on GitLab: https://gitlab.winehq.org/wine/wine/-/compare/d571e86bf4e8e0d751f5a501cd38a4... You're receiving this email because of your account on gitlab.winehq.org.
participants (1)
-
Alexandre Julliard (@julliard)