feat: add exception handler debug

This commit is contained in:
goat 2020-06-06 18:44:52 +02:00
parent 2d6de01c39
commit e2ac9ddd43
2 changed files with 45 additions and 2 deletions

View file

@ -56,6 +56,15 @@ namespace Dalamud
FLASHW_TIMERNOFG = 12
}
[Flags]
public enum ErrorModes : uint
{
SYSTEM_DEFAULT = 0x0,
SEM_FAILCRITICALERRORS = 0x0001,
SEM_NOALIGNMENTFAULTEXCEPT = 0x0004,
SEM_NOGPFAULTERRORBOX = 0x0002,
SEM_NOOPENFILEERRORBOX = 0x8000
}
#endregion
@ -109,5 +118,14 @@ namespace Dalamud
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Ansi)]
public static extern IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPStr)]string lpFileName);
[DllImport("kernel32.dll")]
public static extern IntPtr SetUnhandledExceptionFilter(IntPtr lpTopLevelExceptionFilter);
[DllImport("kernel32.dll")]
public static extern ErrorModes SetErrorMode(ErrorModes uMode);
[DllImport("kernel32.dll", SetLastError = true)]
public static extern bool DebugActiveProcess(uint dwProcessId);
}
}