On 10/18/16 7:12 PM, Sebastian Lackner wrote:
On 18.10.2016 18:58, Sebastian Lackner wrote:
Not sure if it is a problem, but due to the fact that the device has been opened a long time before starting to read from it, couldn't there be a large amount of reports in the kernel buffers? Do you think it makes sense to skip such outdated reports?
Actually, isn't there also a problem that reports are skipped in certain situations? Handling of hidclass looks correct to me, but there is a risk that process_hid_report() will drop the report if there is no pending IRP in the list. This happens for a short time inbetween of the IOCTL_HID_READ_REPORT ioctls.
Regards, Sebastian
I dont think that is a big problem. Not that it wont happen but that it is ok to have happen. The 2 ways to read from the minidriver/device layer is to either get the last report from the device or current device state (IOCTL_HID_GET_INPUT_REPORT) or to wait for the next report from the device(IOCTL_HID_READ_REPORT).
There is not specification of a need for a ring buffer or anything like that in the MSDN docs that I can see so it seem like keeping it simple and direct is the best.
As for your other review points, I will not get a real block of time to work on it until maybe Monday. But I will give it a try then. Of course if you have more comments before then they would be welcome.
-aric