https://bugs.winehq.org/show_bug.cgi?id=37667
Bug ID: 37667 Summary: GetRawInputDeviceList() does not set an error code on failure Product: Wine Version: 1.7.32 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: achurch+wine@achurch.org Distribution: ---
Created attachment 50134 --> https://bugs.winehq.org/attachment.cgi?id=50134 gridl-fix.diff
When GetRawInputDeviceList() is passed a buffer which is too small, the function should set the last error code to ERROR_INSUFFICIENT_BUFFER and return failure (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms645598(v=vs.85).aspx). However, the current Wine implementation does not set the last error code, meaning that callers expecting to see ERROR_INSUFFICIENT_BUFFER will behave incorrectly.
Patch attached (the patch is against wine-1.7.29 but the code is unchanged in git).