[PATCH 2/3] hidclass.sys: Re-read the poll timeout on every iteration.

Rémi Bernon rbernon at codeweavers.com
Tue Oct 12 03:33:23 CDT 2021


Otherwise it's pointless to have it configurable.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/hidclass.sys/device.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c
index 29b9215aa22..d588970150e 100644
--- a/dlls/hidclass.sys/device.c
+++ b/dlls/hidclass.sys/device.c
@@ -313,9 +313,9 @@ static DWORD CALLBACK hid_device_thread(void *args)
     BASE_DEVICE_EXTENSION *ext = device->DeviceExtension;
     HIDP_COLLECTION_DESC *desc = ext->u.pdo.device_desc.CollectionDesc;
     BOOL polled = ext->u.pdo.information.Polled;
-    ULONG report_id = 0, timeout = 0;
     HIDP_REPORT_IDS *report;
     HID_XFER_PACKET *packet;
+    ULONG report_id = 0;
     IO_STATUS_BLOCK io;
     BYTE *buffer;
     DWORD res;
@@ -324,8 +324,6 @@ static DWORD CALLBACK hid_device_thread(void *args)
     buffer = (BYTE *)(packet + 1);
     packet->reportBuffer = buffer;
 
-    if (polled) timeout = ext->u.pdo.poll_interval;
-
     report = find_report_with_type_and_id( ext, HidP_Input, 0, TRUE );
     if (!report) WARN("no input report found.\n");
     else report_id = report->ReportID;
@@ -356,7 +354,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
                 hid_device_queue_input( device, packet );
         }
 
-        res = WaitForSingleObject(ext->u.pdo.halt_event, timeout);
+        res = WaitForSingleObject(ext->u.pdo.halt_event, polled ? ext->u.pdo.poll_interval : 0);
     } while (res == WAIT_TIMEOUT);
 
     TRACE("device thread exiting, res %#x\n", res);
-- 
2.33.0




More information about the wine-devel mailing list