[Bug 32316] Autodesk 3ds Max 9 32-bit exits silently or crashes on startup with Wine-Mono

WineHQ Bugzilla wine-bugs at winehq.org
Wed Dec 16 11:38:51 CST 2020


https://bugs.winehq.org/show_bug.cgi?id=32316

--- Comment #21 from Bruni <earns.61 at gmail.com> ---
Esme, please take a look at a new testcase.
It passes on native .NET but fails on Mono

Thanks!

using System;
using System.Reflection;
using System.Diagnostics;

namespace AddEventHandlerTestCase
{
    class Program
    {
        private MulticastDelegate m_MulticastDelegate = null;
        public delegate void DelegateFunction(int iValue);
        public event DelegateFunction EventSource
        {
            add
            {
                throw new NotSupportedException();
            }
            remove
            {
            }
        }

        public void TestMethod(int i)
        {
        }

        static void Main(string[] args)
        {
            var p = new Program();
            EventInfo eventInfo = p.GetType().GetEvent("EventSource");
            var methodInfo = p.GetType().GetMethod("TestMethod");
            Delegate handler =
Delegate.CreateDelegate(eventInfo.EventHandlerType, p, methodInfo);

            try
            {
                eventInfo.AddEventHandler(p, handler);
            }
            catch (NotSupportedException e)
            {
                Console.WriteLine("Testcase failed");
                Console.WriteLine("NotSupportedException has been catched and
it is not wrapped by ");
                Console.WriteLine("TargetInvocationException");
                Console.WriteLine("TargetInvocationException was expected as
NotSupportedException ");
                Console.WriteLine("was thrown in an event accessor method
invoked through reflection.");
                Console.WriteLine("See ");
               
Console.WriteLine("docs.microsoft.com/en-us/search/?terms=TargetInvocationException");
                Console.WriteLine("Stacktrace:" + e.StackTrace.ToString());
                Debugger.Break();
            }
            catch (TargetInvocationException e)
            {
                Console.WriteLine("Testcase passed");
                string eInnerExceptionText = e.InnerException.ToString();
                string[] exceptionlines =
                    eInnerExceptionText.Split(new[] { Environment.NewLine },
StringSplitOptions.None);

                Console.WriteLine("TargetInvocationException has been catched
and has inner exception.");
                Console.WriteLine("Inner exception has a type of " +
e.InnerException.GetType());
                Console.WriteLine("Inner exception object was created by:" +
exceptionlines[1]);
                Console.WriteLine("Stacktrace:" + e.StackTrace.ToString());
                Console.ReadLine();
            }
        }
    }
}

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list