windows.networking.hostname/tests: Check if passed HSTRING is duplicated.
[wine.git] / dlls / winewayland.drv / dllmain.c
blobd040620957b7969a691a8d10e8d1d01dba81b1a4
1 /*
2 * winewayland.drv entry points
4 * Copyright 2022 Alexandros Frantzis for Collabora Ltd
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "waylanddrv_dll.h"
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(waylanddrv);
27 static DWORD WINAPI wayland_read_events_thread(void *arg)
29 WAYLANDDRV_UNIX_CALL(read_events, NULL);
30 /* This thread terminates only if an unrecoverable error occurred
31 * during event reading (e.g., the connection to the Wayland
32 * compositor is broken). */
33 ERR("Failed to read events from the compositor, terminating process\n");
34 TerminateProcess(GetCurrentProcess(), 1);
35 return 0;
38 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
40 DWORD tid;
42 if (reason != DLL_PROCESS_ATTACH) return TRUE;
44 DisableThreadLibraryCalls(instance);
45 if (__wine_init_unix_call()) return FALSE;
47 if (WAYLANDDRV_UNIX_CALL(init, NULL))
48 return FALSE;
50 /* Read wayland events from a dedicated thread. */
51 CloseHandle(CreateThread(NULL, 0, wayland_read_events_thread, NULL, 0, &tid));
53 return TRUE;