SDL: Don't use RAWINPUT joystick driver on Windows XP (08f83)

From 08f83f953c55acffc5d05d3a6447e9563d10185d Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 17 Oct 2022 07:32:44 -0700
Subject: [PATCH] Don't use RAWINPUT joystick driver on Windows XP

Fixes https://github.com/libsdl-org/SDL/issues/6400
(cherry-picked from commit 5025f2403393d70ee54d83cc583287b4c4f74e84)
---
 src/joystick/windows/SDL_rawinputjoystick.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c
index cff656b26697..7810e8ca6244 100644
--- a/src/joystick/windows/SDL_rawinputjoystick.c
+++ b/src/joystick/windows/SDL_rawinputjoystick.c
@@ -874,6 +874,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;
     }