diff --git a/CHANGES.md b/CHANGES.md index e815049d78..9304396eb7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -40,6 +40,7 @@ - WINDOWS: Raw input driver now supports new lightgun code. - WINDOWS: Use configured OSD/text message color on GDI driver. - WINDOWS/XINPUT: Populate XInput VID/PID from DInput so autoconfig doesn't rely solely on joypad names +- WINDOWS/XINPUT: Fix crash that occurs in some situations with Steam running and a Steam Controller plugged in. - WINDOWS: Improve version reporting under System Information. - WINDOWS: Support window transparency. diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index 77a9680d52..b7514cf9ac 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -475,7 +475,7 @@ static void xinput_joypad_poll(void) { if (g_xinput_states[i].connected) { - if (g_XInputGetStateEx(i, + if (g_XInputGetStateEx && g_XInputGetStateEx(i, &(g_xinput_states[i].xstate)) == ERROR_DEVICE_NOT_CONNECTED) g_xinput_states[i].connected = false; @@ -507,6 +507,9 @@ static bool xinput_joypad_rumble(unsigned pad, else if (effect == RETRO_RUMBLE_WEAK) g_xinput_rumble_states[xuser].wRightMotorSpeed = strength; + if (!g_XInputSetState) + return false; + return (g_XInputSetState(xuser, &g_xinput_rumble_states[xuser]) == 0); }