-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Hi, we've had multiple customers using a Logitech mouse report crashes lately with this stack:
OverflowException: Arithmetic operation resulted in an overflow.
at System.Windows.Shell.WindowChromeWorker._HandleNCHitTest(WM uMsg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Shell.WindowChromeWorker._WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
It sounds like it is a Logitech driver bug that isn't well handled by .NET.
https://stackoverflow.com/questions/50282355/why-does-my-wpf-application-crash-when-i-bump-my-mousewheel
https://developercommunity.visualstudio.com/t/overflow-exception-in-windowchrome/167357
“WPF applications which are built for x64 and use the WindowChrome class throw an OverflowException when receiving a horizontal scroll command from a Logitech mouse configured with SetPoint.”
“It seems like a bad assumption is made in Standard.Utility that lParams always fit in 32 bits, and some mouse drivers violate that on 64-bit systems by writing there.”
The developer community issue was closed long ago, but we recently updated to .NET 6 and started getting customer reports (although we have not been able to determine how to repro it locally). The developer community post has a suggested workaround, but it's a fairly ugly workaround to add so we'd like to see about getting a fix in .NET.
Thanks!