Skip to content

JoystickClose crashing on Xinput check (even controllers that aren't xinput) #14067

@Squall-Leonhart

Description

@Squall-Leonhart

This exception throws on app close.

// Function to close a joystick after use
static void WINDOWS_JoystickClose(SDL_Joystick *joystick)
{
#ifdef SDL_JOYSTICK_XINPUT
    if (joystick->hwdata->bXInputDevice) { <exception 0xC0000005>
        SDL_XINPUT_JoystickClose(joystick);
    } else {
        SDL_DINPUT_JoystickClose(joystick);
    }
#else
    SDL_DINPUT_JoystickClose(joystick);
#endif

    SDL_free(joystick->hwdata);
}
  | Name | Value | Type
-- | -- | -- | --
◢ | joystick | 0x000001c32a5f5670 {instance_id=1 name=0x000001c328a0dfa0 "Logitech Cordless RumblePad 2" path=0x000001c32a604560 "\\\\?\\HID#VID_046D&PID_C219#7&151FDADC&0&0000#{4D1E55B2-F16F-11CF-88CB-001111000030}" ...} | SDL_Joystick *
  | instance_id | 1 | unsigned int
  | ▶ name | 0x000001c328a0dfa0 "Logitech Cordless RumblePad 2" | char *
  | ▶ path | 0x000001c32a604560 "\\\\?\\HID#VID_046D&PID_C219#7&151FDADC&0&0000#{4D1E55B2-F16F-11CF-88CB-001111000030}" | char *
  | ▶ serial | 0x0000000000000000 <NULL> | char *
  | ▶ guid | {data=0x000001c32a5f5690 "\x3" } | SDL_GUID
  | firmware_version | 0 | unsigned short
  | steam_handle | 0 | unsigned __int64
  | swap_face_buttons | false | bool
  | is_virtual | false | bool
  | naxes | 4 | int
  | ▶ axes | 0x000001c328a0e690 {initial_value=0 value=0 zero=0 ...} | SDL_JoystickAxisInfo *
  | nballs | 0 | int
  | ▶ balls | 0x0000000000000000 <NULL> | SDL_JoystickBallData *
  | nhats | 1 | int
  | ▶ hats | 0x000001c3289dc360 "" | unsigned char *
  | nbuttons | 12 | int
  | ▶ buttons | 0x000001c3289d7aa0 {false} | bool *
  | ntouchpads | 0 | int
  | ▶ touchpads | 0x0000000000000000 <NULL> | SDL_JoystickTouchpadInfo *
  | nsensors | 0 | int
  | nsensors_enabled | 0 | int
  | ▶ sensors | 0x0000000000000000 <NULL> | SDL_JoystickSensorInfo *
  | low_frequency_rumble | 0 | unsigned short
  | high_frequency_rumble | 0 | unsigned short
  | rumble_expiration | 0 | unsigned __int64
  | rumble_resend | 0 | unsigned __int64
  | left_trigger_rumble | 0 | unsigned short
  | right_trigger_rumble | 0 | unsigned short
  | trigger_rumble_expiration | 0 | unsigned __int64
  | trigger_rumble_resend | 0 | unsigned __int64
  | led_red | 0 '\0' | unsigned char
  | led_green | 0 '\0' | unsigned char
  | led_blue | 0 '\0' | unsigned char
  | led_expiration | 5224 | unsigned __int64
  | attached | true | bool
  | connection_state | SDL_JOYSTICK_CONNECTION_UNKNOWN (0) | SDL_JoystickConnectionState
  | battery_state | SDL_POWERSTATE_UNKNOWN (0) | SDL_PowerState
  | battery_percent | -1 | int
  | delayed_guide_button | false | bool
  | accel_sensor | 0 | unsigned int
  | ▶ accel | 0x0000000000000000 <NULL> | SDL_Sensor *
  | gyro_sensor | 0 | unsigned int
  | ▶ gyro | 0x0000000000000000 <NULL> | SDL_Sensor *
  | ▶ sensor_transform | 0x000001c32a5f5780 {0x000001c32a5f5780 {0.00000000, 0.00000000, 0.00000000}, 0x000001c32a5f578c {0.00000000, ...}, ...} | float[3][3]
  | update_complete | 0 | unsigned __int64
  | ▶ driver | 0x00007ff60bf9f5f0 {visualboyadvance-m.exe!SDL_JoystickDriver SDL_WINDOWS_JoystickDriver} {Init=0x00007ff60a5a4680 {visualboyadvance-m.exe!WINDOWS_JoystickInit(void)} ...} | SDL_JoystickDriver *
  | ▶ hwdata | 0x0000000000000000 <NULL> | joystick_hwdata *
  | props | 4 | unsigned int
  | ref_count | -1 | int
  | ▶ next | 0x0000000000000000 <NULL> | SDL_Joystick *
  | Name | Value | Type
-- | -- | -- | --
◢ | joystick | 0x0000017fbbbb1ab0 {instance_id=1 name=0x0000017fbbbec440 "Xbox Series X Controller" path=0x0000017fbbbc8bf0 "XInput#0" ...} | SDL_Joystick *
  | instance_id | 1 | unsigned int
  | ▶ name | 0x0000017fbbbec440 "Xbox Series X Controller" | char *
  | ▶ path | 0x0000017fbbbc8bf0 "XInput#0" | char *
  | ▶ serial | 0x0000000000000000 <NULL> | char *
  | ▶ guid | {data=0x0000017fbbbb1ad0 "\x3" } | SDL_GUID
  | firmware_version | 0 | unsigned short
  | steam_handle | 0 | unsigned __int64
  | swap_face_buttons | false | bool
  | is_virtual | false | bool
  | naxes | 6 | int
  | ▶ axes | 0x0000017fb846a450 {initial_value=0 value=-858 zero=0 ...} | SDL_JoystickAxisInfo *
  | nballs | 0 | int
  | ▶ balls | 0x0000000000000000 <NULL> | SDL_JoystickBallData *
  | nhats | 1 | int
  | ▶ hats | 0x0000017fbbbcd2e0 "" | unsigned char *
  | nbuttons | 11 | int
  | ▶ buttons | 0x0000017fbbbc8970 {false} | bool *
  | ntouchpads | 0 | int
  | ▶ touchpads | 0x0000000000000000 <NULL> | SDL_JoystickTouchpadInfo *
  | nsensors | 0 | int
  | nsensors_enabled | 0 | int
  | ▶ sensors | 0x0000000000000000 <NULL> | SDL_JoystickSensorInfo *
  | low_frequency_rumble | 0 | unsigned short
  | high_frequency_rumble | 0 | unsigned short
  | rumble_expiration | 0 | unsigned __int64
  | rumble_resend | 0 | unsigned __int64
  | left_trigger_rumble | 0 | unsigned short
  | right_trigger_rumble | 0 | unsigned short
  | trigger_rumble_expiration | 0 | unsigned __int64
  | trigger_rumble_resend | 0 | unsigned __int64
  | led_red | 0 '\0' | unsigned char
  | led_green | 0 '\0' | unsigned char
  | led_blue | 0 '\0' | unsigned char
  | led_expiration | 5671 | unsigned __int64
  | attached | true | bool
  | connection_state | SDL_JOYSTICK_CONNECTION_UNKNOWN (0) | SDL_JoystickConnectionState
  | battery_state | SDL_POWERSTATE_ON_BATTERY (1) | SDL_PowerState
  | battery_percent | 70 | int
  | delayed_guide_button | false | bool
  | accel_sensor | 0 | unsigned int
  | ▶ accel | 0x0000000000000000 <NULL> | SDL_Sensor *
  | gyro_sensor | 0 | unsigned int
  | ▶ gyro | 0x0000000000000000 <NULL> | SDL_Sensor *
  | ▶ sensor_transform | 0x0000017fbbbb1bc0 {0x0000017fbbbb1bc0 {0.00000000, 0.00000000, 0.00000000}, 0x0000017fbbbb1bcc {0.00000000, ...}, ...} | float[3][3]
  | update_complete | 0 | unsigned __int64
  | ▶ driver | 0x00007ff60bf9f5f0 {visualboyadvance-m.exe!SDL_JoystickDriver SDL_WINDOWS_JoystickDriver} {Init=0x00007ff60a5a4680 {visualboyadvance-m.exe!WINDOWS_JoystickInit(void)} ...} | SDL_JoystickDriver *
  | ▶ hwdata | 0x0000000000000000 <NULL> | joystick_hwdata *
  | props | 4 | unsigned int
  | ref_count | -1 | int
  | ▶ next | 0x0000000000000000 <NULL> | SDL_Joystick *
▶ | joystick->hwdata | 0x0000000000000000 <NULL> | joystick_hwdata *

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions