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

dinput: Hold the HID joystick CS when updating the device state.

The read buffer is only used by the reading thread but the device state is not, we should only update it while holding the CS. Signed-off-by: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 1014cfcf
......@@ -1603,6 +1603,7 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface )
}
}
EnterCriticalSection( &impl->base.crit );
do
{
count = impl->usages_count;
......@@ -1638,6 +1639,7 @@ static HRESULT hid_joystick_read_state( IDirectInputDevice8W *iface )
memset( &impl->read_ovl, 0, sizeof(impl->read_ovl) );
impl->read_ovl.hEvent = impl->base.read_event;
} while (ReadFile( impl->device, report_buf, report_len, &count, &impl->read_ovl ));
LeaveCriticalSection( &impl->base.crit );
return DI_OK;
}
......
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