Esme Povirk (@madewokherd) commented about dlls/uiautomationcore/uia_event.c:
+ hwnd = CreateWindowW(L"Message", NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); + if (!hwnd) + { + WARN("CreateWindow failed: %ld\n", GetLastError()); + CoUninitialize(); + FreeLibraryAndExitThread(huia_module, 1); + } + + event_thread.hwnd = hwnd; + + /* Initialization complete, thread can now process window messages. */ + SetEvent(initialized_event); + TRACE("Event thread started.\n"); + while (GetMessageW(&msg, NULL, 0, 0)) + { + if (msg.message == WM_UIA_EVENT_THREAD_STOP) I think the hwnd should be checked here, or the message window should be given a WndProc that responds to this with PostQuitMessage.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3119#note_36337