[3/3] hidclass.sys: Only return new reports when reading data from ringbuffer.

Sebastian Lackner sebastian at fds-team.de
Thu Oct 27 09:45:00 CDT 2016


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;
 }
-- 
2.9.0



More information about the wine-patches mailing list