sourcehook/sourcehook_impl.h
author David Anderson <dvander@alliedmods.net>
Thu Sep 27 20:43:03 2007 +0000 (2007-09-27)
branchsourcemm-1.6.0
changeset 358 a4de8673bdbd
parent 347 e82968c21606
child 361 f34718303c8f
permissions -rw-r--r--
more filling in of the provider for episode1
     1 /* ======== SourceHook ========
     2 * Copyright (C) 2004-2007 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 Set(CIter *pOther);
   261 
   262 				bool End();
   263 				void Next();
   264 				ISHDelegate *Handler();
   265 				int ThisPtrOffs();
   266 
   267 				void Clear();
   268 
   269 				CIter *m_pNext;		// When stored in m_FreeIters and m_UsedIters
   270 				CIter *m_pPrev;		// Only used when stored in m_UsedIters
   271 			};
   272 
   273 			CIter *m_FreeIters;
   274 			CIter *m_UsedIters;		// The last returned and not-yet-released iter is always m_UsedIters
   275 
   276 			// For recalls
   277 			bool m_Recall;
   278 			bool m_RQFlag;
   279 
   280 			void SetRecallState();	// Sets the list into a state where the next returned
   281 									// iterator (from GetIter) will be a copy of the last
   282 									// returned iterator, incremented by one. This is used in Recalls.
   283 									// The hook resets this state automatically on:
   284 									// GetIter, ReleaseIter
   285 
   286 			void RQFlagReset() { m_RQFlag = false; }
   287 			bool RQFlagGet() { return m_RQFlag; }
   288 			CHookList();
   289 			CHookList(const CHookList &other);
   290 			virtual ~CHookList();
   291 
   292 			void operator=(const CHookList &other);
   293 
   294 			IIter *GetIter();
   295 			void ReleaseIter(IIter *pIter);
   296 		};
   297 
   298 		// I know, data hiding... But I'm a lazy bastard!
   299 
   300 		class CIface : public IIface
   301 		{
   302 		public:
   303 			void *m_Ptr;
   304 			CHookList m_PreHooks;
   305 			CHookList m_PostHooks;
   306 		public:
   307 			CIface(void *ptr);
   308 			virtual ~CIface();
   309 
   310 			void *GetPtr();
   311 			IHookList *GetPreHooks();
   312 			IHookList *GetPostHooks();
   313 
   314 			bool operator==(void *ptr)
   315 			{
   316 				return m_Ptr == ptr;
   317 			}
   318 		};
   319 
   320 		class CVfnPtr : public IVfnPtr
   321 		{
   322 		public:
   323 			typedef List<CIface> IfaceList;
   324 			typedef IfaceList::iterator IfaceListIter;
   325 
   326 			void *m_Ptr;
   327 			void *m_OrigEntry;
   328 
   329 			IfaceList m_Ifaces;
   330 
   331 		public:
   332 			CVfnPtr(void *ptr);
   333 			virtual ~CVfnPtr();
   334 
   335 			void *GetVfnPtr();
   336 			void *GetOrigEntry();
   337 
   338 			virtual IIface *FindIface(void *ptr);
   339 
   340 			bool operator==(void *ptr)
   341 			{
   342 				return m_Ptr == ptr;
   343 			}
   344 		};
   345 
   346 		class CHookManagerInfo : public IHookManagerInfo
   347 		{
   348 		public:
   349 			typedef List<CVfnPtr> VfnPtrList;
   350 			typedef VfnPtrList::iterator VfnPtrListIter;
   351 
   352 			Plugin m_Plug;
   353 			HookManagerPubFunc m_Func;
   354 
   355 			int m_VtblOffs;
   356 			int m_VtblIdx;
   357 			const char *m_Proto;
   358 			void *m_HookfuncVfnptr;
   359 
   360 			VfnPtrList m_VfnPtrs;
   361 
   362 			int m_HookManVersion;
   363 		public:
   364 			CHookManagerInfo();
   365 			virtual ~CHookManagerInfo();
   366 
   367 			IVfnPtr *FindVfnPtr(void *vfnptr);
   368 
   369 			void SetInfo(int vtbl_offs, int vtbl_idx, const char *proto);
   370 			void SetHookfuncVfnptr(void *hookfunc_vfnptr);
   371 
   372 			void SetVersion(int version);
   373 
   374 			bool operator < (const CHookManagerInfo &other)
   375 			{
   376 				return m_HookManVersion < other.m_HookManVersion;
   377 			}
   378 
   379 			struct Descriptor
   380 			{
   381 				Descriptor(Plugin pplug, HookManagerPubFunc ppubFunc) : plug(pplug), pubFunc(ppubFunc)
   382 				{
   383 				}
   384 
   385 				Plugin plug;
   386 				HookManagerPubFunc pubFunc;
   387 			};
   388 
   389 			bool operator == (const Descriptor desc)
   390 			{
   391 				return m_Func == desc.pubFunc && m_Plug == desc.plug;
   392 			}
   393 		};
   394 
   395 		typedef List<CHookManagerInfo> HookManInfoList;
   396 
   397 		class CHookManagerContainer : public HookManInfoList
   398 		{
   399 		public:
   400 			// HMCI (Hook Manager Container Identification)
   401 			class HMCI
   402 			{
   403 				CProto m_Proto;
   404 				int m_VtableOffset;
   405 				int m_VtableIndex;
   406 			public:
   407 				HMCI(const char *proto, int vtbloffs, int vtblidx) :
   408 				  m_Proto(proto), m_VtableOffset(vtbloffs), m_VtableIndex(vtblidx)
   409 				  {
   410 				  }
   411 				  ~HMCI()
   412 				  {
   413 				  }
   414 
   415 				  bool operator==(const HMCI &other) const
   416 				  {
   417 					  return
   418 						  other.m_VtableIndex == m_VtableIndex &&
   419 						  other.m_Proto == m_Proto &&
   420 						  other.m_VtableOffset == m_VtableOffset;
   421 				  }
   422 
   423 				  const CProto &GetProto() const
   424 				  {
   425 					  return m_Proto;
   426 				  }
   427 				  int GetVtableOffset() const
   428 				  {
   429 					  return m_VtableOffset;
   430 				  }
   431 				  int GetVtableIndex() const
   432 				  {
   433 					  return m_VtableIndex;
   434 				  }
   435 			};
   436 			HMCI m_HCMI;
   437 
   438 		public:
   439 			CHookManagerContainer(const HMCI &hmci) : m_HCMI(hmci)
   440 			{
   441 			}
   442 			bool operator == (const HMCI &other) const
   443 			{
   444 				return m_HCMI == other;
   445 			}
   446 			void AddHookManager(Plugin plug, const CHookManagerInfo &hookman);
   447 		};
   448 
   449 		class CCallClassImpl : public GenericCallClass
   450 		{
   451 		public:
   452 
   453 			typedef SourceHook::CVector<void*> OrigFuncs;
   454 			typedef SourceHook::THash<int, OrigFuncs> OrigVTables;
   455 
   456 			void *m_Ptr;			//!< Pointer to the actual object
   457 			size_t m_ObjSize;		//!< Size of the instance
   458 			OrigVTables m_VT;		//!< Info about vtables & functions
   459 
   460 			int m_RefCounter;
   461 
   462 			CCallClassImpl(void *ptr, size_t size);
   463 			virtual ~CCallClassImpl();
   464 
   465 			bool operator==(void *other)
   466 			{
   467 				return m_Ptr == other;
   468 			}
   469 
   470 			void *GetThisPtr();
   471 			void *GetOrigFunc(int vtbloffs, int vtblidx);
   472 
   473 			void ApplyCallClassPatch(int vtbl_offs, int vtbl_idx, void *orig_entry);
   474 			void RemoveCallClassPatch(int vtbl_offs, int vtbl_idx);
   475 		};
   476 
   477 		/**
   478 		*	@brief A list of CallClass structures
   479 		*/
   480 		typedef List<CCallClassImpl> Impl_CallClassList;
   481 
   482 		Impl_CallClassList m_CallClasses;			//!< A list of already generated callclasses
   483 
   484 		/**
   485 		*	@brief A list of CHookManagerContainers
   486 		*/
   487 		typedef List<CHookManagerContainer> HookManContList;
   488 
   489 		HookManContList m_HookMans;					//!< A list of hook managers
   490 
   491 		struct HookLoopInfo
   492 		{
   493 			enum RecallType
   494 			{
   495 				Recall_No=0,
   496 				Recall_Pre,
   497 				Recall_Post1,
   498 				Recall_Post2
   499 			};
   500 
   501 			META_RES *pStatus;
   502 			META_RES *pPrevRes;
   503 			META_RES *pCurRes;
   504 
   505 			META_RES temporaryStatus;				//!< Stored during Post1 recall phase
   506 			bool shouldContinue;
   507 			RecallType recall;						//!< Specifies which kind of recall we're in.
   508 
   509 			IIface *pCurIface;
   510 			const void *pOrigRet;
   511 			void *pOverrideRet;
   512 			void **pIfacePtrPtr;
   513 		};
   514 		typedef CStack<HookLoopInfo> HookLoopInfoStack;
   515 
   516 		void ApplyCallClassPatches(CCallClassImpl &cc);
   517 		void ApplyCallClassPatches(void *ifaceptr, int vtbl_offs, int vtbl_idx, void *orig_entry);
   518 		void RemoveCallClassPatches(void *ifaceptr, int vtbl_offs, int vtbl_idx);
   519 
   520 		void SetPluginPaused(Plugin plug, bool paused);
   521 
   522 		HookLoopInfoStack m_HLIStack;
   523 	public:
   524 		CSourceHookImpl();
   525 		virtual ~CSourceHookImpl();
   526 
   527 		/**
   528 		*	@brief Returns the interface version
   529 		*/
   530 		int GetIfaceVersion();
   531 
   532 		/**
   533 		*	@brief Returns the implemnetation version
   534 		*/
   535 		int GetImplVersion();
   536 
   537 		/**
   538 		*	@brief Make sure that a plugin is not used by any other plugins anymore, and unregister all its hook managers
   539 		*/
   540 		void UnloadPlugin(Plugin plug);
   541 
   542 		/**
   543 		*	@brief Shut down the whole system, unregister all hook managers
   544 		*/
   545 		void CompleteShutdown();
   546 
   547 		/**
   548 		*	@brief Add a hook.
   549 		*
   550 		*	@return True if the function succeeded, false otherwise
   551 		*
   552 		*	@param plug The unique identifier of the plugin that calls this function
   553 		*	@param iface The interface pointer
   554 		*	@param ifacesize The size of the class iface points to
   555 		*	@param myHookMan A hook manager function that should be capable of handling the function
   556 		*	@param handler A pointer to a FastDelegate containing the hook handler
   557 		*	@param post Set to true if you want a post handler
   558 		*/
   559 		bool AddHook(Plugin plug, void *iface, int thisptr_offs, HookManagerPubFunc myHookMan, ISHDelegate *handler, bool post);
   560 
   561 		/**
   562 		*	@brief Removes a hook.
   563 		*
   564 		*	@return True if the function succeeded, false otherwise
   565 		*
   566 		*	@param plug The unique identifier of the plugin that calls this function
   567 		*	@param iface The interface pointer
   568 		*	@param thisptr_offs This pointer adjuster
   569 		*	@param myHookMan A hook manager function that should be capable of handling the function
   570 		*	@param handler A pointer to a FastDelegate containing the hook handler
   571 		*	@param post Set to true if you want a post handler
   572 		*/
   573 		bool RemoveHook(Plugin plug, void *iface, int thisptr_offs, HookManagerPubFunc myHookMan, ISHDelegate *handler, bool post);
   574 
   575 		/**
   576 		*	@brief Removes a hook.
   577 		*
   578 		*	@ return True if the function succeeded, false otherwise
   579 		*
   580 		*	@param info A RemoveHookInfo structure, describing the hook
   581 		*/
   582 		bool RemoveHook(RemoveHookInfo info);
   583 
   584 		/**
   585 		*	@brief Checks whether a plugin has (a) hook manager(s) that is/are currently used by other plugins
   586 		*
   587 		*	@param plug The unique identifier of the plugin in question
   588 		*/
   589 		bool IsPluginInUse(Plugin plug);
   590 
   591 		/**
   592 		*	@brief Pauses all hooks of a plugin
   593 		*
   594 		*	@param plug The unique identifier of the plugin
   595 		*/
   596 		void PausePlugin(Plugin plug);
   597 
   598 		/**
   599 		*	@brief Unpauses all hooks of a plugin
   600 		*
   601 		*	@param plug The unique identifier of the plugin
   602 		*/
   603 		void UnpausePlugin(Plugin plug);
   604 
   605 		/**
   606 		*	@brief Return a pointer to a callclass. Generate a new one if required.
   607 		*
   608 		*	@param iface The interface pointer
   609 		*	@param size Size of the class instance
   610 		*/
   611 		GenericCallClass *GetCallClass(void *iface, size_t size);
   612 
   613 		/**
   614 		*	@brief Release a callclass
   615 		*
   616 		*	@param ptr Pointer to the callclass
   617 		*/
   618 		virtual void ReleaseCallClass(GenericCallClass *ptr);
   619 
   620 		virtual void SetRes(META_RES res);				//!< Sets the meta result
   621 		virtual META_RES GetPrevRes();					//!< Gets the meta result of the previously called handler
   622 		virtual META_RES GetStatus();					//!< Gets the highest meta result
   623 		virtual const void *GetOrigRet();				//!< Gets the original result. If not in post function, undefined
   624 		virtual const void *GetOverrideRet();			//!< Gets the override result. If none is specified, NULL
   625 		virtual void *GetIfacePtr();					//!< Gets the interface pointer
   626 
   627 		//////////////////////////////////////////////////////////////////////////
   628 		// For hook managers
   629 		void HookLoopBegin(IIface *pIface);			//!< Should be called when a hook loop begins
   630 		void HookLoopEnd();							//!< Should be called when a hook loop exits
   631 		void SetCurResPtr(META_RES *mres);			//!< Sets pointer to the current meta result
   632 		void SetPrevResPtr(META_RES *mres);			//!< Sets pointer to previous meta result
   633 		void SetStatusPtr(META_RES *mres);			//!< Sets pointer to the status variable
   634 		void SetIfacePtrPtr(void **pp);				//!< Sets pointer to the interface this pointer
   635 		void SetOrigRetPtr(const void *ptr);		//!< Sets the original return pointer
   636 		void SetOverrideRetPtr(void *ptr);			//!< Sets the override result pointer
   637 		bool ShouldContinue();						//!< Returns false if the hook loop should exit
   638 
   639 		/**
   640 		*	@brief Remove a hook manager. Auto-removes all hooks attached to it from plugin plug.
   641 		*
   642 		*	@param plug The owner of the hook manager
   643 		*   @param pubFunc The hook manager's info function
   644 		*/
   645 		virtual void RemoveHookManager(Plugin plug, HookManagerPubFunc pubFunc);
   646 		virtual void RemoveHookManager(RemoveHookManInfo info);
   647 
   648 		virtual void DoRecall();					//!< Initiates a recall sequence
   649 		virtual void *GetOverrideRetPtr();			//!< Returns the pointer set by SetOverrideRetPtr
   650 
   651 		virtual void *SetupHookLoop(META_RES *statusPtr, META_RES *prevResPtr, META_RES *curResPtr,
   652 			void **ifacePtrPtr, const void *origRetPtr, void *overrideRetPtr);
   653 	};
   654 }
   655 
   656 #endif