WinJump icon indicating copy to clipboard operation
WinJump copied to clipboard

CreateDesktop() causes AccessViolationException

Open justinhhorner opened this issue 7 months ago • 1 comments

When trying to set "sticky-desktops" greater than 0 WinJump crashes due to an AccessViolationException caused by trying to create new desktops when invoking CreateDestkop.

I originally added the sticky desktops feature, but I think we could remove this as it's just one more thing to maintain with new versions of Windows. Multiple desktops created in Windows will persist, so I don't think there's much value it in anymore.

Are there any reservations on removing the feature?

Description: The process was terminated due to an unhandled exception.
Stack:
   at WinJump.Core.VirtualDesktopDefinitions.Windows11_26100_2605.IVirtualDesktopManagerInternal.CreateDesktop()
   at WinJump.Core.VirtualDesktopDefinitions.Windows11_26100_2605.VirtualDesktopApi.CreateDesktop()
   at WinJump.Core.STAThread.<CreateDesktop>b__11_0()
   at WinJump.Core.STAThread+<>c__DisplayClass20_0.<WrapCall>b__0(System.Object)
   at System.RuntimeMethodHandle.InvokeMethod(System.Object, Void**, System.Signature, Boolean)
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(System.Object, IntPtr*)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(System.Object, System.Span`1<System.Object>, System.Reflection.BindingFlags)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
   at System.Delegate.DynamicInvokeImpl(System.Object[])
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(Windows.Win32.Foundation.HWND, Windows.Win32.MessageId, Windows.Win32.Foundation.WPARAM, Windows.Win32.Foundation.LPARAM)
   at System.Windows.Forms.Application+ComponentManager.Microsoft.Office.IMsoComponentManager.FPushMessageLoop(UIntPtr, Microsoft.Office.msoloop, Void*)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Microsoft.Office.msoloop, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Microsoft.Office.msoloop, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application.Run()
   at WinJump.Core.STAThread+<>c__DisplayClass10_0.<.ctor>b__1()
   at System.Threading.Thread+StartHelper.Callback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.Thread.StartCallback()

justinhhorner avatar Apr 28 '25 17:04 justinhhorner

I'll take a look at this, thanks.

widavies avatar May 03 '25 06:05 widavies