mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-04-21 18:13:14 +02:00
24 lines
703 B
C#
24 lines
703 B
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Ryujinx.Cpu.Signal
|
|
{
|
|
static partial class WindowsSignalHandlerRegistration
|
|
{
|
|
[LibraryImport("kernel32.dll")]
|
|
private static partial nint AddVectoredExceptionHandler(uint first, nint handler);
|
|
|
|
[LibraryImport("kernel32.dll")]
|
|
private static partial ulong RemoveVectoredExceptionHandler(nint handle);
|
|
|
|
public static nint RegisterExceptionHandler(nint action)
|
|
{
|
|
return AddVectoredExceptionHandler(1, action);
|
|
}
|
|
|
|
public static bool RemoveExceptionHandler(nint handle)
|
|
{
|
|
return RemoveVectoredExceptionHandler(handle) != 0;
|
|
}
|
|
}
|
|
}
|