2dbbc9bc05
* Move most of signal handling to Ryujinx.Cpu project * Format whitespace * Remove unused member * Format whitespace * This does not need to be public anymore
24 lines
715 B
C#
24 lines
715 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Ryujinx.Cpu.Signal
|
|
{
|
|
static partial class WindowsSignalHandlerRegistration
|
|
{
|
|
[LibraryImport("kernel32.dll")]
|
|
private static partial IntPtr AddVectoredExceptionHandler(uint first, IntPtr handler);
|
|
|
|
[LibraryImport("kernel32.dll")]
|
|
private static partial ulong RemoveVectoredExceptionHandler(IntPtr handle);
|
|
|
|
public static IntPtr RegisterExceptionHandler(IntPtr action)
|
|
{
|
|
return AddVectoredExceptionHandler(1, action);
|
|
}
|
|
|
|
public static bool RemoveExceptionHandler(IntPtr handle)
|
|
{
|
|
return RemoveVectoredExceptionHandler(handle) != 0;
|
|
}
|
|
}
|
|
}
|