Certain games have started using the newest GameInput API and linking to GameInput.dll. Adding a stub library allows these games to launch and enables them to fall back to the DirectInput API if `GameInputCreate` returns an error.
Affected games: Le Mans Ultimate
-- v2: gameinput: Add stub dll.
From: Oleg Makarenko oleg@makarenk.ooo
--- configure | 2 ++ configure.ac | 1 + dlls/gameinput/Makefile.in | 6 ++++++ dlls/gameinput/gameinput.c | 31 +++++++++++++++++++++++++++++++ dlls/gameinput/gameinput.spec | 1 + 5 files changed, 41 insertions(+) create mode 100644 dlls/gameinput/Makefile.in create mode 100644 dlls/gameinput/gameinput.c create mode 100644 dlls/gameinput/gameinput.spec
diff --git a/configure b/configure index 23fc01d0aad..8b11849501a 100755 --- a/configure +++ b/configure @@ -1158,6 +1158,7 @@ enable_fntcache enable_fontsub enable_fusion enable_fwpuclnt +enable_gameinput enable_gameux enable_gamingtcui enable_gdi32 @@ -22352,6 +22353,7 @@ wine_fn_config_makefile dlls/fontsub enable_fontsub wine_fn_config_makefile dlls/fusion enable_fusion wine_fn_config_makefile dlls/fusion/tests enable_tests wine_fn_config_makefile dlls/fwpuclnt enable_fwpuclnt +wine_fn_config_makefile dlls/gameinput enable_gameinput wine_fn_config_makefile dlls/gameux enable_gameux wine_fn_config_makefile dlls/gameux/tests enable_tests wine_fn_config_makefile dlls/gamingtcui enable_gamingtcui diff --git a/configure.ac b/configure.ac index 6d093b52526..f87159e71b3 100644 --- a/configure.ac +++ b/configure.ac @@ -2720,6 +2720,7 @@ WINE_CONFIG_MAKEFILE(dlls/fontsub) WINE_CONFIG_MAKEFILE(dlls/fusion) WINE_CONFIG_MAKEFILE(dlls/fusion/tests) WINE_CONFIG_MAKEFILE(dlls/fwpuclnt) +WINE_CONFIG_MAKEFILE(dlls/gameinput) WINE_CONFIG_MAKEFILE(dlls/gameux) WINE_CONFIG_MAKEFILE(dlls/gameux/tests) WINE_CONFIG_MAKEFILE(dlls/gamingtcui) diff --git a/dlls/gameinput/Makefile.in b/dlls/gameinput/Makefile.in new file mode 100644 index 00000000000..b0a09584bd1 --- /dev/null +++ b/dlls/gameinput/Makefile.in @@ -0,0 +1,6 @@ +MODULE = gameinput.dll + +EXTRADLLFLAGS = -Wb,--prefer-native + +SOURCES = \ + gameinput.c diff --git a/dlls/gameinput/gameinput.c b/dlls/gameinput/gameinput.c new file mode 100644 index 00000000000..e88faaf789d --- /dev/null +++ b/dlls/gameinput/gameinput.c @@ -0,0 +1,31 @@ +/* + * Copyright 2025 Oleg Makarenko + * + * 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 + */ +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(gameinput); + +HRESULT WINAPI GameInputCreate(void **out) +{ + FIXME("%p stub\n", out); + + return E_NOTIMPL; +} diff --git a/dlls/gameinput/gameinput.spec b/dlls/gameinput/gameinput.spec new file mode 100644 index 00000000000..d438558c0cc --- /dev/null +++ b/dlls/gameinput/gameinput.spec @@ -0,0 +1 @@ +@ stdcall GameInputCreate(ptr)
The [documentation](https://learn.microsoft.com/en-us/gaming/gdk/docs/features/common/input/over...) says that games are required to install the GameInput redistributable. Presumably that includes `GameInput.dll`, is GameInputRedist.msi being installed?
It's now seemingly available on more recent Windows versions, however there's some versioning shenanigans which looks rather annoying to handle. Also makes me worried that other games would assume it is available and works as soon as the DLL is available, which isn't going to be the case soon.
This GameInputRedist.msi consists something out of Bridge, Redist, and RedistService.exe only. GameInput.dll is available in Windows and installed in one of the Windows updates.
``` GameInputRedist/ ├── GameInputRedist.msi ├── Microsoft GameInput │ ├── x64 │ │ ├── GameInputBridge.dll │ │ ├── GameInputRedist.dll │ │ └── GameInputRedistService.exe │ └── x86 │ └── GameInputRedist.dll └── Windows Kits └── 10 └── Catalogs └── cat2efa787e78d3dcd94c85b16407b2e2ce.cat ```
My guess is that Microsoft's GameInput.dll provides interface to the bridge/redist and GameInput service handles all inputs.
other games would assume it is available
Can they make that assumption only from existence of DLL alone? If `GameInputCreate` will return an error, wouldn't they just fallback to whatever is available (directinput/xinput)? And if they (games/apps) don't provide fallback option, then game will crash/show error message, and trace with `fixme` will be available, and that's kinda better than not launch at all because of lack of DLL?
What do you think the best approach can be then? For now such games (who provide fallback option) can be 'fixed' just with 'empty' `GameInput.dll` placed in their directory. I know only couple of them who links to the GameInput (LMU, God Of War Ragnarok, Stalker 2), and i know for sure that LMU provides fallback, don't know about others sadly.
I'm not yet sure, I have actually been looking into it and working on some early implementation, but I've been bothered by its versioning scheme which already has two incompatible versions, and is done in an unusual way with C++ namespaces, which doesn't fit our IDL-based headers well.
Its design is also a bit annoying and would require us to duplicate all sort of things I would rather avoid duplicating (like force feedback). I was mostly hoping nothing would be using it for a while, but I guess we don't have much choice now if games are requiring it to even start.