core-legacy/sourcehook/sourcehook_impl.h
author David Anderson <dvander@alliedmods.net>
Fri Nov 14 05:02:00 2008 -0600 (2008-11-14)
changeset 545 07e5df11f9fc
parent 541 core-1.4/sourcehook/sourcehook_impl.h@35a8cda28485
child 659 b35a5fdbc654
permissions -rw-r--r--
Renamed core-1.4 to core-legacy.
     1 /* ======== SourceHook ========
     2 * Copyright (C) 2004-2008 Metamod:Source Development Team
     3 * No warranties of any kind
     4 *
     5 * License: zlib/libpng
     6 *
     7 * Author(s): Pavol "PM OnoTo" Marko
     8 * ============================
     9 */
    10 
    11 #ifndef __SOURCEHOOK_IMPL_H__
    12 #define __SOURCEHOOK_IMPL_H__
    13 
    14 #include "sourcehook.h"
    15 #include "sh_list.h"
    16 #include "sh_vector.h"
    17 #include "sh_tinyhash.h"
    18 #include "sh_stack.h"
    19 
    20 /*
    21 
    22 IMPLEMENTATION INFO
    23 
    24 ---------------------------------------
    25 Protos ("Prototypes")
    26 	The purpose of protos is to provide the amount of type information about a function
    27 	which is required to be able to execute a function call without corrupting the stack.
    28 	Our protos do not fully do this, but they provide the size of the return value, the number of
    29 	parameters, and the size of each parameter, which is enough for most situations.
    30 
    31 	There are two version of protos:
    32 	OLD:
    33 		C-Style strings.
    34 
    35 		0_void:
    36 		"attrib"
    37 		1_void:
    38 		"attrib|param1_type"
    39 		2_void:
    40 		"attrib|param1_type|param2_type
    41 		0:
    42 		"attrib|ret_type"
    43 		1:
    44 		"attrib|ret_type|param1_type"
    45 		2:
    46 		"attrib|ret_type|param2_type"
    47 
    48 		Old protos are deprecated.
    49 
    50 	NEW:
    51 		New protos are in fact pointers to the ProtoInfo structure (see sourcehook.h)
    52 
    53 	Old protos begin with a non-zero byte, new protos begin with a zero byte.
    54 
    55 	Protos are usually stored in a CProto instance.
    56 
    57 ---------------------------------------
    58 Hook managers and hook manager containers
    59 	Each hookman container is tied to _one_ proto/vtable index/vtable offset info.
    60 	Hookman containers then contain a list of hook managers provided by plugins, sorted by version.
    61 	(higher versions come first)
    62 
    63 	Duplicate hook managers are ignored (ie. hook managers where proto, vtable index, vtable offset,
    64 	plugin, version are the same as in an already exisiting hook manager)
    65 
    66 	A new hook manager is always added to the end of the version group in the corresponding
    67 	hook container. 
    68 
    69 	If the new hook manager was added to the beginning of the container (which only happens if
    70 	it is the first one or if it has a higher version than the previously first hook manager),
    71 	the now second hook manager is shut down and the new hook manager takes its job.
    72 
    73 	A "hook manager container id" (HMCI) consits of three values: proto, vtbl index, vtbl offset.
    74 ---------------------------------------
    75 Hooks 
    76 	When adding a hook, first the proposed hook manager is added to the corresponding
    77 	hook manager container as described above.
    78 
    79 	Then the first hook manager in the the manhook container is chosen to handle the function.
    80 
    81 	Removing a hook does not neccessarily unreigster the plugin's hook manager. In order to do this,
    82 	use RemoveHookManager or UnloadPlugin/
    83 
    84 	Hooks can be paused - they remain in memory but they are not called. In SH, the hook iterator
    85 	classes handle pausing transparently.
    86 
    87 	The hook loop is supposed to call ShouldContinue before each iteration. This makes hook handlers
    88 	able to remove themselves.
    89 
    90 ---------------------------------------
    91 Call classes
    92 	Call classes are identified by a this pointer and an instance size
    93 
    94 	We use the instance size because a derived class instance and a base class instance could
    95 	have the same this pointers, and we want to avoid that the derived class
    96 	(which could be bigger) gets the same callclass as the base class (mainly if the
    97 	base class' callclass was requested first).
    98 
    99 	Call classes are reference counted.
   100 
   101 	The original function pointers are stored in a vector (in order to allow fast random access).
   102 	These vectors are stored as the value type of a hash. The key type is int and represents the
   103 	vtable offset.
   104 
   105 	If the hash key doesn't exist or the vtblidx is out of range or the corresponding element in the
   106 	vector is NULL, there is no hook on that function.
   107 
   108 ---------------------------------------
   109 Recalls
   110 	Recalls are used for the META_RETURN_(VALUE_)NEWPARAMS macros, ie. to change the parameters
   111 	in the hook loop on the fly.
   112 	
   113 	First, the macro calls DoRecall(), then it calls the function the hook is attached to -> it 
   114 	calls the hookfunc. SourceHook makes sure that the newly invoked hook loop starts where the last
   115 	one left off and that status variables like status, previous result, override return are kept.
   116 	When this recurisvely called hookfunc returns, the macro returns what it returned
   117 	(using MRES_SUPERCEDE). CSourceHookImpl returns false from ShouldContinue so the original hook loop
   118 	is abandonned.
   119 
   120 Post Recalls
   121 	People wanted to be able to use META_RETURN_(VALUE_)NEWPARAMS from post hooks as well. Crazy people!
   122 	Anyway, for this, we have to know where a hook handler is. Is it executing pre or post hooks at the moment?
   123 	The only way we can know this is watching when it calls CHookList::GetIter(). So CHookList gets a new variable:
   124 	m_RequestedFlag. It also gets two new functions: RQFlagReset() and RQFlagGet().
   125 	HookLoopBegin() calls RQFlagReset on both hooklists of the iface; then DoRecall() checks whether the postlist's 
   126 	RQ flag is set. if yes, the hook loop is in post mode.
   127 
   128 	So, what a about a recall in post mode? The first ShouldContinue returns false and sets Status to supercede. 
   129 	This way the pre hooks and the function call will be skipped. Then, then next ShouldContinue returns true, so we get
   130 	into the post hooks. HA!
   131 
   132 Return Values in Post Recalls
   133 	The easy case is when we already have an override return value. In this case, the status register gets transferred,
   134 	and so does the override return pointer. So, basically, everything is ok.
   135 
   136 	However, what happens if we don't? ie. the status register is on MRES_IGNORED? In this case we'd have to transfer the
   137 	orig ret value. But we can't: There's no way to tell the hookfunc: "Use this as orig ret pointer". It uses its own.
   138 	So, we emulate it. GetOrigRet will return the orig ret pointer from the old hook loop. If still no one overrides it,
   139 	we'd have to return it. BUT! HOW TO DO THIS? Check out SH_RETURN(). First calls HookLoopEnd(), then decides whether
   140 	to return the override retval or the orig retval. But it doesn't ask for a new override return. So we give the function
   141 	the last orig return value as its new override return value; but leave status where it is so everything works, and in
   142 	HookLoopEnd we make sure that status is high enough so that the override return will be returned. crazy.
   143 
   144 	All this stuff could be much less complicated if I didn't try to preserve binary compatibility :)
   145 */
   146 
   147 namespace SourceHook
   148 {
   149 	/**
   150 	*	@brief The SourceHook implementation class
   151 	*/
   152 	class CSourceHookImpl : public ISourceHook
   153 	{
   154 	private:
   155 		class CProto
   156 		{
   157 			char *m_Proto;
   158 
   159 			static bool Equal(const char *p1, const char *p2);
   160 			char *DupProto(const char *src);
   161 			void FreeProto(char *prot);
   162 		public:
   163 			CProto(const char *szProto) : m_Proto(DupProto(szProto))
   164 			{
   165 			}
   166 
   167 			CProto(const CProto &other) : m_Proto(DupProto(other.m_Proto))
   168 			{
   169 			}
   170 
   171 			~CProto()
   172 			{
   173 				FreeProto(m_Proto);
   174 				m_Proto = NULL;
   175 			}
   176 
   177 			void operator = (const char *szProto)
   178 			{
   179 				m_Proto = DupProto(szProto);
   180 			}
   181 
   182 			void operator = (const CProto &other)
   183 			{
   184 				m_Proto = DupProto(other.m_Proto);
   185 			}
   186 
   187 			bool operator == (const char *szProto) const
   188 			{
   189 				return Equal(szProto, m_Proto);
   190 			}
   191 			bool operator == (const CProto &other) const
   192 			{
   193 				return Equal(other.m_Proto, m_Proto);
   194 			}
   195 		};
   196 
   197 
   198 		/**
   199 		*	@brief A hook can be removed if you have this information
   200 		*/
   201 		struct RemoveHookInfo
   202 		{
   203 			RemoveHookInfo(Plugin pplug, void *piface, int tpo, HookManagerPubFunc phookman,
   204 				ISHDelegate *phandler, bool ppost)
   205 				: plug(pplug), iface(piface), thisptr_offs(tpo),
   206 				hookman(phookman), handler(phandler), post(ppost)
   207 			{
   208 			}
   209 
   210 			Plugin plug;
   211 			void *iface;
   212 			int thisptr_offs;
   213 			HookManagerPubFunc hookman;
   214 			ISHDelegate *handler;
   215 			bool post;
   216 		};
   217 
   218 		struct RemoveHookManInfo
   219 		{
   220 			RemoveHookManInfo(Plugin pplug, HookManagerPubFunc phookman)
   221 				: plug(pplug), hookman(phookman)
   222 			{
   223 			}
   224 
   225 			Plugin plug;
   226 			HookManagerPubFunc hookman;
   227 		};
   228 
   229 		struct HookInfo
   230 		{
   231 			ISHDelegate *handler;			//!< Pointer to the handler
   232 			bool paused;					//!< If true, the hook should not be executed
   233 			Plugin plug;					//!< The owner plugin
   234 			int thisptr_offs;				//!< This pointer offset
   235 		};
   236 
   237 		class CHookList : public IHookList
   238 		{
   239 		public:
   240 			List<HookInfo> m_List;
   241 
   242 			friend class CIter;
   243 
   244 			class CIter : public IHookList::IIter
   245 			{
   246 				friend class CHookList;
   247 
   248 				CHookList *m_pList;
   249 
   250 				void SkipPaused();
   251 			public:
   252 
   253 				List<HookInfo>::iterator m_Iter;
   254 
   255 				CIter(CHookList *pList);
   256 
   257 				virtual ~CIter();
   258 
   259 				void GoToBegin();
   260 				void GoToEnd();
   261 				void Set(CIter *pOther);
   262 
   263 				bool End();
   264 				void Next();
   265 				ISHDelegate *Handler();
   266 				int ThisPtrOffs();
   267 
   268 				void Clear();
   269 
   270 				CIter *m_pNext;		// When stored in m_FreeIters and m_UsedIters
   271 				CIter *m_pPrev;		// Only used when stored in m_UsedIters
   272 			};
   273 
   274 			CIter *m_FreeIters;
   275 			CIter *m_UsedIters;		// The last returned and not-yet-released iter is always m_UsedIters
   276 
   277 			// For recalls
   278 			bool m_Recall;
   279 			bool m_RQFlag;
   280 			bool m_RelFlag;
   281 
   282 			void SetRecallState();	// Sets the list into a state where the next returned
   283 									// iterator (from GetIter) will be a copy of the last
   284 									// returned iterator, incremented by one. This is used in Recalls.
   285 									// The hook resets this state automatically on:
   286 									// GetIter, ReleaseIter
   287 
   288 			void RQFlagReset() { m_RQFlag = false; m_RelFlag = false; }
   289 			bool RQFlagGet() { return m_RQFlag; }
   290 			bool RelFlagGet() { return m_RelFlag; }
   291 			CHookList();
   292 			CHookList(const CHookList &other);
   293 			virtual ~CHookList();
   294 
   295 			void operator=(const CHookList &other);
   296 
   297 			IIter *GetIter();
   298 			void ReleaseIter(IIter *pIter);
   299 		};
   300 
   301 		// I know, data hiding... But I'm a lazy bastard!
   302 
   303 		class CIface : public IIface
   304 		{
   305 		public:
   306 			void *m_Ptr;
   307 			CHookList m_PreHooks;
   308 			CHookList m_PostHooks;
   309 		public:
   310 			CIface(void *ptr);
   311 			virtual ~CIface();
   312 
   313 			void *GetPtr();
   314 			IHookList *GetPreHooks();
   315 			IHookList *GetPostHooks();
   316 
   317 			bool operator==(void *ptr)
   318 			{
   319 				return m_Ptr == ptr;
   320 			}
   321 		};
   322 
   323 		class CVfnPtr : public IVfnPtr
   324 		{
   325 		public:
   326 			typedef List<CIface> IfaceList;
   327 			typedef IfaceList::iterator IfaceListIter;
   328 
   329 			void *m_Ptr;
   330 			void *m_OrigEntry;
   331 
   332 			IfaceList m_Ifaces;
   333 
   334 		public:
   335 			CVfnPtr(void *ptr);
   336 			virtual ~CVfnPtr();
   337 
   338 			void *GetVfnPtr();
   339 			void *GetOrigEntry();
   340 
   341 			virtual IIface *FindIface(void *ptr);
   342 
   343 			bool operator==(void *ptr)
   344 			{
   345 				return m_Ptr == ptr;
   346 			}
   347 		};
   348 
   349 		class CHookManagerInfo : public IHookManagerInfo
   350 		{
   351 		public:
   352 			typedef List<CVfnPtr> VfnPtrList;
   353 			typedef VfnPtrList::iterator VfnPtrListIter;
   354 
   355 			Plugin m_Plug;
   356 			HookManagerPubFunc m_Func;
   357 
   358 			int m_VtblOffs;
   359 			int m_VtblIdx;
   360 			const char *m_Proto;
   361 			void *m_HookfuncVfnptr;
   362 
   363 			VfnPtrList m_VfnPtrs;
   364 
   365 			int m_HookManVersion;
   366 		public:
   367 			CHookManagerInfo();
   368 			virtual ~CHookManagerInfo();
   369 
   370 			IVfnPtr *FindVfnPtr(void *vfnptr);
   371 
   372 			void SetInfo(int vtbl_offs, int vtbl_idx, const char *proto);
   373 			void SetHookfuncVfnptr(void *hookfunc_vfnptr);
   374 
   375 			void SetVersion(int version);
   376 
   377 			bool operator < (const CHookManagerInfo &other)
   378 			{
   379 				return m_HookManVersion < other.m_HookManVersion;
   380 			}
   381 
   382 			struct Descriptor
   383 			{
   384 				Descriptor(Plugin pplug, HookManagerPubFunc ppubFunc) : plug(pplug), pubFunc(ppubFunc)
   385 				{
   386 				}
   387 
   388 				Plugin plug;
   389 				HookManagerPubFunc pubFunc;
   390 			};
   391 
   392 			bool operator == (const Descriptor desc)
   393 			{
   394 				return m_Func == desc.pubFunc && m_Plug == desc.plug;
   395 			}
   396 		};
   397 
   398 		typedef List<CHookManagerInfo> HookManInfoList;
   399 
   400 		class CHookManagerContainer : public HookManInfoList
   401 		{
   402 		public:
   403 			// HMCI (Hook Manager Container Identification)
   404 			class HMCI
   405 			{
   406 				CProto m_Proto;
   407 				int m_VtableOffset;
   408 				int m_VtableIndex;
   409 			public:
   410 				HMCI(const char *proto, int vtbloffs, int vtblidx) :
   411 				  m_Proto(proto), m_VtableOffset(vtbloffs), m_VtableIndex(vtblidx)
   412 				  {
   413 				  }
   414 				  ~HMCI()
   415 				  {
   416 				  }
   417 
   418 				  bool operator==(const HMCI &other) const
   419 				  {
   420 					  return
   421 						  other.m_VtableIndex == m_VtableIndex &&
   422 						  other.m_Proto == m_Proto &&
   423 						  other.m_VtableOffset == m_VtableOffset;
   424 				  }
   425 
   426 				  const CProto &GetProto() const
   427 				  {
   428 					  return m_Proto;
   429 				  }
   430 				  int GetVtableOffset() const
   431 				  {
   432 					  return m_VtableOffset;
   433 				  }
   434 				  int GetVtableIndex() const
   435 				  {
   436 					  return m_VtableIndex;
   437 				  }
   438 			};
   439 			HMCI m_HCMI;
   440 
   441 		public:
   442 			CHookManagerContainer(const HMCI &hmci) : m_HCMI(hmci)
   443 			{
   444 			}
   445 			bool operator == (const HMCI &other) const
   446 			{
   447 				return m_HCMI == other;
   448 			}
   449 			void AddHookManager(Plugin plug, const CHookManagerInfo &hookman);
   450 		};
   451 
   452 		class CCallClassImpl : public GenericCallClass
   453 		{
   454 		public:
   455 
   456 			typedef SourceHook::CVector<void*> OrigFuncs;
   457 			typedef SourceHook::THash<int, OrigFuncs> OrigVTables;
   458 
   459 			void *m_Ptr;			//!< Pointer to the actual object
   460 			size_t m_ObjSize;		//!< Size of the instance
   461 			OrigVTables m_VT;		//!< Info about vtables & functions
   462 
   463 			int m_RefCounter;
   464 
   465 			CCallClassImpl(void *ptr, size_t size);
   466 			virtual ~CCallClassImpl();
   467 
   468 			bool operator==(void *other)
   469 			{
   470 				return m_Ptr == other;
   471 			}
   472 
   473 			void *GetThisPtr();
   474 			void *GetOrigFunc(int vtbloffs, int vtblidx);
   475 
   476 			void ApplyCallClassPatch(int vtbl_offs, int vtbl_idx, void *orig_entry);
   477 			void RemoveCallClassPatch(int vtbl_offs, int vtbl_idx);
   478 		};
   479 
   480 		/**
   481 		*	@brief A list of CallClass structures
   482 		*/
   483 		typedef List<CCallClassImpl> Impl_CallClassList;
   484 
   485 		Impl_CallClassList m_CallClasses;			//!< A list of already generated callclasses
   486 
   487 		/**
   488 		*	@brief A list of CHookManagerContainers
   489 		*/
   490 		typedef List<CHookManagerContainer> HookManContList;
   491 
   492 		HookManContList m_HookMans;					//!< A list of hook managers
   493 
   494 		struct HookLoopInfo
   495 		{
   496 			enum RecallType
   497 			{
   498 				Recall_No=0,
   499 				Recall_Pre,
   500 				Recall_Post1,
   501 				Recall_Post2
   502 			};
   503 
   504 			META_RES *pStatus;
   505 			META_RES *pPrevRes;
   506 			META_RES *pCurRes;
   507 
   508 			META_RES temporaryStatus;				//!< Stored during Post1 recall phase
   509 			bool shouldContinue;
   510 			RecallType recall;						//!< Specifies which kind of recall we're in.
   511 
   512 			IIface *pCurIface;
   513 			const void *pOrigRet;
   514 			void *pOverrideRet;
   515 			void **pIfacePtrPtr;
   516 		};
   517 		typedef CStack<HookLoopInfo> HookLoopInfoStack;
   518 
   519 		void ApplyCallClassPatches(CCallClassImpl &cc);
   520 		void ApplyCallClassPatches(void *ifaceptr, int vtbl_offs, int vtbl_idx, void *orig_entry);
   521 		void RemoveCallClassPatches(void *ifaceptr, int vtbl_offs, int vtbl_idx);
   522 
   523 		void SetPluginPaused(Plugin plug, bool paused);
   524 
   525 		HookLoopInfoStack m_HLIStack;
   526 	public:
   527 		CSourceHookImpl();
   528 		virtual ~CSourceHookImpl();
   529 
   530 		/**
   531 		*	@brief Returns the interface version
   532 		*/
   533 		int GetIfaceVersion();
   534 
   535 		/**
   536 		*	@brief Returns the implemnetation version
   537 		*/
   538 		int GetImplVersion();
   539 
   540 		/**
   541 		*	@brief Make sure that a plugin is not used by any other plugins anymore, and unregister all its hook managers
   542 		*/
   543 		void UnloadPlugin(Plugin plug);
   544 
   545 		/**
   546 		*	@brief Shut down the whole system, unregister all hook managers
   547 		*/
   548 		void CompleteShutdown();
   549 
   550 		/**
   551 		*	@brief Add a hook.
   552 		*
   553 		*	@return True if the function succeeded, false otherwise
   554 		*
   555 		*	@param plug The unique identifier of the plugin that calls this function
   556 		*	@param iface The interface pointer
   557 		*	@param ifacesize The size of the class iface points to
   558 		*	@param myHookMan A hook manager function that should be capable of handling the function
   559 		*	@param handler A pointer to a FastDelegate containing the hook handler
   560 		*	@param post Set to true if you want a post handler
   561 		*/
   562 		bool AddHook(Plugin plug, void *iface, int thisptr_offs, HookManagerPubFunc myHookMan, ISHDelegate *handler, bool post);
   563 
   564 		/**
   565 		*	@brief Removes a hook.
   566 		*
   567 		*	@return True if the function succeeded, false otherwise
   568 		*
   569 		*	@param plug The unique identifier of the plugin that calls this function
   570 		*	@param iface The interface pointer
   571 		*	@param thisptr_offs This pointer adjuster
   572 		*	@param myHookMan A hook manager function that should be capable of handling the function
   573 		*	@param handler A pointer to a FastDelegate containing the hook handler
   574 		*	@param post Set to true if you want a post handler
   575 		*/
   576 		bool RemoveHook(Plugin plug, void *iface, int thisptr_offs, HookManagerPubFunc myHookMan, ISHDelegate *handler, bool post);
   577 
   578 		/**
   579 		*	@brief Removes a hook.
   580 		*
   581 		*	@ return True if the function succeeded, false otherwise
   582 		*
   583 		*	@param info A RemoveHookInfo structure, describing the hook
   584 		*/
   585 		bool RemoveHook(RemoveHookInfo info);
   586 
   587 		/**
   588 		*	@brief Checks whether a plugin has (a) hook manager(s) that is/are currently used by other plugins
   589 		*
   590 		*	@param plug The unique identifier of the plugin in question
   591 		*/
   592 		bool IsPluginInUse(Plugin plug);
   593 
   594 		/**
   595 		*	@brief Pauses all hooks of a plugin
   596 		*
   597 		*	@param plug The unique identifier of the plugin
   598 		*/
   599 		void PausePlugin(Plugin plug);
   600 
   601 		/**
   602 		*	@brief Unpauses all hooks of a plugin
   603 		*
   604 		*	@param plug The unique identifier of the plugin
   605 		*/
   606 		void UnpausePlugin(Plugin plug);
   607 
   608 		/**
   609 		*	@brief Return a pointer to a callclass. Generate a new one if required.
   610 		*
   611 		*	@param iface The interface pointer
   612 		*	@param size Size of the class instance
   613 		*/
   614 		GenericCallClass *GetCallClass(void *iface, size_t size);
   615 
   616 		/**
   617 		*	@brief Release a callclass
   618 		*
   619 		*	@param ptr Pointer to the callclass
   620 		*/
   621 		virtual void ReleaseCallClass(GenericCallClass *ptr);
   622 
   623 		virtual void SetRes(META_RES res);				//!< Sets the meta result
   624 		virtual META_RES GetPrevRes();					//!< Gets the meta result of the previously called handler
   625 		virtual META_RES GetStatus();					//!< Gets the highest meta result
   626 		virtual const void *GetOrigRet();				//!< Gets the original result. If not in post function, undefined
   627 		virtual const void *GetOverrideRet();			//!< Gets the override result. If none is specified, NULL
   628 		virtual void *GetIfacePtr();					//!< Gets the interface pointer
   629 
   630 		//////////////////////////////////////////////////////////////////////////
   631 		// For hook managers
   632 		void HookLoopBegin(IIface *pIface);			//!< Should be called when a hook loop begins
   633 		void HookLoopEnd();							//!< Should be called when a hook loop exits
   634 		void SetCurResPtr(META_RES *mres);			//!< Sets pointer to the current meta result
   635 		void SetPrevResPtr(META_RES *mres);			//!< Sets pointer to previous meta result
   636 		void SetStatusPtr(META_RES *mres);			//!< Sets pointer to the status variable
   637 		void SetIfacePtrPtr(void **pp);				//!< Sets pointer to the interface this pointer
   638 		void SetOrigRetPtr(const void *ptr);		//!< Sets the original return pointer
   639 		void SetOverrideRetPtr(void *ptr);			//!< Sets the override result pointer
   640 		bool ShouldContinue();						//!< Returns false if the hook loop should exit
   641 
   642 		/**
   643 		*	@brief Remove a hook manager. Auto-removes all hooks attached to it from plugin plug.
   644 		*
   645 		*	@param plug The owner of the hook manager
   646 		*   @param pubFunc The hook manager's info function
   647 		*/
   648 		virtual void RemoveHookManager(Plugin plug, HookManagerPubFunc pubFunc);
   649 		virtual void RemoveHookManager(RemoveHookManInfo info);
   650 
   651 		virtual void DoRecall();					//!< Initiates a recall sequence
   652 		virtual void *GetOverrideRetPtr();			//!< Returns the pointer set by SetOverrideRetPtr
   653 
   654 		virtual void *SetupHookLoop(META_RES *statusPtr, META_RES *prevResPtr, META_RES *curResPtr,
   655 			void **ifacePtrPtr, const void *origRetPtr, void *overrideRetPtr);
   656 	};
   657 }
   658 
   659 #endif