Esempio n. 1
0
        /// <summary>
        /// 取消Hook
        /// </summary>
        /// <returns></returns>
        public bool UnHook()
        {
            if (this._targetApiPointer == IntPtr.Zero)
            {
                return(true);
            }

            var state = Extern.UnHookFunction(ref this._targetApiPointer, this._proxyApiPoinpter);

            if (state == true)
            {
                this._proxyApiPoinpter = IntPtr.Zero;
                this._targetApiPointer = IntPtr.Zero;
                this._proxyApi         = default(TDelegate);
                this.TargetApi         = default(TDelegate);
                ReferenceTable.RemoveRef(this);
            }
            return(state);
        }