Sweden-Number/dlls/dinput/tests
Arkadiusz Hiler 5cb70e73f0 dinput/tests: Make overlapped format tests more robust.
Both Acquire() and event processing with DirectInput seem to be
asynchronous. In most cases we can just keep hammering GetDeviceData()
until the event gets processed.

Things get pretty racy around Acquire() though. If we fire event right
after the device is acquired we can find ourselves in one of the three
situations:

1. Event happened after acquiring has completed - the wait will suffice.

2. Event happened before acquiring did any real work - the device will
   pick up the state as if the event was processed, but there's nothing
   in GetDeviceData(). Because of that we cannot fail on wait.

3. Event happened somewhere in the middle of acquiring - we ended up
   both missing the event for GetDeviceData() and we have outdated
   state. Sending event again will register as if the button was not
   already pressed.

This change covers all three scenarios.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-08-05 20:43:28 +02:00
..
Makefile.in
device.c dinput/tests: Make overlapped format tests more robust. 2021-08-05 20:43:28 +02:00
dinput.c dinput: Prefer IDirectInputW interfaces over IDirectInputA. 2021-05-28 21:53:07 +02:00
joystick.c dinput/tests: Use wide-char string literals. 2020-10-07 11:24:12 +02:00
keyboard.c
mouse.c dinput8/tests: Flush events after creating window. 2021-05-25 21:13:01 +02:00