//
        // System callbacks

        public override bool OnHookInstalled(bool success,
                                             Exception hookEx = null)
        {
            if (hookEx != null)
            {
                LogTo.Error(hookEx,
                            "InjectionLib threw an error during initialization.");
            }

            try
            {
                LogTo.Debug($"Injected lib signal, success: {success}");

                HookSuccess   = success;
                HookException = hookEx;

                HookInitEvent.Set();

                return(SMAInitEvent.WaitOne(WaitTimeout));
            }
            catch (Exception ex)
            {
                LogTo.Error(ex,
                            "Failed to Signal InitEvent for Hook Install Success");

                return(false);
            }
        }
示例#2
0
        //
        // System callbacks

        public override bool OnHookInstalled(bool success,
                                             Exception hookEx = null)
        {
            if (hookEx != null)
            {
                OnException(hookEx);
            }

            try
            {
                LogTo.Debug("Injected lib signal, success: {Success}", success);

                HookSuccess   = success;
                HookException = hookEx;

                HookInitEvent.Set();

                return(SMAInitEvent.WaitOne(WaitTimeout));
            }
            catch (Exception ex)
            {
                LogTo.Error(ex, "Failed to Signal InitEvent for Hook Install Success");

                return(false);
            }
        }