Skip to content

System.OverflowException in PresentationFramework.dll in System.Windows.Shell.WindowChromeWorker #6777

Closed

Description

@lindexi
  • .NET Core Version: All
  • Windows version: All
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes

Problem description:

We have been getting a crash when using the mouse on certain windows in our WPF application. This Stackoverflow issue appears with exactly the same error messages as our own so I believe it to be relevant. https://stackoverflow.com/questions/33287542/what-would-cause-wm-nchittest-lparam-to-overflow-a-32-bit-integer

This issue has also been reported to the Visual Studio community site and a simple test application has been provided. https://developercommunity.visualstudio.com/content/problem/167357/overflow-exception-in-windowchrome.html

The crashes occur on a Windows 10 Pro Version 1709 OS Build 16299.309, win7 sp1, Windows10 21H2 19044.1645

I run the application with .NET 6.0.5 and @contre run the application with .NET Framework 4.6.2

Actual behavior:

System.OverflowException
  HResult=0x80131516
  Message=Arithmetic operation resulted in an overflow.
  Source=PresentationFramework
  StackTrace:
   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)
   at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

Expected behavior:

It can work well.

Minimal repro:

Any WPF application which use WindowChrome . But we must run the application on the special system.

CC @batzen

Activity

  1. ghost locked as resolved and limited conversation to collaborators on Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions