SDL: Don't use the fake HID endpoint for Xbox controllers on Windows (3164b)

From 3164b74256c58ee331ba479b1edd357f7ab7d7e1 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 28 Apr 2026 14:10:04 -0700
Subject: [PATCH] Don't use the fake HID endpoint for Xbox controllers on
 Windows

(cherry picked from commit d5fca9628affff85fc7dd8dc8fb2e70a6e1957dd)
---
 src/joystick/hidapi/SDL_hidapi_xboxone.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c
index 896423f848385..13a2bdc7b61ad 100644
--- a/src/joystick/hidapi/SDL_hidapi_xboxone.c
+++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c
@@ -34,7 +34,7 @@
 // #define DEBUG_JOYSTICK
 
 // Define this if you want to log all packets from the controller
-#if 0
+#if 1
 #define DEBUG_XBOX_PROTOCOL
 #endif
 
@@ -374,6 +374,12 @@ static bool HIDAPI_DriverXboxOne_IsSupportedDevice(SDL_HIDAPI_Device *device, co
         // we'll just use the GCController support instead.
         return false;
     }
+#endif
+#ifdef SDL_PLATFORM_WIN32
+    if (SDL_strncmp(device->path, "\\\\?\\HID#", 8) == 0) {
+        // Windows provides a fake HID endpoint for XGIP controllers, don't use this
+        return false;
+    }
 #endif
     if (interface_class &&
         (interface_class != LIBUSB_CLASS_VENDOR_SPEC ||