The application WpfD3D11Interop crashes when switching the Windows presentation display modes in a multi-monitor setup.
Steps to reproduce the problem (requires multi-monitor setup):
Run WpfD3D11Interop.
Press Win+P and select another presentation display mode (such as "Second screen only"). (Sometimes you have to repeat step 2 a few times.)
Exception:
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in PresentationCore.dll
Additional information: UCEERR_RENDERTHREADFAILURE (Exception from HRESULT: 0x88980406)
Stack trace:
at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet)
at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam)
at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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)
The Call Stack window in Visual Studio tells me that the application hangs in
PresentationCore.dll!System.Windows.Interop.D3DImage.Lock().
The application WpfD3D11Interop crashes when switching the Windows presentation display modes in a multi-monitor setup.
Steps to reproduce the problem (requires multi-monitor setup):
Exception:
Stack trace:
The Call Stack window in Visual Studio tells me that the application hangs in
PresentationCore.dll!System.Windows.Interop.D3DImage.Lock()
.