Exemplo n.º 1
0
 public static extern bool GetThreadContext(IntPtr hThread, ref CONTEXT lpContext);
Exemplo n.º 2
0
 public static extern bool GetThreadContext(IntPtr hThread, ref CONTEXT lpContext);
Exemplo n.º 3
0
        /// <summary>
        /// The dispatcher timer_ tick.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void DispatcherTimer_Tick(object sender, EventArgs e)
        {
            if (this.initialized == false)
            {
                this.initialized = true;
                var t = new Thread(this.threadi);
                t.Start();

                this.dispatcherTimer.Interval = new TimeSpan(0, 0, 5);
                return;
            }

            var context = new CONTEXT();
            try
            {
                if (this.ExecutableName == "iw5mp_server.exe")
                {
                    this.mutex.Close();
                    this.canclose = true;
                    this.Close();
                }

                if (!Win32Apis.GetThreadContext(this.thread, ref context))
                {
                    this.mutex.Close();
                    this.canclose = true;
                    this.Close();
                }
            }
            catch (Exception)
            {
                try
                {
                    this.mutex.Close();
                    this.canclose = true;
                    this.Close();
                }
                catch (Exception)
                {
                    this.canclose = true;
                    this.Close();
                }
            }
        }