1 // ManagedErrorInfo class
3 // Eberhard Beilharz (eb1@sil.org)
5 // Copyright (C) 2012 SIL International
10 using System.Runtime.CompilerServices;
11 using System.Security;
13 namespace System.Runtime.InteropServices
16 /// Helper class that allows to pass an exception as an IErrorInfo object. This is useful
17 /// when we get an exception in managed code that is called from unmanaged code that is called
18 /// from managed code and we want to get to the exception in the outer managed code.
20 internal class ManagedErrorInfo: IErrorInfo
22 private Exception m_Exception;
23 public ManagedErrorInfo (Exception e)
28 public Exception Exception {
29 get { return m_Exception; }
33 public int GetGUID (out Guid guid)
40 public int GetSource (out string source)
42 source = m_Exception.Source;
46 public int GetDescription (out string description)
48 description = m_Exception.Message;
52 public int GetHelpFile (out string helpFile)
54 helpFile = m_Exception.HelpLink;
58 public int GetHelpContext(out uint helpContext)