public static void checkHooksToInstall() { try { lock (sync_object) { hooks_to_install.ExceptWith(hooks_installed); if (hooks_to_install.Count == 0) { return; } foreach (APIFullName api_full_name in hooks_to_install) { HookDescription hd = getHookDescription(api_full_name); if (hd == null) { throw new NoSuchHookException("No hook found for API " + api_full_name); } try { hd.installHook(call_back); hooks_installed.Add(api_full_name); } catch (System.DllNotFoundException) { Console.WriteLine("" + api_full_name.library_name + " wasn't found.\n\t Hook " + api_full_name + " wasn't installed."); } } } } catch (System.Exception ex) { Console.WriteLine("HookRegistry.checkHooksToInstall \n---------------------\n" + ex + "\n------------------------------------"); } }
/// <summary> /// This method loads hook description object into the database /// </summary> /// <param name="hd"></param> public static void loadHookInfo(HookDescription hd) { try { flat_hook_db.Add(hd.api_full_name, hd); } catch (System.ArgumentException) { Console.WriteLine("Hook " + hd.api_full_name + " was registered already"); } }