Module: wine Branch: master Commit: f6ef943b9cea7cb82d8c748690fd3354da81ccf7 URL: https://source.winehq.org/git/wine.git/?a=commit;h=f6ef943b9cea7cb82d8c74869...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Feb 18 10:31:13 2022 +0100
dinput: Also trace report buffers on immediate ReadFile success.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dinput/joystick_hid.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index 68db935c44a..4987a9f9872 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -1226,24 +1226,23 @@ static HRESULT hid_joystick_read( IDirectInputDevice8W *iface ) BOOL ret;
ret = GetOverlappedResult( impl->device, &impl->read_ovl, &count, FALSE ); - if (ret && TRACE_ON(dinput)) + + EnterCriticalSection( &impl->base.crit ); + while (ret) { - TRACE( "read size %lu report:\n", count ); - for (i = 0; i < count;) + if (TRACE_ON(dinput)) { - char buffer[256], *buf = buffer; - buf += sprintf(buf, "%08lx ", i); - do + TRACE( "iface %p, size %lu, report:\n", iface, count ); + for (i = 0; i < count;) { - buf += sprintf(buf, " %02x", (BYTE)report_buf[i] ); - } while (++i % 16 && i < count); - TRACE("%s\n", buffer); + char buffer[256], *buf = buffer; + buf += sprintf(buf, "%08lx ", i); + do { buf += sprintf(buf, " %02x", (BYTE)report_buf[i] ); } + while (++i % 16 && i < count); + TRACE("%s\n", buffer); + } } - }
- EnterCriticalSection( &impl->base.crit ); - while (ret) - { count = impl->usages_count; memset( impl->usages_buf, 0, count * sizeof(*impl->usages_buf) ); status = HidP_GetUsagesEx( HidP_Input, 0, impl->usages_buf, &count,