[3/3] hidclass.sys: Only return new reports when reading data from ringbuffer.
Aric Stewart
aric at codeweavers.com
Thu Oct 27 13:49:06 CDT 2016
Signed-off-by: Aric Stewart <aric at codeweavers.com>
On 10/27/16 9:45 AM, Sebastian Lackner wrote:
> Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
> ---
>
> Depending on the buffer size, we might get a huge amount of old reports otherwise.
>
> @ Aric: I believe there are some more things wrong with the ringbuffer implementation.
> We shouldn't really need a ->start pointer, this is exactly what the ring->pointers[]
> are used for. Also, the current implementation never uses all slots.
>
> dlls/hidclass.sys/buffer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dlls/hidclass.sys/buffer.c b/dlls/hidclass.sys/buffer.c
> index 14e83e4..0b29f97 100644
> --- a/dlls/hidclass.sys/buffer.c
> +++ b/dlls/hidclass.sys/buffer.c
> @@ -170,7 +170,7 @@ UINT RingBuffer_AddPointer(struct ReportRingBuffer *ring)
> for( ;count < ring->pointer_alloc; count++)
> ring->pointers[count] = POINTER_UNUSED;
> }
> - ring->pointers[idx] = ring->start;
> + ring->pointers[idx] = ring->end;
> LeaveCriticalSection(&ring->lock);
> return idx;
> }
>
More information about the wine-patches
mailing list