Commit 5025f2403393d70ee54d83cc583287b4c4f74e84

Sam Lantinga 2022-10-17T07:32:44

Don't use RAWINPUT joystick driver on Windows XP Fixes https://github.com/libsdl-org/SDL/issues/6400

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c
index 26d753c..120a361 100644
--- a/src/joystick/windows/SDL_rawinputjoystick.c
+++ b/src/joystick/windows/SDL_rawinputjoystick.c
@@ -855,6 +855,11 @@ RAWINPUT_JoystickInit(void)
 
     SDL_assert(!SDL_RAWINPUT_inited);
 
+    if (!WIN_IsWindowsVistaOrGreater()) {
+        /* According to bug 6400, this doesn't work on Windows XP */
+        return -1;
+    }
+
     if (!SDL_GetHintBoolean(SDL_HINT_JOYSTICK_RAWINPUT, SDL_TRUE)) {
         return -1;
     }