static void Main() { onBoot(); Application.ThreadException += new ThreadExceptionEventHandler(applicationThreadException); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(currentDomainUnhandledException); SystemEvents.SessionEnding += new SessionEndingEventHandler(sessionEnding); Mutex procMutex = new Mutex(false, APP_IDENT); if (procMutex.WaitOne(0) && GlobalProcMtx.Create(Consts.PROJECT_GUI_IDENT, APP_TITLE)) { checkSelfDir(); Directory.SetCurrentDirectory(selfDir); checkAloneExe(); checkLogonUser(); Ground.i = new Ground(); Utils.AntiWindowsDefenderSmartScreen(); //Gnd.i.logger.clear(); Ground.i.loadConf(); Ground.i.loadData(); // Kill Zombies { using (NamedEventObject ev = new NamedEventObject(Consts.EV_STOP_SENDER)) { ev.set(); } using (NamedEventObject ev = new NamedEventObject(Consts.EV_STOP_RECORDER)) { ev.set(); } // crypTunnel -> CrypTunnelProc.cs } // orig > Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainWin()); // < orig Ground.i.saveData(); // release Gnd.i { // noop } FileTools.clearTMP(); GlobalProcMtx.Release(); procMutex.ReleaseMutex(); } procMutex.Close(); }
public void Dispose() { if (_proc != null) { using (NamedEventObject evStop = new NamedEventObject(Consts.EV_STOP_RECORDER)) { do { evStop.set(); }while (_proc.WaitForExit(2000) == false); } _proc = null; } }