Rémi Bernon : dinput: Also trace report buffers on immediate ReadFile success.

Alexandre Julliard julliard at winehq.org
Fri Feb 18 15:15:00 CST 2022


Module: wine
Branch: master
Commit: f6ef943b9cea7cb82d8c748690fd3354da81ccf7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=f6ef943b9cea7cb82d8c748690fd3354da81ccf7

Author: Rémi Bernon <rbernon at 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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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,




More information about the wine-cvs mailing list