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).
https://bugs.winehq.org/show_bug.cgi?id=37667
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
--- Comment #1 from Sebastian Lackner sebastian@fds-team.de --- Patches are not picked up from bugzilla. Please try to submit it as a patch to the mailing list, see http://wiki.winehq.org/SubmittingPatches for more information. As your information is based on MSDN (which is also very often wrong), it probably makes sense to add a test for that, too.
(Just curious, but is this issue related to any real application?)
https://bugs.winehq.org/show_bug.cgi?id=37667
--- Comment #2 from Andrew Church achurch+wine@achurch.org --- (In reply to Sebastian Lackner from comment #1)
Patches are not picked up from bugzilla. Please try to submit it as a patch to the mailing list, see http://wiki.winehq.org/SubmittingPatches for more information. As your information is based on MSDN (which is also very often wrong), it probably makes sense to add a test for that, too.
I'll look into that but I don't have a lot of spare cycles at the moment. For the record, (not that I think the patch is large enough to be copyrightable but) I release this patch into the public domain.
(Just curious, but is this issue related to any real application?)
Why else would I bother reporting it? (:
https://bugs.winehq.org/show_bug.cgi?id=37667
--- Comment #3 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Andrew Church from comment #2)
(Just curious, but is this issue related to any real application?)
Why else would I bother reporting it? (:
It's a common practice to share the application name, usually in the bug subject. Something like: "Application XYZ needs GetRawInputDeviceList to set ERROR_INSUFFICIENT_BUFFER on too small buffer."
https://bugs.winehq.org/show_bug.cgi?id=37667
Andrew Church achurch+wine@achurch.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|GetRawInputDeviceList() |Custom game development |does not set an error code |library needs |on failure |GetRawInputDeviceList to | |set | |ERROR_INSUFFICIENT_BUFFER | |on too small buffer
https://bugs.winehq.org/show_bug.cgi?id=37667
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=37667
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |focht@gmx.net Ever confirmed|0 |1
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello folks,
obviously still present as of Wine 1.7.43
The patch from Andrew is available/included in Wine-Staging by default:
https://github.com/wine-compholio/wine-staging/blob/master/patches/user32-Ge...
Still missing test case though -or- provide the information on the app/version/download to reproduce/test the fix.
It's as Bruno said: not providing certain information for whatever reasons ("employer/customer NDA", "secret home project", "distributed internet backup") makes the bug report automatically unattractive to others and you're basically on your own when it comes to get the issue analyzed/fixed in vanilla. Fortunately you figured it out on your own.
Regards
https://bugs.winehq.org/show_bug.cgi?id=37667
--- Comment #5 from Andrew Church achurch+wine@achurch.org --- Patch (with test) sent to wine-devel.
FYI, I posted this not in the sense of "help me fix this problem" but rather as an informational "this problem exists and here's the fix". I personally have no problem continuing to patch Wine (I already have something like a dozen local patches I apply to each release), but I thought it might be useful if the developers were interested in more closely matching Windows behavior. I am a bit surprised to hear that the Wine developers prefer mailing list threads over a bug tracker / code review system / etc for managing patches, but to each their own, I suppose.
https://bugs.winehq.org/show_bug.cgi?id=37667
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |e0ba6d8fdb9562810231df8fb0b | |37dd05188e3b8 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #6 from Bruno Jesus 00cpxxx@gmail.com --- Fixed by http://source.winehq.org/git/wine.git/commitdiff/e0ba6d8fdb9562810231df8fb0b...
https://bugs.winehq.org/show_bug.cgi?id=37667
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.44.
https://bugs.winehq.org/show_bug.cgi?id=37667
Qian Hong fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com