hidclass.sys: Remove unnecessary poll_interval == 0 cases.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
286999a9ea
commit
6f9bec436c
|
@ -32,7 +32,6 @@
|
||||||
#include "wine/list.h"
|
#include "wine/list.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(hid);
|
WINE_DEFAULT_DEBUG_CHANNEL(hid);
|
||||||
WINE_DECLARE_DEBUG_CHANNEL(hid_report);
|
|
||||||
|
|
||||||
IRP *pop_irp_from_queue(BASE_DEVICE_EXTENSION *ext)
|
IRP *pop_irp_from_queue(BASE_DEVICE_EXTENSION *ext)
|
||||||
{
|
{
|
||||||
|
@ -282,8 +281,7 @@ static DWORD CALLBACK hid_device_thread(void *args)
|
||||||
hid_device_queue_input( device, packet );
|
hid_device_queue_input( device, packet );
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = WaitForSingleObject(ext->u.pdo.halt_event,
|
rc = WaitForSingleObject(ext->u.pdo.halt_event, ext->u.pdo.poll_interval);
|
||||||
ext->u.pdo.poll_interval ? ext->u.pdo.poll_interval : DEFAULT_POLL_INTERVAL);
|
|
||||||
|
|
||||||
if (rc == WAIT_OBJECT_0)
|
if (rc == WAIT_OBJECT_0)
|
||||||
break;
|
break;
|
||||||
|
@ -616,7 +614,6 @@ NTSTATUS WINAPI pdo_read(DEVICE_OBJECT *device, IRP *irp)
|
||||||
BASE_DEVICE_EXTENSION *ext = device->DeviceExtension;
|
BASE_DEVICE_EXTENSION *ext = device->DeviceExtension;
|
||||||
struct hid_preparsed_data *preparsed = ext->u.pdo.preparsed_data;
|
struct hid_preparsed_data *preparsed = ext->u.pdo.preparsed_data;
|
||||||
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp);
|
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp);
|
||||||
BYTE report_id = HID_INPUT_VALUE_CAPS( preparsed )->report_id;
|
|
||||||
struct hid_report *report;
|
struct hid_report *report;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
BOOL removed;
|
BOOL removed;
|
||||||
|
@ -650,19 +647,14 @@ NTSTATUS WINAPI pdo_read(DEVICE_OBJECT *device, IRP *irp)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ext->u.pdo.poll_interval)
|
KeAcquireSpinLock(&ext->u.pdo.irp_queue_lock, &irql);
|
||||||
{
|
|
||||||
KIRQL old_irql;
|
|
||||||
TRACE_(hid_report)("Queue irp\n");
|
|
||||||
|
|
||||||
KeAcquireSpinLock(&ext->u.pdo.irp_queue_lock, &old_irql);
|
|
||||||
|
|
||||||
IoSetCancelRoutine(irp, read_cancel_routine);
|
IoSetCancelRoutine(irp, read_cancel_routine);
|
||||||
if (irp->Cancel && !IoSetCancelRoutine(irp, NULL))
|
if (irp->Cancel && !IoSetCancelRoutine(irp, NULL))
|
||||||
{
|
{
|
||||||
/* IRP was canceled before we set cancel routine */
|
/* IRP was canceled before we set cancel routine */
|
||||||
InitializeListHead(&irp->Tail.Overlay.ListEntry);
|
InitializeListHead(&irp->Tail.Overlay.ListEntry);
|
||||||
KeReleaseSpinLock(&ext->u.pdo.irp_queue_lock, old_irql);
|
KeReleaseSpinLock(&ext->u.pdo.irp_queue_lock, irql);
|
||||||
return STATUS_CANCELLED;
|
return STATUS_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,30 +662,7 @@ NTSTATUS WINAPI pdo_read(DEVICE_OBJECT *device, IRP *irp)
|
||||||
irp->IoStatus.Status = STATUS_PENDING;
|
irp->IoStatus.Status = STATUS_PENDING;
|
||||||
IoMarkIrpPending(irp);
|
IoMarkIrpPending(irp);
|
||||||
|
|
||||||
KeReleaseSpinLock(&ext->u.pdo.irp_queue_lock, old_irql);
|
KeReleaseSpinLock(&ext->u.pdo.irp_queue_lock, irql);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
HID_XFER_PACKET packet;
|
|
||||||
BYTE *buffer = irp->AssociatedIrp.SystemBuffer;
|
|
||||||
ULONG buffer_len = irpsp->Parameters.Read.Length;
|
|
||||||
|
|
||||||
TRACE("No packet, but opportunistic reads enabled\n");
|
|
||||||
|
|
||||||
packet.reportId = buffer[0];
|
|
||||||
packet.reportBuffer = buffer;
|
|
||||||
packet.reportBufferLen = buffer_len;
|
|
||||||
|
|
||||||
if (!report_id)
|
|
||||||
{
|
|
||||||
packet.reportId = 0;
|
|
||||||
packet.reportBuffer++;
|
|
||||||
packet.reportBufferLen--;
|
|
||||||
}
|
|
||||||
|
|
||||||
call_minidriver( IOCTL_HID_GET_INPUT_REPORT, ext->u.pdo.parent_fdo, NULL, 0, &packet,
|
|
||||||
sizeof(packet), &irp->IoStatus );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status = irp->IoStatus.Status;
|
status = irp->IoStatus.Status;
|
||||||
|
|
Loading…
Reference in New Issue