예제 #1
0
        /// <summary>
        /// Check if a connection is active.
        /// </summary>
        /// <returns></returns>
        public bool IsConnected()
        {
            if (this._handle != IntPtr.Zero)
            {
                uint exitCode = 0;
                if (APIMethods.GetExitCodeProcess(this._handle, out exitCode) && exitCode == APIMethods.STILL_ACTIVE)
                {
                    return(true);
                }
                this._mainModuleAddress = 0;
                this._handle            = IntPtr.Zero;
            }

            return(false);
        }