Skip to content

Commit 71f56ef

Browse files
committed
add XInputSetState export in proxy loader, fixing certain steam emus
1 parent 1af10ee commit 71f56ef

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

loader/launcher/windows/proxyLoader.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
struct XINPUT_STATE;
88
struct XINPUT_CAPABILITIES;
9+
struct XINPUT_VIBRATION;
910

1011
constexpr static auto MAX_PATH_CHARS = 32768u;
1112

@@ -41,6 +42,17 @@ extern "C" DWORD XInputGetState(DWORD dwUserIndex, XINPUT_STATE *pState) {
4142
return ERROR_DEVICE_NOT_CONNECTED;
4243
}
4344

45+
#pragma comment(linker, "/export:XInputSetState,@3")
46+
extern "C" DWORD XInputSetState(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) {
47+
static auto fp = getFP("XInputSetState");
48+
if (fp) {
49+
using FPType = decltype(&XInputSetState);
50+
return reinterpret_cast<FPType>(fp)(dwUserIndex, pVibration);
51+
}
52+
53+
return ERROR_DEVICE_NOT_CONNECTED;
54+
}
55+
4456
#pragma comment(linker, "/export:XInputGetCapabilities,@4")
4557
extern "C" DWORD XInputGetCapabilities(DWORD dwUserIndex, DWORD dwFlags, XINPUT_CAPABILITIES *pCapabilities) {
4658
static auto fp = getFP("XInputGetCapabilities");

0 commit comments

Comments
 (0)