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. -- v4: comctl32: Register window classes in RegisterClassNameW() instead of DllMain(). comctl32/tests: Add more RegisterClassNameW() tests. https://gitlab.winehq.org/wine/wine/-/merge_requests/9822