Example #1
0
        public static void lua_sethook(lua_State L, KyHookFunction hookFunction, LuaHookMask mask, int count)
        {
#if SAVE_FUNC
            savedFn.TryAdd(hookFunction);
#endif
            lua_sethook(L, hookFunction.ToFunctionPointer(), (int)mask, count);
        }
Example #2
0
        public int SetDebugHook(LuaHookMask mask, int count)
        {
            if (_hookCallback == null)
            {
                _hookCallback = DebugHookCallback;
                lua_sethook(L, _hookCallback, mask, count);
            }

            return(-1);
        }
Example #3
0
        public static IntPtr ToFunctionPointer(this KyHookFunction d)
        {
            if (d == null)
            {
                return(IntPtr.Zero);
            }

#if NETFRAMEWORK
            return(Marshal.GetFunctionPointerForDelegate(d));
#else
            return(Marshal.GetFunctionPointerForDelegate <KyHookFunction>(d));
#endif
        }
Example #4
0
 public void RemoveDebugHook()
 {
     _hookCallback = null;
     lua_sethook(L, null, LuaHookMask.Disabled, 0);
 }