1.1 --- a/sourcehook/sourcehook_impl.h Thu Apr 14 16:19:07 2005 +0000
1.2 +++ b/sourcehook/sourcehook_impl.h Sat Apr 16 16:55:53 2005 +0000
1.3 @@ -22,9 +22,26 @@
1.4 class CSourceHookImpl : public ISourceHook
1.5 {
1.6 /**
1.7 - * @brief A list of HookerInfo structures
1.8 + * @brief A hook can be removed if you have this information
1.9 */
1.10 - typedef std::list<HookerInfo> HookerInfoList;
1.11 + struct RemoveHookInfo
1.12 + {
1.13 + RemoveHookInfo(Plugin p, void *i, HookManagerPubFunc h, ISHDelegate *hd, bool ps)
1.14 + : plug(p), iface(i), hpf(h), handler(hd), post(ps)
1.15 + {
1.16 + }
1.17 +
1.18 + Plugin plug;
1.19 + void *iface;
1.20 + HookManagerPubFunc hpf;
1.21 + ISHDelegate *handler;
1.22 + bool post;
1.23 + };
1.24 +
1.25 + /**
1.26 + * @brief A list of HookManagerInfo structures
1.27 + */
1.28 + typedef std::list<HookManagerInfo> HookManInfoList;
1.29
1.30
1.31 /**
1.32 @@ -33,14 +50,14 @@
1.33 typedef std::list<CallClass> Impl_CallClassList;
1.34
1.35 Impl_CallClassList m_CallClasses; //!< A list of already generated callclasses
1.36 - HookerInfoList m_Hookers; //!< A list of hookers
1.37 + HookManInfoList m_HookMans; //!< A list of hook managers
1.38
1.39 int m_PageSize; //!< Stores the system's page size
1.40
1.41 /**
1.42 - * @brief Finds a hooker for a function based on a text-prototype, a vtable offset and a vtable index
1.43 + * @brief Finds a hook manager for a function based on a text-prototype, a vtable offset and a vtable index
1.44 */
1.45 - HookerInfoList::iterator FindHooker(HookerInfoList::iterator begin, HookerInfoList::iterator end,
1.46 + HookManInfoList::iterator FindHookMan(HookManInfoList::iterator begin, HookManInfoList::iterator end,
1.47 const char *proto, int vtblofs, int vtblidx, int thisptrofs);
1.48
1.49 void FreeCallClass(CallClass &cc);
1.50 @@ -57,12 +74,12 @@
1.51 ~CSourceHookImpl();
1.52
1.53 /**
1.54 - * @brief Make sure that a plugin is not used by any other plugins anymore, and unregister all its hookers
1.55 + * @brief Make sure that a plugin is not used by any other plugins anymore, and unregister all its hook managers
1.56 */
1.57 void UnloadPlugin(Plugin plug);
1.58
1.59 /**
1.60 - * @brief Shut down the whole system, unregister all hookers
1.61 + * @brief Shut down the whole system, unregister all hook managers
1.62 */
1.63 void CompleteShutdown();
1.64
1.65 @@ -73,11 +90,12 @@
1.66 *
1.67 * @param plug The unique identifier of the plugin that calls this function
1.68 * @param iface The interface pointer
1.69 - * @param myHooker A hooker (hook manager) function that should be capable of handling the corresponding function
1.70 + * @param ifacesize The size of the class iface points to
1.71 + * @param myHookMan A hook manager function that should be capable of handling the function
1.72 * @param handler A pointer to a FastDelegate containing the hook handler
1.73 * @param post Set to true if you want a post handler
1.74 */
1.75 - bool AddHook(Plugin plug, void *iface, int ifacesize, Hooker myHooker, ISHDelegate *handler, bool post);
1.76 + bool AddHook(Plugin plug, void *iface, int ifacesize, HookManagerPubFunc myHookMan, ISHDelegate *handler, bool post);
1.77
1.78 /**
1.79 * @brief Removes a hook.
1.80 @@ -86,16 +104,14 @@
1.81 *
1.82 * @param plug The unique identifier of the plugin that calls this function
1.83 * @param iface The interface pointer
1.84 - * @param vtableoffset Offset to the vtable, in bytes
1.85 - * @param vtableidx Pointer to the vtable index of the function
1.86 - * @param proto A text version of the function prototype; generated by the macros
1.87 + * @param myHookMan A hook manager function that should be capable of handling the function
1.88 * @param handler A pointer to a FastDelegate containing the hook handler
1.89 * @param post Set to true if you want a post handler
1.90 */
1.91 - bool RemoveHook(Plugin plug, void *iface, Hooker myHooker, ISHDelegate *handler, bool post);
1.92 + bool RemoveHook(Plugin plug, void *iface, HookManagerPubFunc myHookMan, ISHDelegate *handler, bool post);
1.93
1.94 /**
1.95 - * @brief Checks whether a plugin has (a) hooker(s) that is/are currently used by other plugins
1.96 + * @brief Checks whether a plugin has (a) hook manager(s) that is/are currently used by other plugins
1.97 *
1.98 * @param plug The unique identifier of the plugin in question
1.99 */
1.100 @@ -123,7 +139,7 @@
1.101 virtual void *GetIfacePtr(); //!< Gets the interface pointer
1.102
1.103 //////////////////////////////////////////////////////////////////////////
1.104 - // For hookers
1.105 + // For hook managers
1.106 virtual META_RES &GetCurResRef(); //!< Gets the pointer to the current meta result
1.107 virtual META_RES &GetPrevResRef(); //!< Gets the pointer to the previous meta result
1.108 virtual META_RES &GetStatusRef(); //!< Gets the pointer to the status variable