From 71f56ef49eb17dd70cc91999736ca075c09b3941 Mon Sep 17 00:00:00 2001 From: dankmeme01 <42031238+dankmeme01@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:59:12 +0100 Subject: [PATCH] add XInputSetState export in proxy loader, fixing certain steam emus --- loader/launcher/windows/proxyLoader.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/loader/launcher/windows/proxyLoader.cpp b/loader/launcher/windows/proxyLoader.cpp index 84f96670..f06c020b 100644 --- a/loader/launcher/windows/proxyLoader.cpp +++ b/loader/launcher/windows/proxyLoader.cpp @@ -6,6 +6,7 @@ struct XINPUT_STATE; struct XINPUT_CAPABILITIES; +struct XINPUT_VIBRATION; constexpr static auto MAX_PATH_CHARS = 32768u; @@ -41,6 +42,17 @@ extern "C" DWORD XInputGetState(DWORD dwUserIndex, XINPUT_STATE *pState) { return ERROR_DEVICE_NOT_CONNECTED; } +#pragma comment(linker, "/export:XInputSetState,@3") +extern "C" DWORD XInputSetState(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) { + static auto fp = getFP("XInputSetState"); + if (fp) { + using FPType = decltype(&XInputSetState); + return reinterpret_cast(fp)(dwUserIndex, pVibration); + } + + return ERROR_DEVICE_NOT_CONNECTED; +} + #pragma comment(linker, "/export:XInputGetCapabilities,@4") extern "C" DWORD XInputGetCapabilities(DWORD dwUserIndex, DWORD dwFlags, XINPUT_CAPABILITIES *pCapabilities) { static auto fp = getFP("XInputGetCapabilities");