diff -r 602bd1bc1739 -r 74fea7db93e4 extensions/bintools/CallMaker.h --- a/extensions/bintools/CallMaker.h Wed Jan 07 22:55:40 2009 -0500 +++ b/extensions/bintools/CallMaker.h Thu Jan 08 18:17:17 2009 +1300 @@ -32,16 +32,12 @@ #ifndef _INCLUDE_SOURCEMOD_CALLMAKER_H_ #define _INCLUDE_SOURCEMOD_CALLMAKER_H_ -#include + +#include "CallWrapper.h" +#include "HookWrapper.h" using namespace SourceMod; -enum FuncAddrMethod -{ - FuncAddr_Direct, - FuncAddr_VTable -}; - class CallMaker : public IBinTools { public: //IBinTools @@ -58,4 +54,32 @@ unsigned int numParams); }; +class CallMaker2 +#if defined HOOKING_ENABLED + : public IBinTools2 +#endif +{ +public: //IBinTools2 + virtual ICallWrapper *CreateCall(void *address, + const SourceHook::ProtoInfo *protoInfo); + virtual ICallWrapper *CreateVirtualCall(const SourceHook::ProtoInfo *protoInfo, + const SourceHook::MemFuncInfo *info); +#if defined HOOKING_ENABLED + virtual IHookWrapper *CreateVirtualHook(SourceHook::ISourceHook *pSH, + const SourceHook::ProtoInfo *protoInfo, + const SourceHook::MemFuncInfo *info, + VIRTUAL_HOOK_PROTO f); +#endif +}; + +extern CallMaker2 g_CallMaker2; + +SourceHook::ProtoInfo::CallConvention GetSHCallConvention(SourceMod::CallConvention cv); +SourceMod::CallConvention GetSMCallConvention(SourceHook::ProtoInfo::CallConvention cv); +SourceHook::PassInfo::PassType GetSHPassType(SourceMod::PassType type); +SourceMod::PassType GetSMPassType(int type); +void GetSMPassInfo(SourceMod::PassInfo *out, const SourceHook::PassInfo *in); + + + #endif //_INCLUDE_SOURCEMOD_CALLMAKER_H_