Skip to content
Snippets Groups Projects
Commit 2b61d8dd authored by Rémi Bernon's avatar Rémi Bernon :speech_balloon: Committed by Alexandre Julliard
Browse files

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: default avatarRémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard's avatarAlexandre Julliard <julliard@winehq.org>
parent 1014cfcf
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment