1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-12-01 13:24:25 +01:00

Hookmangen support for vafmt on gcc

Added vafmt_void test to testhookmangen
Recalls should work now with vafmt

--HG--
branch : hookman_autogen
extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/branches/hookman_autogen%40564
This commit is contained in:
Pavol Marko 2007-11-18 11:58:07 +00:00
parent 784d474507
commit 3de86ccca8
10 changed files with 2198 additions and 36 deletions

View File

@ -5635,204 +5635,408 @@ namespace SourceHook
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)())
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
}
#endif

View File

@ -1353,11 +1353,23 @@ namespace SourceHook
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType@[$2,1,$1:, class Param$2@]>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(@[$2,1,$1:Param$2, @]...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType@[$2,1,$1:, class Param$2@]>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(@[$2,1,$1|, :Param$2@]))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType@[$2,1,$1:, class Param$2@]>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(@[$2,1,$1:Param$2, @]...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
@]
}

View File

@ -5635,204 +5635,408 @@ namespace SourceHook
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)())
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16>
OverrideFunctor<RetType> SetOverrideResult(RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, ...))
{
return OverrideFunctor<RetType>();
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
template <class Iface, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16>
Iface *RecallGetIface(ISourceHook *shptr, RetType (Iface::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, ...))
{
return reinterpret_cast<Iface*>(shptr->GetIfacePtr());
}
}
#endif

View File

@ -848,7 +848,7 @@ namespace SourceHook
}
void GenContext::GenerateCallHooks(int v_status, int v_prev_res, int v_cur_res, int v_iter,
int v_pContext, int base_param_offset, int v_plugin_ret, int v_place_for_memret, jit_int32_t v_place_fbrr_base)
int v_pContext, int base_param_offset, int v_plugin_ret, int v_place_for_memret, jit_int32_t v_place_fbrr_base, jit_int32_t v_va_buf)
{
jitoffs_t counter, tmppos;
jitoffs_t counter2, tmppos2;
@ -894,8 +894,17 @@ namespace SourceHook
// eax = [eax+2*SIZE_PTR]
// call eax
// gcc: clean up
jit_int32_t gcc_clean_bytes = 0;
// vafmt: push va_buf
if (m_Proto.GetConvention() & ProtoInfo::CallConv_HasVafmt)
{
IA32_Lea_DispRegImmAuto(&m_HookFunc, REG_ECX, REG_EBP, v_va_buf);
IA32_Push_Reg(&m_HookFunc, REG_ECX);
gcc_clean_bytes += SIZE_PTR;
}
jit_int32_t gcc_clean_bytes = PushParams(base_param_offset, v_plugin_ret, v_place_for_memret, v_place_fbrr_base);
gcc_clean_bytes += PushParams(base_param_offset, v_plugin_ret, v_place_for_memret, v_place_fbrr_base);
IA32_Mov_Reg_Rm(&m_HookFunc, REG_ECX, REG_EAX, MOD_REG);
GCC_ONLY(IA32_Push_Reg(&m_HookFunc, REG_ECX));
@ -953,7 +962,7 @@ namespace SourceHook
}
void GenContext::GenerateCallOrig(int v_status, int v_pContext, int param_base_offs, int v_this,
int v_vfnptr_origentry, int v_orig_ret, int v_override_ret, int v_place_for_memret, jit_int32_t v_place_fbrr_base)
int v_vfnptr_origentry, int v_orig_ret, int v_override_ret, int v_place_for_memret, jit_int32_t v_place_fbrr_base, jit_int32_t v_va_buf)
{
jitoffs_t counter, tmppos;
jitoffs_t counter2, tmppos2;
@ -1005,8 +1014,19 @@ namespace SourceHook
tmppos2 = IA32_Jump_Cond_Imm32(&m_HookFunc, CC_Z, 0);
m_HookFunc.start_count(counter2);
jit_int32_t gcc_clean_bytes = 0;
// vafmt: push va_buf, then "%s"
if (m_Proto.GetConvention() & ProtoInfo::CallConv_HasVafmt)
{
IA32_Lea_DispRegImmAuto(&m_HookFunc, REG_ECX, REG_EBP, v_va_buf);
IA32_Push_Reg(&m_HookFunc, REG_ECX);
IA32_Push_Imm32(&m_HookFunc, DownCastPtr("%s"));
gcc_clean_bytes += 2*SIZE_PTR;
}
// push params
jit_int32_t gcc_clean_bytes = PushParams(param_base_offs, v_orig_ret, v_place_for_memret, v_place_fbrr_base);
gcc_clean_bytes += PushParams(param_base_offs, v_orig_ret, v_place_for_memret, v_place_fbrr_base);
// thisptr
IA32_Mov_Reg_Rm_DispAuto(&m_HookFunc, REG_ECX, REG_EBP, v_this);
@ -1248,21 +1268,22 @@ namespace SourceHook
// IHookContext *pContext ebp - 24 -4
// == 3 ptrs + 3 enums = 24 bytes
//
// varargs:
// va_list argptr ebp - 28 -4
//
// non-void: add:
// my_rettype *ret_ptr ebp - 28 (va: -4) -4
// my_rettype orig_ret ebp - 28 (va: -4) - sizeof(my_rettype) -4
// my_rettype override_ret ebp - 28 (va: -4) - sizeof(my_rettype)*2 -4
// my_rettype plugin_ret ebp - 28 (va: -4) - sizeof(my_rettype)*3 -4
// my_rettype *ret_ptr ebp - 28 -4
// my_rettype orig_ret ebp - 28 - sizeof(my_rettype) -4
// my_rettype override_ret ebp - 28 - sizeof(my_rettype)*2 -4
// my_rettype plugin_ret ebp - 28 - sizeof(my_rettype)*3 -4
// == + 3 * sizeof(my_rettype) bytes
// if required:
// my_rettype place_for_memret ebp - 28 (va: -4) - sizeof(my_rettype)*4 -4
// my_rettype place_for_memret ebp - 28 - sizeof(my_rettype)*4 -4
// gcc only: if required:
// place forced byref params ebp - 28 (va: -4) - sizeof(my_rettype)*{4 or 5}
// place forced byref params ebp - 28 - sizeof(my_rettype)*{4 or 5}
//
// varargs:
// va_list argptr
// char va_buf[something];
const jit_int8_t v_vfnptr_origentry = AddVarToFrame(SIZE_PTR);
@ -1271,10 +1292,6 @@ namespace SourceHook
const jit_int8_t v_cur_res = AddVarToFrame(sizeof(META_RES));
const jit_int8_t v_iter = AddVarToFrame(SIZE_PTR);
const jit_int8_t v_pContext = AddVarToFrame(SIZE_PTR);
// Only exists for varargs functions
const jit_int8_t v_va_argptr = (m_Proto.GetConvention() & ProtoInfo::CallConv_HasVarArgs) ?
AddVarToFrame(sizeof(va_list)) :
0;
#if SH_COMP == SH_COMP_GCC
jit_int32_t param_base_offs = 16;
@ -1319,25 +1336,60 @@ namespace SourceHook
}
jit_int32_t v_place_fbrr_base = 0;
if (GetForcedByRefParamsSize())
if (SH_COMP == SH_COMP_GCC && GetForcedByRefParamsSize())
{
v_place_fbrr_base = AddVarToFrame(GetForcedByRefParamsSize());
}
// Only exists for varargs functions
jit_int32_t v_va_argptr = 0;
if (m_Proto.GetConvention() & ProtoInfo::CallConv_HasVarArgs)
{
v_va_argptr = AddVarToFrame(SIZE_PTR);
}
jit_int32_t v_va_buf = 0;
if (m_Proto.GetConvention() & ProtoInfo::CallConv_HasVafmt)
{
v_va_buf = AddVarToFrame(SourceHook::STRBUF_LEN);
}
IA32_Sub_Rm_Imm32(&m_HookFunc, REG_ESP, ComputeVarsSize(), MOD_REG);
// init status localvar
IA32_Mov_Rm_Imm32_Disp8(&m_HookFunc, REG_EBP, MRES_IGNORED, v_status);
// VarArgs: init argptr
// VarArgs: init argptr & format
if (m_Proto.GetConvention() & ProtoInfo::CallConv_HasVarArgs)
{
// argptr = first vararg param
// lea eax, [esp + param_base_offs + paramssize]
// lea eax, [ebp + param_base_offs + paramssize]
// mov argptr, eax
IA32_Lea_Reg_DispRegMultImm32(&m_HookFunc, REG_EAX, REG_NOIDX, REG_ESP, NOSCALE, param_base_offs + GetParamsStackSize());
IA32_Mov_Rm_Reg_DispAuto(&m_HookFunc, REG_EBP, v_va_argptr, REG_EAX);
IA32_Lea_DispRegImmAuto(&m_HookFunc, REG_EAX, REG_EBP, param_base_offs + GetParamsStackSize() + SIZE_PTR); // +SIZE_PTR: last const char * is not in protoinfo
IA32_Mov_Rm_Reg_DispAuto(&m_HookFunc, REG_EBP, REG_EAX, v_va_argptr);
}
if (m_Proto.GetConvention() & ProtoInfo::CallConv_HasVafmt)
{
// vsnprintf
// push valist, fmt param, maxsize, buffer
IA32_Push_Reg(&m_HookFunc, REG_EAX);
IA32_Push_Rm_DispAuto(&m_HookFunc, REG_EBP, param_base_offs + GetParamsStackSize()); // last given param (+4-4, see above)
IA32_Push_Imm32(&m_HookFunc, SourceHook::STRBUF_LEN - 1);
IA32_Lea_DispRegImmAuto(&m_HookFunc, REG_ECX, REG_EBP, v_va_buf);
IA32_Push_Reg(&m_HookFunc, REG_ECX);
// call
IA32_Mov_Reg_Imm32(&m_HookFunc, REG_EAX, DownCastPtr(&vsnprintf));
IA32_Call_Reg(&m_HookFunc, REG_EAX);
// Clean up (cdecl)
IA32_Add_Rm_Imm32(&m_HookFunc, REG_ESP, 0x10, MOD_REG);
// Set trailing zero
IA32_Xor_Reg_Rm(&m_HookFunc, REG_EDX, REG_EDX, MOD_REG);
IA32_Mov_Rm8_Reg8_DispAuto(&m_HookFunc, REG_EBP, REG_EDX, v_va_buf + SourceHook::STRBUF_LEN - 1);
}
// Call constructors for ret vars if required
@ -1374,15 +1426,15 @@ namespace SourceHook
// ********************** call pre hooks **********************
GenerateCallHooks(v_status, v_prev_res, v_cur_res, v_iter, v_pContext, param_base_offs,
v_plugin_ret, v_place_for_memret, v_place_fbrr_base);
v_plugin_ret, v_place_for_memret, v_place_fbrr_base, v_va_buf);
// ********************** call orig func **********************
GenerateCallOrig(v_status, v_pContext, param_base_offs, v_this, v_vfnptr_origentry, v_orig_ret,
v_override_ret, v_place_for_memret, v_place_fbrr_base);
v_override_ret, v_place_for_memret, v_place_fbrr_base, v_va_buf);
// ********************** call post hooks **********************
GenerateCallHooks(v_status, v_prev_res, v_cur_res, v_iter, v_pContext, param_base_offs,
v_plugin_ret, v_place_for_memret, v_place_fbrr_base);
v_plugin_ret, v_place_for_memret, v_place_fbrr_base, v_va_buf);
// ********************** end context and return **********************

View File

@ -221,11 +221,11 @@ namespace SourceHook
// Call hooks
void GenerateCallHooks(int v_status, int v_prev_res, int v_cur_res, int v_iter,
int v_pContext, int base_param_offset, int v_plugin_ret, int v_place_for_memret, jit_int32_t v_place_fbrr_base);
int v_pContext, int base_param_offset, int v_plugin_ret, int v_place_for_memret, jit_int32_t v_place_fbrr_base, jit_int32_t v_va_buf);
// Call orig
void GenerateCallOrig(int v_status, int v_pContext, int param_base_offs, int v_this,
int v_vfnptr_origentry, int v_orig_ret, int v_override_ret, int v_place_for_memret, jit_int32_t v_place_fbrr_base);
int v_vfnptr_origentry, int v_orig_ret, int v_override_ret, int v_place_for_memret, jit_int32_t v_place_fbrr_base, jit_int32_t v_va_buf);
// Hook loop
void CallSetupHookLoop(int v_orig_ret, int v_override_ret,

View File

@ -943,6 +943,28 @@ namespace SourceHook
jit->write_ubyte(ia32_modrm(mode, src, dest));
}
inline void IA32_Mov_Rm8_Reg8_Disp8(JitWriter *jit, jit_uint8_t dest, jit_uint8_t src, jit_int8_t disp)
{
jit->write_ubyte(IA32_MOV_RM8_REG8);
jit->write_ubyte(ia32_modrm(MOD_DISP8, src, dest));
jit->write_byte(disp);
}
inline void IA32_Mov_Rm8_Reg8_Disp32(JitWriter *jit, jit_uint8_t dest, jit_uint8_t src, jit_int32_t disp)
{
jit->write_ubyte(IA32_MOV_RM8_REG8);
jit->write_ubyte(ia32_modrm(MOD_DISP32, src, dest));
jit->write_int32(disp);
}
inline void IA32_Mov_Rm8_Reg8_DispAuto(JitWriter *jit, jit_uint8_t dest, jit_uint8_t src, jit_int32_t disp)
{
if (disp >= SCHAR_MIN && disp <= SCHAR_MAX)
IA32_Mov_Rm8_Reg8_Disp8(jit, dest, src, static_cast<jit_int8_t>(disp));
else
IA32_Mov_Rm8_Reg8_Disp32(jit, dest, src, disp);
}
inline void IA32_Mov_RmESP_Reg(JitWriter *jit, jit_uint8_t src)
{
jit->write_ubyte(IA32_MOV_RM_REG);

View File

@ -23,7 +23,7 @@ namespace SourceHook
CVector<PassInfo> m_Params;
CVector<PassInfo::V2Info> m_Params2;
public:
CProtoInfoBuilder(ProtoInfo::CallConvention cc)
CProtoInfoBuilder(int cc)
{
memset(reinterpret_cast<void*>(&m_PI), 0, sizeof(ProtoInfo));
m_PI.convention = cc;

View File

@ -219,6 +219,15 @@ namespace
}
};
template<>
struct Increment<std::string>
{
static void Incr(std::string &what)
{
what += "!";
}
};
#include "testhookmangen.h"
template <class T>
@ -412,6 +421,38 @@ namespace
SourceHook::PassInfo::PassFlag_ByRef | SourceHook::PassInfo::PassFlag_OCtor | SourceHook::PassInfo::PassFlag_ODtor |
SourceHook::PassInfo::PassFlag_CCtor | SourceHook::PassInfo::PassFlag_AssignOp);
// vafmt tests
THGM_MAKE_TEST0_vafmt_void(200);
THGM_SETUP_PI0(200);
THGM_MAKE_TEST1_vafmt_void(201, char);
THGM_SETUP_PI1(201, char, SourceHook::PassInfo::PassType_Basic, SourceHook::PassInfo::PassFlag_ByVal);
THGM_MAKE_TEST1_vafmt_void(203, int);
THGM_SETUP_PI1(203, int, SourceHook::PassInfo::PassType_Basic, SourceHook::PassInfo::PassFlag_ByVal);
THGM_MAKE_TEST5_vafmt_void(206, char, short, int, float, double);
THGM_SETUP_PI5(206,
char, SourceHook::PassInfo::PassType_Basic, SourceHook::PassInfo::PassFlag_ByVal,
short, SourceHook::PassInfo::PassType_Basic, SourceHook::PassInfo::PassFlag_ByVal,
int, SourceHook::PassInfo::PassType_Basic, SourceHook::PassInfo::PassFlag_ByVal,
float, SourceHook::PassInfo::PassType_Float, SourceHook::PassInfo::PassFlag_ByVal,
double, SourceHook::PassInfo::PassType_Float, SourceHook::PassInfo::PassFlag_ByVal
);
THGM_MAKE_TEST2_vafmt_void(207, char&, double&);
THGM_SETUP_PI2(207,
char&, SourceHook::PassInfo::PassType_Basic, SourceHook::PassInfo::PassFlag_ByRef,
double&, SourceHook::PassInfo::PassType_Float, SourceHook::PassInfo::PassFlag_ByRef
);
THGM_MAKE_TEST1_vafmt_void(208, POD<7>);
THGM_SETUP_PI1(208, POD<7>, SourceHook::PassInfo::PassType_Object, SourceHook::PassInfo::PassFlag_ByVal);
THGM_MAKE_TEST1_vafmt_void(210, POD<600> &);
THGM_SETUP_PI1(210, POD<600> &, SourceHook::PassInfo::PassType_Object, SourceHook::PassInfo::PassFlag_ByRef)
MAKE_STATE(State_Hello_Func4_Called);
MAKE_STATE(State_Hello_Func79_Called);
@ -915,6 +956,25 @@ bool TestHookManGen(std::string &error)
// RefRet
THGM_DO_TEST(111, ());
// Vafmt
THGM_DO_TEST_void(200, ("Hello %s%d%s", "BA", 1, "L!"));
THGM_DO_TEST_void(201, (100, "Hello %s%d%s", "BA", 1, "L!"));
THGM_DO_TEST_void(203, (0x1F000000, "Hello %s%d%s", "BA", 1, "L!"));
THGM_DO_TEST_void(206, (100, 0x1f00, 0x1f000000, 0.5f, 5.5, "Hello %s%d%s", "BA", 1, "L!"));
a = 5;
b = 233.33;
THGM_DO_TEST_void(207, (a, b, "Hello %s%d%s", "BA", 1, "L!"));
pod7 = MakeRet< POD<7> >::Do(78);
THGM_DO_TEST_void(208, (pod7, "Hello %s%d%s", "BA", 1, "L!"));
THGM_DO_TEST_void(210, (pod600, "Hello %s%d%s", "BA", 1, "L!"));
// Test for lange vtable indices
Hello *pHello = new Hello;
SourceHook::CProtoInfoBuilder helloPi(SourceHook::ProtoInfo::CallConv_ThisCall);

View File

@ -132,6 +132,20 @@ struct MakeRet< POD<SIZE> >
};
// Stores parameter status
template <class T>
bool EqualToMyFmtString(T sth)
{
return false;
}
bool EqualToMyFmtString(std::string &sth)
{
if (sth == "Hello %s%d%s")
sth = "Hello BA1L!";
return true;
}
template<int dummy>
@ -145,8 +159,9 @@ struct ParamState0
;
}
ParamState0()
ParamState0(...)
{
}
ParamState0<dummy> & operator() (int incrsteps)
@ -178,8 +193,11 @@ struct ParamState1
&& m_1 == other.m_1
;
}
ParamState1(p1 a1) : m_1(a1)
ParamState1(p1 a1, ...) : m_1(a1)
{
EqualToMyFmtString(m_1);
}
ParamState1<dummy, p1> & operator() (int incrsteps)
@ -214,8 +232,13 @@ struct ParamState2
&& m_2 == other.m_2 && m_2 == other.m_2
;
}
ParamState2(p1 a1, p2 a2) : m_1(a1), m_2(a2)
ParamState2(p1 a1, p2 a2, ...) : m_1(a1), m_2(a2)
{
EqualToMyFmtString(m_1);
EqualToMyFmtString(m_2);
}
ParamState2<dummy, p1, p2> & operator() (int incrsteps)
@ -253,8 +276,15 @@ struct ParamState3
&& m_3 == other.m_3 && m_3 == other.m_3 && m_3 == other.m_3
;
}
ParamState3(p1 a1, p2 a2, p3 a3) : m_1(a1), m_2(a2), m_3(a3)
ParamState3(p1 a1, p2 a2, p3 a3, ...) : m_1(a1), m_2(a2), m_3(a3)
{
EqualToMyFmtString(m_1);
EqualToMyFmtString(m_2);
EqualToMyFmtString(m_3);
}
ParamState3<dummy, p1, p2, p3> & operator() (int incrsteps)
@ -295,8 +325,17 @@ struct ParamState4
&& m_4 == other.m_4 && m_4 == other.m_4 && m_4 == other.m_4 && m_4 == other.m_4
;
}
ParamState4(p1 a1, p2 a2, p3 a3, p4 a4) : m_1(a1), m_2(a2), m_3(a3), m_4(a4)
ParamState4(p1 a1, p2 a2, p3 a3, p4 a4, ...) : m_1(a1), m_2(a2), m_3(a3), m_4(a4)
{
EqualToMyFmtString(m_1);
EqualToMyFmtString(m_2);
EqualToMyFmtString(m_3);
EqualToMyFmtString(m_4);
}
ParamState4<dummy, p1, p2, p3, p4> & operator() (int incrsteps)
@ -340,8 +379,19 @@ struct ParamState5
&& m_5 == other.m_5 && m_5 == other.m_5 && m_5 == other.m_5 && m_5 == other.m_5 && m_5 == other.m_5
;
}
ParamState5(p1 a1, p2 a2, p3 a3, p4 a4, p5 a5) : m_1(a1), m_2(a2), m_3(a3), m_4(a4), m_5(a5)
ParamState5(p1 a1, p2 a2, p3 a3, p4 a4, p5 a5, ...) : m_1(a1), m_2(a2), m_3(a3), m_4(a4), m_5(a5)
{
EqualToMyFmtString(m_1);
EqualToMyFmtString(m_2);
EqualToMyFmtString(m_3);
EqualToMyFmtString(m_4);
EqualToMyFmtString(m_5);
}
ParamState5<dummy, p1, p2, p3, p4, p5> & operator() (int incrsteps)
@ -388,8 +438,21 @@ struct ParamState6
&& m_6 == other.m_6 && m_6 == other.m_6 && m_6 == other.m_6 && m_6 == other.m_6 && m_6 == other.m_6 && m_6 == other.m_6
;
}
ParamState6(p1 a1, p2 a2, p3 a3, p4 a4, p5 a5, p6 a6) : m_1(a1), m_2(a2), m_3(a3), m_4(a4), m_5(a5), m_6(a6)
ParamState6(p1 a1, p2 a2, p3 a3, p4 a4, p5 a5, p6 a6, ...) : m_1(a1), m_2(a2), m_3(a3), m_4(a4), m_5(a5), m_6(a6)
{
EqualToMyFmtString(m_1);
EqualToMyFmtString(m_2);
EqualToMyFmtString(m_3);
EqualToMyFmtString(m_4);
EqualToMyFmtString(m_5);
EqualToMyFmtString(m_6);
}
ParamState6<dummy, p1, p2, p3, p4, p5, p6> & operator() (int incrsteps)
@ -622,6 +685,197 @@ std::ostream& operator <<(std::ostream &os,const ParamState6<0, p1, p2, p3, p4,
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
#define THGM_MAKE_TEST0_vafmt_void(id) \
struct TestClass##id; \
typedef ParamState1<0, std::string > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual void Func(const char *fmt, ...) \
{ \
g_Inside_LeafFunc = true; \
\
char buf[9999]; \
va_list ap; \
va_start(ap, fmt); \
vsnprintf(buf, 9998, fmt, ap); \
buf[9998] = 0; \
va_end(ap); \
\
ADD_STATE(State_Func##id(this, ParamState_m##id(std::string(buf)))); \
g_Inside_LeafFunc = false; \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual void Call(const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
\
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, ("%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual void Call(const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
\
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, ("%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual void Call(const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
\
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, ("%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual void Call(const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
\
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, ("%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
#define THGM_MAKE_TEST0_vafmt(id, ret_type) \
struct TestClass##id; \
typedef ret_type RetType##id; \
typedef ParamState0<0 > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual ret_type Func() \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Func##id(this, ParamState_m##id())); \
g_Inside_LeafFunc = false; \
\
return MakeRet< ret_type >::Do(0); \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual ret_type Call() \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id())); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
\
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, ()); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual ret_type Call() \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id())); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
\
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, ()); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual ret_type Call() \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id())); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
\
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, ()); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual ret_type Call() \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id())); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
\
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, ()); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
#define THGM_SETUP_PI0(id) \
void setuppi_##id() \
{ \
@ -812,6 +1066,197 @@ std::ostream& operator <<(std::ostream &os,const ParamState6<0, p1, p2, p3, p4,
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
#define THGM_MAKE_TEST1_vafmt_void(id, param1) \
struct TestClass##id; \
typedef ParamState2<0, param1, std::string > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual void Func(param1 p1, const char *fmt, ...) \
{ \
g_Inside_LeafFunc = true; \
\
char buf[9999]; \
va_list ap; \
va_start(ap, fmt); \
vsnprintf(buf, 9998, fmt, ap); \
buf[9998] = 0; \
va_end(ap); \
\
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, std::string(buf)))); \
g_Inside_LeafFunc = false; \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual void Call(param1 p1, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual void Call(param1 p1, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual void Call(param1 p1, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual void Call(param1 p1, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
#define THGM_MAKE_TEST1_vafmt(id, ret_type, param1) \
struct TestClass##id; \
typedef ret_type RetType##id; \
typedef ParamState1<0, param1 > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual ret_type Func(param1 p1) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Func##id(this, ParamState_m##id(p1))); \
g_Inside_LeafFunc = false; \
\
return MakeRet< ret_type >::Do(0); \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
#define THGM_SETUP_PI1(id, p1_type, p1_passtype, p1_flags) \
void setuppi_##id() \
{ \
@ -1009,6 +1454,197 @@ std::ostream& operator <<(std::ostream &os,const ParamState6<0, p1, p2, p3, p4,
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
#define THGM_MAKE_TEST2_vafmt_void(id, param1, param2) \
struct TestClass##id; \
typedef ParamState3<0, param1, param2, std::string > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual void Func(param1 p1, param2 p2, const char *fmt, ...) \
{ \
g_Inside_LeafFunc = true; \
\
char buf[9999]; \
va_list ap; \
va_start(ap, fmt); \
vsnprintf(buf, 9998, fmt, ap); \
buf[9998] = 0; \
va_end(ap); \
\
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, std::string(buf)))); \
g_Inside_LeafFunc = false; \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
#define THGM_MAKE_TEST2_vafmt(id, ret_type, param1, param2) \
struct TestClass##id; \
typedef ret_type RetType##id; \
typedef ParamState2<0, param1, param2 > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual ret_type Func(param1 p1, param2 p2) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2))); \
g_Inside_LeafFunc = false; \
\
return MakeRet< ret_type >::Do(0); \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
#define THGM_SETUP_PI2(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags) \
void setuppi_##id() \
{ \
@ -1213,6 +1849,197 @@ std::ostream& operator <<(std::ostream &os,const ParamState6<0, p1, p2, p3, p4,
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
#define THGM_MAKE_TEST3_vafmt_void(id, param1, param2, param3) \
struct TestClass##id; \
typedef ParamState4<0, param1, param2, param3, std::string > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual void Func(param1 p1, param2 p2, param3 p3, const char *fmt, ...) \
{ \
g_Inside_LeafFunc = true; \
\
char buf[9999]; \
va_list ap; \
va_start(ap, fmt); \
vsnprintf(buf, 9998, fmt, ap); \
buf[9998] = 0; \
va_end(ap); \
\
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, std::string(buf)))); \
g_Inside_LeafFunc = false; \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
#define THGM_MAKE_TEST3_vafmt(id, ret_type, param1, param2, param3) \
struct TestClass##id; \
typedef ret_type RetType##id; \
typedef ParamState3<0, param1, param2, param3 > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual ret_type Func(param1 p1, param2 p2, param3 p3) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3))); \
g_Inside_LeafFunc = false; \
\
return MakeRet< ret_type >::Do(0); \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2, p3)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2, p3)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2, p3)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2, p3)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
#define THGM_SETUP_PI3(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags) \
void setuppi_##id() \
{ \
@ -1424,6 +2251,197 @@ std::ostream& operator <<(std::ostream &os,const ParamState6<0, p1, p2, p3, p4,
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
#define THGM_MAKE_TEST4_vafmt_void(id, param1, param2, param3, param4) \
struct TestClass##id; \
typedef ParamState5<0, param1, param2, param3, param4, std::string > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual void Func(param1 p1, param2 p2, param3 p3, param4 p4, const char *fmt, ...) \
{ \
g_Inside_LeafFunc = true; \
\
char buf[9999]; \
va_list ap; \
va_start(ap, fmt); \
vsnprintf(buf, 9998, fmt, ap); \
buf[9998] = 0; \
va_end(ap); \
\
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, std::string(buf)))); \
g_Inside_LeafFunc = false; \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
#define THGM_MAKE_TEST4_vafmt(id, ret_type, param1, param2, param3, param4) \
struct TestClass##id; \
typedef ret_type RetType##id; \
typedef ParamState4<0, param1, param2, param3, param4 > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4))); \
g_Inside_LeafFunc = false; \
\
return MakeRet< ret_type >::Do(0); \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2, p3, p4)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2, p3, p4)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2, p3, p4)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2, p3, p4)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
#define THGM_SETUP_PI4(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags, p4_type, p4_passtype, p4_flags) \
void setuppi_##id() \
{ \
@ -1642,6 +2660,197 @@ std::ostream& operator <<(std::ostream &os,const ParamState6<0, p1, p2, p3, p4,
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
#define THGM_MAKE_TEST5_vafmt_void(id, param1, param2, param3, param4, param5) \
struct TestClass##id; \
typedef ParamState6<0, param1, param2, param3, param4, param5, std::string > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual void Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *fmt, ...) \
{ \
g_Inside_LeafFunc = true; \
\
char buf[9999]; \
va_list ap; \
va_start(ap, fmt); \
vsnprintf(buf, 9998, fmt, ap); \
buf[9998] = 0; \
va_end(ap); \
\
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5, std::string(buf)))); \
g_Inside_LeafFunc = false; \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
#define THGM_MAKE_TEST5_vafmt(id, ret_type, param1, param2, param3, param4, param5) \
struct TestClass##id; \
typedef ret_type RetType##id; \
typedef ParamState5<0, param1, param2, param3, param4, param5 > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5))); \
g_Inside_LeafFunc = false; \
\
return MakeRet< ret_type >::Do(0); \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2, p3, p4, p5)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2, p3, p4, p5)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2, p3, p4, p5)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2, p3, p4, p5)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
#define THGM_SETUP_PI5(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags, p4_type, p4_passtype, p4_flags, p5_type, p5_passtype, p5_flags) \
void setuppi_##id() \
{ \
@ -1867,6 +3076,197 @@ std::ostream& operator <<(std::ostream &os,const ParamState6<0, p1, p2, p3, p4,
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
#define THGM_MAKE_TEST6_vafmt_void(id, param1, param2, param3, param4, param5, param6) \
struct TestClass##id; \
typedef ParamState7<0, param1, param2, param3, param4, param5, param6, std::string > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual void Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *fmt, ...) \
{ \
g_Inside_LeafFunc = true; \
\
char buf[9999]; \
va_list ap; \
va_start(ap, fmt); \
vsnprintf(buf, 9998, fmt, ap); \
buf[9998] = 0; \
va_end(ap); \
\
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5, p6, std::string(buf)))); \
g_Inside_LeafFunc = false; \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
#define THGM_MAKE_TEST6_vafmt(id, ret_type, param1, param2, param3, param4, param5, param6) \
struct TestClass##id; \
typedef ret_type RetType##id; \
typedef ParamState6<0, param1, param2, param3, param4, param5, param6 > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
g_Inside_LeafFunc = false; \
\
return MakeRet< ret_type >::Do(0); \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6)); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6)); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
#define THGM_SETUP_PI6(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags, p4_type, p4_passtype, p4_flags, p5_type, p5_passtype, p5_flags, p6_type, p6_passtype, p6_flags) \
void setuppi_##id() \
{ \

View File

@ -132,6 +132,20 @@ struct MakeRet< POD<SIZE> >
};
// Stores parameter status
template <class T>
bool EqualToMyFmtString(T sth)
{
return false;
}
bool EqualToMyFmtString(std::string &sth)
{
if (sth == "Hello %s%d%s")
sth = "Hello BA1L!";
return true;
}
@[$1,0,$a:
template<int dummy@[$2,1,$1:, class p$2@]>
@ -145,8 +159,11 @@ struct ParamState$1
@[$2,1,$1: && m_$1 == other.m_$1@]
;
}
ParamState$1(@[$2,1,$1|, :p$2 a$2@]) @[$1!=0::@] @[$2,1,$1|, :m_$2(a$2)@]
ParamState$1(@[$2,1,$1:p$2 a$2, @]...) @[$1!=0::@] @[$2,1,$1|, :m_$2(a$2)@]
{
@[$2,1,$1:
EqualToMyFmtString(m_$2);
@]
}
ParamState$1<dummy@[$2,1,$1:, p$2@]> & operator() (int incrsteps)
@ -364,6 +381,197 @@ std::ostream& operator <<(std::ostream &os,const ParamState$1<0@[$2,1,$1:, p$2@]
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
#define THGM_MAKE_TEST$1_vafmt_void(id@[$2,1,$1:, param$2@]) \
struct TestClass##id; \
typedef ParamState@($1+1)<0@[$2,1,$1:, param$2@], std::string > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual void Func(@[$2,1,$1:param$2 p$2, @]const char *fmt, ...) \
{ \
g_Inside_LeafFunc = true; \
\
char buf[9999]; \
va_list ap; \
va_start(ap, fmt); \
vsnprintf(buf, 9998, fmt, ap); \
buf[9998] = 0; \
va_end(ap); \
\
ADD_STATE(State_Func##id(this, ParamState_m##id(@[$2,1,$1:p$2, @]std::string(buf)))); \
g_Inside_LeafFunc = false; \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual void Call(@[$2,1,$1:param$2 p$2, @]const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(@[$2,1,$1:p$2, @]buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
@[$2,1,$1:Increment<StripRef< param$2 >::type>::Incr(p$2);@] \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (@[$2,1,$1:p$2, @]"%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual void Call(@[$2,1,$1:param$2 p$2, @]const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(@[$2,1,$1:p$2, @]buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
@[$2,1,$1:Increment<StripRef< param$2 >::type>::Incr(p$2);@] \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (@[$2,1,$1:p$2, @]"%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual void Call(@[$2,1,$1:param$2 p$2, @]const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(@[$2,1,$1:p$2, @]buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
@[$2,1,$1:Increment<StripRef< param$2 >::type>::Incr(p$2);@] \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (@[$2,1,$1:p$2, @]"%s!", buf)); \
} \
else \
RETURN_META(MRES_IGNORED); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual void Call(@[$2,1,$1:param$2 p$2, @]const char *buf) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(@[$2,1,$1:p$2, @]buf))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
@[$2,1,$1:Increment<StripRef< param$2 >::type>::Incr(p$2);@] \
RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (@[$2,1,$1:p$2, @]"%s!", buf)); \
} \
else \
RETURN_META(MRES_SUPERCEDE); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
#define THGM_MAKE_TEST$1_vafmt(id, ret_type@[$2,1,$1:, param$2@]) \
struct TestClass##id; \
typedef ret_type RetType##id; \
typedef ParamState$1<0@[$2,1,$1:, param$2@] > ParamState_m##id; \
MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
\
struct TestClass##id \
{ \
static bool ms_DoRecall; \
\
virtual ret_type Func(@[$2,1,$1|, :param$2 p$2@]) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Func##id(this, ParamState_m##id(@[$2,1,$1|, :p$2@]))); \
g_Inside_LeafFunc = false; \
\
return MakeRet< ret_type >::Do(0); \
} \
\
struct Delegate1 : public MyDelegate \
{ \
virtual ret_type Call(@[$2,1,$1|, :param$2 p$2@]) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(@[$2,1,$1|, :p$2@]))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
@[$2,1,$1:Increment<StripRef< param$2 >::type>::Incr(p$2);@] \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (@[$2,1,$1|, :p$2@])); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
} \
}; \
struct Delegate2 : public MyDelegate \
{ \
virtual ret_type Call(@[$2,1,$1|, :param$2 p$2@]) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(@[$2,1,$1|, :p$2@]))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
@[$2,1,$1:Increment<StripRef< param$2 >::type>::Incr(p$2);@] \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (@[$2,1,$1|, :p$2@])); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
} \
}; \
struct Delegate3 : public MyDelegate \
{ \
virtual ret_type Call(@[$2,1,$1|, :param$2 p$2@]) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(@[$2,1,$1|, :p$2@]))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
@[$2,1,$1:Increment<StripRef< param$2 >::type>::Incr(p$2);@] \
RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (@[$2,1,$1|, :p$2@])); \
} \
else \
RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
} \
}; \
struct Delegate4 : public MyDelegate \
{ \
virtual ret_type Call(@[$2,1,$1|, :param$2 p$2@]) \
{ \
g_Inside_LeafFunc = true; \
ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(@[$2,1,$1|, :p$2@]))); \
g_Inside_LeafFunc = false; \
if (ms_DoRecall) \
{ \
@[$2,1,$1:Increment<StripRef< param$2 >::type>::Incr(p$2);@] \
RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (@[$2,1,$1|, :p$2@])); \
} \
else \
RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
}; \
}; \
}; \
\
bool TestClass##id::ms_DoRecall = false; \
SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
#define THGM_SETUP_PI$1(id@[$2,1,$1:, p$2_type, p$2_passtype, p$2_flags@]) \
void setuppi_##id() \
{ \