From: Etaash Mathamsetty etaash.mathamsetty@gmail.com
--- dlls/xinput1_3/main.c | 13 +++++++++++++ dlls/xinput1_3/xinput1_3.spec | 1 + include/xinput.h | 8 ++++++++ 3 files changed, 22 insertions(+)
diff --git a/dlls/xinput1_3/main.c b/dlls/xinput1_3/main.c index 237ace77a82..dcdc17598d0 100644 --- a/dlls/xinput1_3/main.c +++ b/dlls/xinput1_3/main.c @@ -858,6 +858,19 @@ DWORD WINAPI DECLSPEC_HOTPATCH XInputSetState(DWORD index, XINPUT_VIBRATION *vib return ret; }
+DWORD WINAPI DECLSPEC_HOTPATCH XInputSetStateEx(DWORD index, XINPUT_VIBRATION_EX *vibration_ex) +{ + XINPUT_VIBRATION vibration; + static int once; + + if (!once++) FIXME("(%lu, %p) semi-stub\n", index, vibration_ex); + + vibration.wLeftMotorSpeed = vibration_ex->wLeftMotorSpeed; + vibration.wRightMotorSpeed = vibration_ex->wRightMotorSpeed; + + return XInputSetState(index, &vibration); +} + /* Some versions of SteamOverlayRenderer hot-patch XInputGetStateEx() and call * XInputGetState() in the hook, so we need a wrapper. */ static DWORD xinput_get_state(DWORD index, XINPUT_STATE *state) diff --git a/dlls/xinput1_3/xinput1_3.spec b/dlls/xinput1_3/xinput1_3.spec index dd193a5a4ec..300702db7f1 100644 --- a/dlls/xinput1_3/xinput1_3.spec +++ b/dlls/xinput1_3/xinput1_3.spec @@ -8,3 +8,4 @@ 8 stdcall XInputGetKeystroke(long long ptr) 100 stdcall XInputGetStateEx(long ptr) @ stdcall XInputInit() +@ stdcall XInputSetStateEx(long ptr) diff --git a/include/xinput.h b/include/xinput.h index f7c291630cb..74f9ffa4a89 100644 --- a/include/xinput.h +++ b/include/xinput.h @@ -194,6 +194,13 @@ typedef struct _XINPUT_VIBRATION { WORD wRightMotorSpeed; } XINPUT_VIBRATION, *PXINPUT_VIBRATION;
+typedef struct XINPUT_VIBRATION_EX { + WORD wLeftMotorSpeed; + WORD wRightMotorSpeed; + WORD wLeftTriggerSpeed; + WORD wRightTriggerSpeed; +} XINPUT_VIBRATION_EX; + /* * Defines the structure for what kind of abilities the joystick has * such abilities are things such as if the joystick has the ability @@ -241,6 +248,7 @@ DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*); DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*);
DWORD WINAPI XInputGetStateEx(DWORD, XINPUT_STATE*); +DWORD WINAPI XInputSetStateEx(DWORD, XINPUT_VIBRATION_EX*);
#ifdef __cplusplus }