signal11/hidapi — pull request #154 by marktsuchida (2013-12-21 21:47:58+00:00)
Title: windows: limit hid_read() retval to buffer length.

On Windows, `hid_read()` and `hid_read_timeout()` were returning the number
of bytes read by `GetOverlappedResult()`, which appears to be the input report
size, even when the requested buffer length is smaller.

As far as I can tell (by reading the code for Linux and OS X, and testing on
OS X), this behavior differs from the implementations for other platforms.

This change limits the return value to the requested length, matching the
behavior on those platforms.