Commit cd6bab2b authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dinput: Set HID joystick internal ref before trying to open it.

So that an open failure will not decrement it to -1. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent afe10430
......@@ -2013,12 +2013,12 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi
impl->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": hid_joystick.base.crit");
impl->base.dwCoopLevel = DISCL_NONEXCLUSIVE | DISCL_BACKGROUND;
impl->base.read_event = CreateEventW( NULL, TRUE, FALSE, NULL );
impl->internal_ref = 1;
hr = hid_joystick_device_open( -1, &instance, impl->device_path, &impl->device, &impl->preparsed,
&attrs, &impl->caps, dinput->dwVersion );
if (hr != DI_OK) goto failed;
impl->internal_ref = 1;
impl->base.instance = instance;
impl->base.caps.dwDevType = instance.dwDevType;
impl->attrs = attrs;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment