From: Alexandros Frantzis alexandros.frantzis@collabora.com
Signed-off-by: Alexandros Frantzis alexandros.frantzis@collabora.com --- dlls/winewayland.drv/Makefile.in | 2 + dlls/winewayland.drv/dllmain.c | 4 ++ dlls/winewayland.drv/unixlib.h | 32 ++++++++++++++++ dlls/winewayland.drv/waylanddrv.h | 30 +++++++++++++++ dlls/winewayland.drv/waylanddrv_dll.h | 4 ++ dlls/winewayland.drv/waylanddrv_main.c | 53 ++++++++++++++++++++++++++ 6 files changed, 125 insertions(+) create mode 100644 dlls/winewayland.drv/unixlib.h create mode 100644 dlls/winewayland.drv/waylanddrv.h create mode 100644 dlls/winewayland.drv/waylanddrv_main.c
diff --git a/dlls/winewayland.drv/Makefile.in b/dlls/winewayland.drv/Makefile.in index 713b281b1bd..1d52f466c41 100644 --- a/dlls/winewayland.drv/Makefile.in +++ b/dlls/winewayland.drv/Makefile.in @@ -1,6 +1,8 @@ MODULE = winewayland.drv +UNIXLIB = winewayland.so
C_SRCS = \ dllmain.c \ + waylanddrv_main.c \
RC_SRCS = version.rc diff --git a/dlls/winewayland.drv/dllmain.c b/dlls/winewayland.drv/dllmain.c index 7ab3341e61d..89d981a4314 100644 --- a/dlls/winewayland.drv/dllmain.c +++ b/dlls/winewayland.drv/dllmain.c @@ -25,6 +25,10 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved) if (reason != DLL_PROCESS_ATTACH) return TRUE;
DisableThreadLibraryCalls(instance); + if (__wine_init_unix_call()) return FALSE; + + if (WAYLANDDRV_UNIX_CALL(init, NULL)) + return FALSE;
return TRUE; } diff --git a/dlls/winewayland.drv/unixlib.h b/dlls/winewayland.drv/unixlib.h new file mode 100644 index 00000000000..427837523e3 --- /dev/null +++ b/dlls/winewayland.drv/unixlib.h @@ -0,0 +1,32 @@ +/* + * Copyright 2022 Alexandros Frantzis for Collabora Ltd + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_WAYLANDDRV_UNIXLIB_H +#define __WINE_WAYLANDDRV_UNIXLIB_H + +#include <stdarg.h> +#include "winternl.h" +#include "wine/unixlib.h" + +enum waylanddrv_unix_func +{ + waylanddrv_unix_func_init, + waylanddrv_unix_func_count, +}; + +#endif /* __WINE_WAYLANDDRV_UNIXLIB_H */ diff --git a/dlls/winewayland.drv/waylanddrv.h b/dlls/winewayland.drv/waylanddrv.h new file mode 100644 index 00000000000..ec656ea87fb --- /dev/null +++ b/dlls/winewayland.drv/waylanddrv.h @@ -0,0 +1,30 @@ +/* + * Wayland driver + * + * Copyright 2020 Alexandros Frantzis for Collabora Ltd + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_WAYLANDDRV_H +#define __WINE_WAYLANDDRV_H + +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif + +#include "unixlib.h" + +#endif /* __WINE_WAYLANDDRV_H */ diff --git a/dlls/winewayland.drv/waylanddrv_dll.h b/dlls/winewayland.drv/waylanddrv_dll.h index 556898d44b2..123b6cd5a61 100644 --- a/dlls/winewayland.drv/waylanddrv_dll.h +++ b/dlls/winewayland.drv/waylanddrv_dll.h @@ -25,4 +25,8 @@ #include "windef.h" #include "winbase.h"
+#include "unixlib.h" + +#define WAYLANDDRV_UNIX_CALL(func, params) WINE_UNIX_CALL(waylanddrv_unix_func_ ## func, params) + #endif /* __WINE_WAYLANDDRV_DLL_H */ diff --git a/dlls/winewayland.drv/waylanddrv_main.c b/dlls/winewayland.drv/waylanddrv_main.c new file mode 100644 index 00000000000..396beac5828 --- /dev/null +++ b/dlls/winewayland.drv/waylanddrv_main.c @@ -0,0 +1,53 @@ +/* + * WAYLANDDRV initialization code + * + * Copyright 2020 Alexandre Frantzis for Collabora Ltd + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if 0 +#pragma makedep unix +#endif + +#include "config.h" + +#include "ntstatus.h" +#define WIN32_NO_STATUS + +#include "waylanddrv.h" + +static NTSTATUS waylanddrv_unix_init(void *arg) +{ + return 0; +} + +const unixlib_entry_t __wine_unix_call_funcs[] = +{ + waylanddrv_unix_init, +}; + +C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == waylanddrv_unix_func_count); + +#ifdef _WIN64 + +const unixlib_entry_t __wine_unix_call_wow64_funcs[] = +{ + waylanddrv_unix_init, +}; + +C_ASSERT(ARRAYSIZE(__wine_unix_call_wow64_funcs) == waylanddrv_unix_func_count); + +#endif /* _WIN64 */