From: Ivo Ivanov logos128@gmail.com
This reverts commit b9d6b79fbc23fee93150445dd8f8f8954e524aa0.
With 13a4486, the hidclass.sys FDO itself distributes the input reports by CollectionNumber (report ID) to the corresponding child PDOs. So the lower level driver (winebus.sys) must deliver all input reports regardless of their report IDs. --- dlls/winebus.sys/main.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c index bb588473312..f7a634dbfe2 100644 --- a/dlls/winebus.sys/main.c +++ b/dlls/winebus.sys/main.c @@ -87,7 +87,7 @@ struct device_extension
struct hid_report *last_reports[256]; struct list reports; - IRP *pending_reads[256]; + IRP *pending_read;
UINT32 report_fixups; UINT64 unix_device; @@ -252,13 +252,13 @@ static WCHAR *get_compatible_ids(DEVICE_OBJECT *device) return dst; }
-static IRP *pop_pending_read(struct device_extension *ext, ULONG report_id) +static IRP *pop_pending_read(struct device_extension *ext) { IRP *pending;
RtlEnterCriticalSection(&ext->cs); - pending = ext->pending_reads[report_id]; - ext->pending_reads[report_id] = NULL; + pending = ext->pending_read; + ext->pending_read = NULL; RtlLeaveCriticalSection(&ext->cs);
return pending; @@ -268,16 +268,12 @@ static void remove_pending_irps(DEVICE_OBJECT *device) { struct device_extension *ext = device->DeviceExtension; IRP *pending; - UINT i;
- for (i = 0; i < ARRAY_SIZE(ext->pending_reads); ++i) + if ((pending = pop_pending_read(ext))) { - if ((pending = pop_pending_read(ext, i))) - { - pending->IoStatus.Status = STATUS_DELETE_PENDING; - pending->IoStatus.Information = 0; - IoCompleteRequest(pending, IO_NO_INCREMENT); - } + pending->IoStatus.Status = STATUS_DELETE_PENDING; + pending->IoStatus.Information = 0; + IoCompleteRequest(pending, IO_NO_INCREMENT); } }
@@ -547,7 +543,7 @@ static void process_hid_report(DEVICE_OBJECT *device, BYTE *report_buf, DWORD re else last_report = ext->last_reports[report_buf[0]]; memcpy(last_report->buffer, report_buf, report_len);
- if ((irp = pop_pending_read(ext, report_buf[0]))) + if ((irp = pop_pending_read(ext))) { deliver_next_report(ext, irp); IoCompleteRequest(irp, IO_NO_INCREMENT); @@ -1263,10 +1259,9 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp) { if (!deliver_next_report(ext, irp)) { - BYTE *report_buf = (BYTE *)irp->UserBuffer; /* hidclass.sys should guarantee this */ - assert(!ext->pending_reads[report_buf[0]]); - ext->pending_reads[report_buf[0]] = irp; + assert(!ext->pending_read); + ext->pending_read = irp; IoMarkIrpPending(irp); irp->IoStatus.Status = STATUS_PENDING; }