We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2069 - Device addition/removal queries all USB devices rather than only HID devices.
Summary: Device addition/removal queries all USB devices rather than only HID devices.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: All Windows (All)
: P2 trivial
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-28 13:38 UTC by Andreas Ertelt
Modified: 2013-10-18 06:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Ertelt 2013-08-28 13:38:50 UTC
SDL_dxjoystick.c is setting the classguid for device (dis)connect events to USB Devices in general:
    dbh.dbcc_classguid = GUID_DEVINTERFACE_USB_DEVICE;

Wouldn't it make more sense to have it just subscribe to Hid device events? This would mean less meaningless events reaching the application - my proposed change of the line above would look like this:
    HidD_GetHidGuid(&dbh.dbcc_classguid);

This worked fine for me in the past, but I only have a limited number of devices to test with - are there any joysticks that are connected through USB that are not classified as HID devices?

It should also be noted that despite its availability since Windows 2000, the function HidD_GetHidGuid() was only recently added to the MinGW-w64 header files.

Relevant references:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff538924%28v=vs.85%29.aspx
Comment 1 Sam Lantinga 2013-10-18 06:40:49 UTC
Fixed, thanks!
http://hg.libsdl.org/SDL/rev/214cd9137ea9