sourcehook/test/testhookmangen.h
branchhookman_autogen
changeset 463 7a413a63426f
parent 458 4a0c5136f5e1
child 465 c86a55fbcd88
     1.1 --- a/sourcehook/test/testhookmangen.h	Sat Nov 17 09:53:58 2007 +0000
     1.2 +++ b/sourcehook/test/testhookmangen.h	Sun Nov 18 11:58:07 2007 +0000
     1.3 @@ -132,6 +132,20 @@
     1.4  };
     1.5  
     1.6  // Stores parameter status
     1.7 +template <class T>
     1.8 +bool EqualToMyFmtString(T sth)
     1.9 +{
    1.10 +	return false;
    1.11 +}
    1.12 +
    1.13 +bool EqualToMyFmtString(std::string &sth)
    1.14 +{
    1.15 +	if (sth == "Hello %s%d%s")
    1.16 +		sth = "Hello BA1L!";
    1.17 +	return true;
    1.18 +}
    1.19 +
    1.20 +
    1.21  
    1.22  
    1.23  template<int dummy>
    1.24 @@ -145,8 +159,9 @@
    1.25  			
    1.26  			;
    1.27  	}
    1.28 -	ParamState0()  
    1.29 +	ParamState0(...)  
    1.30  	{
    1.31 +		
    1.32  	}
    1.33  	
    1.34  	ParamState0<dummy> & operator() (int incrsteps)
    1.35 @@ -178,8 +193,11 @@
    1.36  			 && m_1 == other.m_1
    1.37  			;
    1.38  	}
    1.39 -	ParamState1(p1 a1) : m_1(a1)
    1.40 +	ParamState1(p1 a1, ...) : m_1(a1)
    1.41  	{
    1.42 +		
    1.43 +		EqualToMyFmtString(m_1);
    1.44 +		
    1.45  	}
    1.46  	
    1.47  	ParamState1<dummy, p1> & operator() (int incrsteps)
    1.48 @@ -214,8 +232,13 @@
    1.49  			 && m_2 == other.m_2 && m_2 == other.m_2
    1.50  			;
    1.51  	}
    1.52 -	ParamState2(p1 a1, p2 a2) : m_1(a1), m_2(a2)
    1.53 +	ParamState2(p1 a1, p2 a2, ...) : m_1(a1), m_2(a2)
    1.54  	{
    1.55 +		
    1.56 +		EqualToMyFmtString(m_1);
    1.57 +		
    1.58 +		EqualToMyFmtString(m_2);
    1.59 +		
    1.60  	}
    1.61  	
    1.62  	ParamState2<dummy, p1, p2> & operator() (int incrsteps)
    1.63 @@ -253,8 +276,15 @@
    1.64  			 && m_3 == other.m_3 && m_3 == other.m_3 && m_3 == other.m_3
    1.65  			;
    1.66  	}
    1.67 -	ParamState3(p1 a1, p2 a2, p3 a3) : m_1(a1), m_2(a2), m_3(a3)
    1.68 +	ParamState3(p1 a1, p2 a2, p3 a3, ...) : m_1(a1), m_2(a2), m_3(a3)
    1.69  	{
    1.70 +		
    1.71 +		EqualToMyFmtString(m_1);
    1.72 +		
    1.73 +		EqualToMyFmtString(m_2);
    1.74 +		
    1.75 +		EqualToMyFmtString(m_3);
    1.76 +		
    1.77  	}
    1.78  	
    1.79  	ParamState3<dummy, p1, p2, p3> & operator() (int incrsteps)
    1.80 @@ -295,8 +325,17 @@
    1.81  			 && m_4 == other.m_4 && m_4 == other.m_4 && m_4 == other.m_4 && m_4 == other.m_4
    1.82  			;
    1.83  	}
    1.84 -	ParamState4(p1 a1, p2 a2, p3 a3, p4 a4) : m_1(a1), m_2(a2), m_3(a3), m_4(a4)
    1.85 +	ParamState4(p1 a1, p2 a2, p3 a3, p4 a4, ...) : m_1(a1), m_2(a2), m_3(a3), m_4(a4)
    1.86  	{
    1.87 +		
    1.88 +		EqualToMyFmtString(m_1);
    1.89 +		
    1.90 +		EqualToMyFmtString(m_2);
    1.91 +		
    1.92 +		EqualToMyFmtString(m_3);
    1.93 +		
    1.94 +		EqualToMyFmtString(m_4);
    1.95 +		
    1.96  	}
    1.97  	
    1.98  	ParamState4<dummy, p1, p2, p3, p4> & operator() (int incrsteps)
    1.99 @@ -340,8 +379,19 @@
   1.100  			 && 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
   1.101  			;
   1.102  	}
   1.103 -	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)
   1.104 +	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)
   1.105  	{
   1.106 +		
   1.107 +		EqualToMyFmtString(m_1);
   1.108 +		
   1.109 +		EqualToMyFmtString(m_2);
   1.110 +		
   1.111 +		EqualToMyFmtString(m_3);
   1.112 +		
   1.113 +		EqualToMyFmtString(m_4);
   1.114 +		
   1.115 +		EqualToMyFmtString(m_5);
   1.116 +		
   1.117  	}
   1.118  	
   1.119  	ParamState5<dummy, p1, p2, p3, p4, p5> & operator() (int incrsteps)
   1.120 @@ -388,8 +438,21 @@
   1.121  			 && 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
   1.122  			;
   1.123  	}
   1.124 -	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)
   1.125 +	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)
   1.126  	{
   1.127 +		
   1.128 +		EqualToMyFmtString(m_1);
   1.129 +		
   1.130 +		EqualToMyFmtString(m_2);
   1.131 +		
   1.132 +		EqualToMyFmtString(m_3);
   1.133 +		
   1.134 +		EqualToMyFmtString(m_4);
   1.135 +		
   1.136 +		EqualToMyFmtString(m_5);
   1.137 +		
   1.138 +		EqualToMyFmtString(m_6);
   1.139 +		
   1.140  	}
   1.141  	
   1.142  	ParamState6<dummy, p1, p2, p3, p4, p5, p6> & operator() (int incrsteps)
   1.143 @@ -622,6 +685,197 @@
   1.144  	bool TestClass##id::ms_DoRecall = false; \
   1.145  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.146  	
   1.147 +#define THGM_MAKE_TEST0_vafmt_void(id) \
   1.148 +	struct TestClass##id; \
   1.149 +	typedef ParamState1<0, std::string > ParamState_m##id; \
   1.150 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.151 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.152 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.153 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.154 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.155 +	\
   1.156 +	struct TestClass##id \
   1.157 +	{ \
   1.158 +		static bool ms_DoRecall; \
   1.159 +		\
   1.160 +		virtual void Func(const char *fmt, ...) \
   1.161 +		{ \
   1.162 +			g_Inside_LeafFunc = true; \
   1.163 +			\
   1.164 +			char buf[9999]; \
   1.165 +			va_list ap; \
   1.166 +			va_start(ap, fmt); \
   1.167 +			vsnprintf(buf, 9998, fmt, ap); \
   1.168 +			buf[9998] = 0; \
   1.169 +			va_end(ap); \
   1.170 +			\
   1.171 +			ADD_STATE(State_Func##id(this, ParamState_m##id(std::string(buf)))); \
   1.172 +			g_Inside_LeafFunc = false; \
   1.173 +		} \
   1.174 +		\
   1.175 +		struct Delegate1 : public MyDelegate \
   1.176 +		{ \
   1.177 +			virtual void Call(const char *buf) \
   1.178 +			{ \
   1.179 +				g_Inside_LeafFunc = true; \
   1.180 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
   1.181 +				g_Inside_LeafFunc = false; \
   1.182 +				if (ms_DoRecall) \
   1.183 +				{ \
   1.184 +					 \
   1.185 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, ("%s!", buf)); \
   1.186 +				} \
   1.187 +				else \
   1.188 +					RETURN_META(MRES_IGNORED); \
   1.189 +			} \
   1.190 +		}; \
   1.191 +		struct Delegate2 : public MyDelegate \
   1.192 +		{ \
   1.193 +			virtual void Call(const char *buf) \
   1.194 +			{ \
   1.195 +				g_Inside_LeafFunc = true; \
   1.196 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
   1.197 +				g_Inside_LeafFunc = false; \
   1.198 +				if (ms_DoRecall) \
   1.199 +				{ \
   1.200 +					 \
   1.201 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, ("%s!", buf)); \
   1.202 +				} \
   1.203 +				else \
   1.204 +					RETURN_META(MRES_SUPERCEDE); \
   1.205 +			} \
   1.206 +		}; \
   1.207 +		struct Delegate3 : public MyDelegate \
   1.208 +		{ \
   1.209 +			virtual void Call(const char *buf) \
   1.210 +			{ \
   1.211 +				g_Inside_LeafFunc = true; \
   1.212 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
   1.213 +				g_Inside_LeafFunc = false; \
   1.214 +				if (ms_DoRecall) \
   1.215 +				{ \
   1.216 +					 \
   1.217 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, ("%s!", buf)); \
   1.218 +				} \
   1.219 +				else \
   1.220 +					RETURN_META(MRES_IGNORED); \
   1.221 +			} \
   1.222 +		}; \
   1.223 +		struct Delegate4 : public MyDelegate \
   1.224 +		{ \
   1.225 +			virtual void Call(const char *buf) \
   1.226 +			{ \
   1.227 +				g_Inside_LeafFunc = true; \
   1.228 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
   1.229 +				g_Inside_LeafFunc = false; \
   1.230 +				if (ms_DoRecall) \
   1.231 +				{ \
   1.232 +					 \
   1.233 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, ("%s!", buf)); \
   1.234 +				} \
   1.235 +				else \
   1.236 +					RETURN_META(MRES_SUPERCEDE); \
   1.237 +			}; \
   1.238 +		}; \
   1.239 +	}; \
   1.240 +	\
   1.241 +	bool TestClass##id::ms_DoRecall = false; \
   1.242 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.243 +
   1.244 +
   1.245 +#define THGM_MAKE_TEST0_vafmt(id, ret_type) \
   1.246 +	struct TestClass##id; \
   1.247 +	typedef ret_type RetType##id; \
   1.248 +	typedef ParamState0<0 > ParamState_m##id; \
   1.249 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.250 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.251 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.252 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.253 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.254 +	\
   1.255 +	struct TestClass##id \
   1.256 +	{ \
   1.257 +		static bool ms_DoRecall; \
   1.258 +		\
   1.259 +		virtual ret_type Func() \
   1.260 +		{ \
   1.261 +			g_Inside_LeafFunc = true; \
   1.262 +			ADD_STATE(State_Func##id(this, ParamState_m##id())); \
   1.263 +			g_Inside_LeafFunc = false; \
   1.264 +			\
   1.265 +			return MakeRet< ret_type >::Do(0); \
   1.266 +		} \
   1.267 +		\
   1.268 +		struct Delegate1 : public MyDelegate \
   1.269 +		{ \
   1.270 +			virtual ret_type Call() \
   1.271 +			{ \
   1.272 +				g_Inside_LeafFunc = true; \
   1.273 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id())); \
   1.274 +				g_Inside_LeafFunc = false; \
   1.275 +				if (ms_DoRecall) \
   1.276 +				{ \
   1.277 +					 \
   1.278 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, ()); \
   1.279 +				} \
   1.280 +				else \
   1.281 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
   1.282 +			} \
   1.283 +		}; \
   1.284 +		struct Delegate2 : public MyDelegate \
   1.285 +		{ \
   1.286 +			virtual ret_type Call() \
   1.287 +			{ \
   1.288 +				g_Inside_LeafFunc = true; \
   1.289 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id())); \
   1.290 +				g_Inside_LeafFunc = false; \
   1.291 +				if (ms_DoRecall) \
   1.292 +				{ \
   1.293 +					 \
   1.294 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, ()); \
   1.295 +				} \
   1.296 +				else \
   1.297 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
   1.298 +			} \
   1.299 +		}; \
   1.300 +		struct Delegate3 : public MyDelegate \
   1.301 +		{ \
   1.302 +			virtual ret_type Call() \
   1.303 +			{ \
   1.304 +				g_Inside_LeafFunc = true; \
   1.305 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id())); \
   1.306 +				g_Inside_LeafFunc = false; \
   1.307 +				if (ms_DoRecall) \
   1.308 +				{ \
   1.309 +					 \
   1.310 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, ()); \
   1.311 +				} \
   1.312 +				else \
   1.313 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
   1.314 +			} \
   1.315 +		}; \
   1.316 +		struct Delegate4 : public MyDelegate \
   1.317 +		{ \
   1.318 +			virtual ret_type Call() \
   1.319 +			{ \
   1.320 +				g_Inside_LeafFunc = true; \
   1.321 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id())); \
   1.322 +				g_Inside_LeafFunc = false; \
   1.323 +				if (ms_DoRecall) \
   1.324 +				{ \
   1.325 +					 \
   1.326 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, ()); \
   1.327 +				} \
   1.328 +				else \
   1.329 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
   1.330 +			}; \
   1.331 +		}; \
   1.332 +	}; \
   1.333 +	\
   1.334 +	bool TestClass##id::ms_DoRecall = false; \
   1.335 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
   1.336 +
   1.337 +
   1.338  #define THGM_SETUP_PI0(id) \
   1.339  	void setuppi_##id() \
   1.340  	{ \
   1.341 @@ -812,6 +1066,197 @@
   1.342  	bool TestClass##id::ms_DoRecall = false; \
   1.343  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.344  	
   1.345 +#define THGM_MAKE_TEST1_vafmt_void(id, param1) \
   1.346 +	struct TestClass##id; \
   1.347 +	typedef ParamState2<0, param1, std::string > ParamState_m##id; \
   1.348 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.349 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.350 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.351 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.352 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.353 +	\
   1.354 +	struct TestClass##id \
   1.355 +	{ \
   1.356 +		static bool ms_DoRecall; \
   1.357 +		\
   1.358 +		virtual void Func(param1 p1, const char *fmt, ...) \
   1.359 +		{ \
   1.360 +			g_Inside_LeafFunc = true; \
   1.361 +			\
   1.362 +			char buf[9999]; \
   1.363 +			va_list ap; \
   1.364 +			va_start(ap, fmt); \
   1.365 +			vsnprintf(buf, 9998, fmt, ap); \
   1.366 +			buf[9998] = 0; \
   1.367 +			va_end(ap); \
   1.368 +			\
   1.369 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, std::string(buf)))); \
   1.370 +			g_Inside_LeafFunc = false; \
   1.371 +		} \
   1.372 +		\
   1.373 +		struct Delegate1 : public MyDelegate \
   1.374 +		{ \
   1.375 +			virtual void Call(param1 p1, const char *buf) \
   1.376 +			{ \
   1.377 +				g_Inside_LeafFunc = true; \
   1.378 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
   1.379 +				g_Inside_LeafFunc = false; \
   1.380 +				if (ms_DoRecall) \
   1.381 +				{ \
   1.382 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.383 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, "%s!", buf)); \
   1.384 +				} \
   1.385 +				else \
   1.386 +					RETURN_META(MRES_IGNORED); \
   1.387 +			} \
   1.388 +		}; \
   1.389 +		struct Delegate2 : public MyDelegate \
   1.390 +		{ \
   1.391 +			virtual void Call(param1 p1, const char *buf) \
   1.392 +			{ \
   1.393 +				g_Inside_LeafFunc = true; \
   1.394 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
   1.395 +				g_Inside_LeafFunc = false; \
   1.396 +				if (ms_DoRecall) \
   1.397 +				{ \
   1.398 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.399 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, "%s!", buf)); \
   1.400 +				} \
   1.401 +				else \
   1.402 +					RETURN_META(MRES_SUPERCEDE); \
   1.403 +			} \
   1.404 +		}; \
   1.405 +		struct Delegate3 : public MyDelegate \
   1.406 +		{ \
   1.407 +			virtual void Call(param1 p1, const char *buf) \
   1.408 +			{ \
   1.409 +				g_Inside_LeafFunc = true; \
   1.410 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
   1.411 +				g_Inside_LeafFunc = false; \
   1.412 +				if (ms_DoRecall) \
   1.413 +				{ \
   1.414 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.415 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, "%s!", buf)); \
   1.416 +				} \
   1.417 +				else \
   1.418 +					RETURN_META(MRES_IGNORED); \
   1.419 +			} \
   1.420 +		}; \
   1.421 +		struct Delegate4 : public MyDelegate \
   1.422 +		{ \
   1.423 +			virtual void Call(param1 p1, const char *buf) \
   1.424 +			{ \
   1.425 +				g_Inside_LeafFunc = true; \
   1.426 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
   1.427 +				g_Inside_LeafFunc = false; \
   1.428 +				if (ms_DoRecall) \
   1.429 +				{ \
   1.430 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.431 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, "%s!", buf)); \
   1.432 +				} \
   1.433 +				else \
   1.434 +					RETURN_META(MRES_SUPERCEDE); \
   1.435 +			}; \
   1.436 +		}; \
   1.437 +	}; \
   1.438 +	\
   1.439 +	bool TestClass##id::ms_DoRecall = false; \
   1.440 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.441 +
   1.442 +
   1.443 +#define THGM_MAKE_TEST1_vafmt(id, ret_type, param1) \
   1.444 +	struct TestClass##id; \
   1.445 +	typedef ret_type RetType##id; \
   1.446 +	typedef ParamState1<0, param1 > ParamState_m##id; \
   1.447 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.448 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.449 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.450 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.451 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.452 +	\
   1.453 +	struct TestClass##id \
   1.454 +	{ \
   1.455 +		static bool ms_DoRecall; \
   1.456 +		\
   1.457 +		virtual ret_type Func(param1 p1) \
   1.458 +		{ \
   1.459 +			g_Inside_LeafFunc = true; \
   1.460 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1))); \
   1.461 +			g_Inside_LeafFunc = false; \
   1.462 +			\
   1.463 +			return MakeRet< ret_type >::Do(0); \
   1.464 +		} \
   1.465 +		\
   1.466 +		struct Delegate1 : public MyDelegate \
   1.467 +		{ \
   1.468 +			virtual ret_type Call(param1 p1) \
   1.469 +			{ \
   1.470 +				g_Inside_LeafFunc = true; \
   1.471 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1))); \
   1.472 +				g_Inside_LeafFunc = false; \
   1.473 +				if (ms_DoRecall) \
   1.474 +				{ \
   1.475 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.476 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1)); \
   1.477 +				} \
   1.478 +				else \
   1.479 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
   1.480 +			} \
   1.481 +		}; \
   1.482 +		struct Delegate2 : public MyDelegate \
   1.483 +		{ \
   1.484 +			virtual ret_type Call(param1 p1) \
   1.485 +			{ \
   1.486 +				g_Inside_LeafFunc = true; \
   1.487 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1))); \
   1.488 +				g_Inside_LeafFunc = false; \
   1.489 +				if (ms_DoRecall) \
   1.490 +				{ \
   1.491 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.492 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1)); \
   1.493 +				} \
   1.494 +				else \
   1.495 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
   1.496 +			} \
   1.497 +		}; \
   1.498 +		struct Delegate3 : public MyDelegate \
   1.499 +		{ \
   1.500 +			virtual ret_type Call(param1 p1) \
   1.501 +			{ \
   1.502 +				g_Inside_LeafFunc = true; \
   1.503 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1))); \
   1.504 +				g_Inside_LeafFunc = false; \
   1.505 +				if (ms_DoRecall) \
   1.506 +				{ \
   1.507 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.508 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1)); \
   1.509 +				} \
   1.510 +				else \
   1.511 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
   1.512 +			} \
   1.513 +		}; \
   1.514 +		struct Delegate4 : public MyDelegate \
   1.515 +		{ \
   1.516 +			virtual ret_type Call(param1 p1) \
   1.517 +			{ \
   1.518 +				g_Inside_LeafFunc = true; \
   1.519 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1))); \
   1.520 +				g_Inside_LeafFunc = false; \
   1.521 +				if (ms_DoRecall) \
   1.522 +				{ \
   1.523 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.524 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1)); \
   1.525 +				} \
   1.526 +				else \
   1.527 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
   1.528 +			}; \
   1.529 +		}; \
   1.530 +	}; \
   1.531 +	\
   1.532 +	bool TestClass##id::ms_DoRecall = false; \
   1.533 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
   1.534 +
   1.535 +
   1.536  #define THGM_SETUP_PI1(id, p1_type, p1_passtype, p1_flags) \
   1.537  	void setuppi_##id() \
   1.538  	{ \
   1.539 @@ -1009,6 +1454,197 @@
   1.540  	bool TestClass##id::ms_DoRecall = false; \
   1.541  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.542  	
   1.543 +#define THGM_MAKE_TEST2_vafmt_void(id, param1, param2) \
   1.544 +	struct TestClass##id; \
   1.545 +	typedef ParamState3<0, param1, param2, std::string > ParamState_m##id; \
   1.546 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.547 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.548 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.549 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.550 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.551 +	\
   1.552 +	struct TestClass##id \
   1.553 +	{ \
   1.554 +		static bool ms_DoRecall; \
   1.555 +		\
   1.556 +		virtual void Func(param1 p1, param2 p2, const char *fmt, ...) \
   1.557 +		{ \
   1.558 +			g_Inside_LeafFunc = true; \
   1.559 +			\
   1.560 +			char buf[9999]; \
   1.561 +			va_list ap; \
   1.562 +			va_start(ap, fmt); \
   1.563 +			vsnprintf(buf, 9998, fmt, ap); \
   1.564 +			buf[9998] = 0; \
   1.565 +			va_end(ap); \
   1.566 +			\
   1.567 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, std::string(buf)))); \
   1.568 +			g_Inside_LeafFunc = false; \
   1.569 +		} \
   1.570 +		\
   1.571 +		struct Delegate1 : public MyDelegate \
   1.572 +		{ \
   1.573 +			virtual void Call(param1 p1, param2 p2, const char *buf) \
   1.574 +			{ \
   1.575 +				g_Inside_LeafFunc = true; \
   1.576 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
   1.577 +				g_Inside_LeafFunc = false; \
   1.578 +				if (ms_DoRecall) \
   1.579 +				{ \
   1.580 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.581 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, "%s!", buf)); \
   1.582 +				} \
   1.583 +				else \
   1.584 +					RETURN_META(MRES_IGNORED); \
   1.585 +			} \
   1.586 +		}; \
   1.587 +		struct Delegate2 : public MyDelegate \
   1.588 +		{ \
   1.589 +			virtual void Call(param1 p1, param2 p2, const char *buf) \
   1.590 +			{ \
   1.591 +				g_Inside_LeafFunc = true; \
   1.592 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
   1.593 +				g_Inside_LeafFunc = false; \
   1.594 +				if (ms_DoRecall) \
   1.595 +				{ \
   1.596 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.597 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, "%s!", buf)); \
   1.598 +				} \
   1.599 +				else \
   1.600 +					RETURN_META(MRES_SUPERCEDE); \
   1.601 +			} \
   1.602 +		}; \
   1.603 +		struct Delegate3 : public MyDelegate \
   1.604 +		{ \
   1.605 +			virtual void Call(param1 p1, param2 p2, const char *buf) \
   1.606 +			{ \
   1.607 +				g_Inside_LeafFunc = true; \
   1.608 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
   1.609 +				g_Inside_LeafFunc = false; \
   1.610 +				if (ms_DoRecall) \
   1.611 +				{ \
   1.612 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.613 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, "%s!", buf)); \
   1.614 +				} \
   1.615 +				else \
   1.616 +					RETURN_META(MRES_IGNORED); \
   1.617 +			} \
   1.618 +		}; \
   1.619 +		struct Delegate4 : public MyDelegate \
   1.620 +		{ \
   1.621 +			virtual void Call(param1 p1, param2 p2, const char *buf) \
   1.622 +			{ \
   1.623 +				g_Inside_LeafFunc = true; \
   1.624 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
   1.625 +				g_Inside_LeafFunc = false; \
   1.626 +				if (ms_DoRecall) \
   1.627 +				{ \
   1.628 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.629 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, "%s!", buf)); \
   1.630 +				} \
   1.631 +				else \
   1.632 +					RETURN_META(MRES_SUPERCEDE); \
   1.633 +			}; \
   1.634 +		}; \
   1.635 +	}; \
   1.636 +	\
   1.637 +	bool TestClass##id::ms_DoRecall = false; \
   1.638 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.639 +
   1.640 +
   1.641 +#define THGM_MAKE_TEST2_vafmt(id, ret_type, param1, param2) \
   1.642 +	struct TestClass##id; \
   1.643 +	typedef ret_type RetType##id; \
   1.644 +	typedef ParamState2<0, param1, param2 > ParamState_m##id; \
   1.645 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.646 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.647 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.648 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.649 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.650 +	\
   1.651 +	struct TestClass##id \
   1.652 +	{ \
   1.653 +		static bool ms_DoRecall; \
   1.654 +		\
   1.655 +		virtual ret_type Func(param1 p1, param2 p2) \
   1.656 +		{ \
   1.657 +			g_Inside_LeafFunc = true; \
   1.658 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2))); \
   1.659 +			g_Inside_LeafFunc = false; \
   1.660 +			\
   1.661 +			return MakeRet< ret_type >::Do(0); \
   1.662 +		} \
   1.663 +		\
   1.664 +		struct Delegate1 : public MyDelegate \
   1.665 +		{ \
   1.666 +			virtual ret_type Call(param1 p1, param2 p2) \
   1.667 +			{ \
   1.668 +				g_Inside_LeafFunc = true; \
   1.669 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2))); \
   1.670 +				g_Inside_LeafFunc = false; \
   1.671 +				if (ms_DoRecall) \
   1.672 +				{ \
   1.673 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.674 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2)); \
   1.675 +				} \
   1.676 +				else \
   1.677 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
   1.678 +			} \
   1.679 +		}; \
   1.680 +		struct Delegate2 : public MyDelegate \
   1.681 +		{ \
   1.682 +			virtual ret_type Call(param1 p1, param2 p2) \
   1.683 +			{ \
   1.684 +				g_Inside_LeafFunc = true; \
   1.685 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2))); \
   1.686 +				g_Inside_LeafFunc = false; \
   1.687 +				if (ms_DoRecall) \
   1.688 +				{ \
   1.689 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.690 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2)); \
   1.691 +				} \
   1.692 +				else \
   1.693 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
   1.694 +			} \
   1.695 +		}; \
   1.696 +		struct Delegate3 : public MyDelegate \
   1.697 +		{ \
   1.698 +			virtual ret_type Call(param1 p1, param2 p2) \
   1.699 +			{ \
   1.700 +				g_Inside_LeafFunc = true; \
   1.701 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2))); \
   1.702 +				g_Inside_LeafFunc = false; \
   1.703 +				if (ms_DoRecall) \
   1.704 +				{ \
   1.705 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.706 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2)); \
   1.707 +				} \
   1.708 +				else \
   1.709 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
   1.710 +			} \
   1.711 +		}; \
   1.712 +		struct Delegate4 : public MyDelegate \
   1.713 +		{ \
   1.714 +			virtual ret_type Call(param1 p1, param2 p2) \
   1.715 +			{ \
   1.716 +				g_Inside_LeafFunc = true; \
   1.717 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2))); \
   1.718 +				g_Inside_LeafFunc = false; \
   1.719 +				if (ms_DoRecall) \
   1.720 +				{ \
   1.721 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.722 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2)); \
   1.723 +				} \
   1.724 +				else \
   1.725 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
   1.726 +			}; \
   1.727 +		}; \
   1.728 +	}; \
   1.729 +	\
   1.730 +	bool TestClass##id::ms_DoRecall = false; \
   1.731 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
   1.732 +
   1.733 +
   1.734  #define THGM_SETUP_PI2(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags) \
   1.735  	void setuppi_##id() \
   1.736  	{ \
   1.737 @@ -1213,6 +1849,197 @@
   1.738  	bool TestClass##id::ms_DoRecall = false; \
   1.739  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.740  	
   1.741 +#define THGM_MAKE_TEST3_vafmt_void(id, param1, param2, param3) \
   1.742 +	struct TestClass##id; \
   1.743 +	typedef ParamState4<0, param1, param2, param3, std::string > ParamState_m##id; \
   1.744 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.745 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.746 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.747 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.748 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.749 +	\
   1.750 +	struct TestClass##id \
   1.751 +	{ \
   1.752 +		static bool ms_DoRecall; \
   1.753 +		\
   1.754 +		virtual void Func(param1 p1, param2 p2, param3 p3, const char *fmt, ...) \
   1.755 +		{ \
   1.756 +			g_Inside_LeafFunc = true; \
   1.757 +			\
   1.758 +			char buf[9999]; \
   1.759 +			va_list ap; \
   1.760 +			va_start(ap, fmt); \
   1.761 +			vsnprintf(buf, 9998, fmt, ap); \
   1.762 +			buf[9998] = 0; \
   1.763 +			va_end(ap); \
   1.764 +			\
   1.765 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, std::string(buf)))); \
   1.766 +			g_Inside_LeafFunc = false; \
   1.767 +		} \
   1.768 +		\
   1.769 +		struct Delegate1 : public MyDelegate \
   1.770 +		{ \
   1.771 +			virtual void Call(param1 p1, param2 p2, param3 p3, const char *buf) \
   1.772 +			{ \
   1.773 +				g_Inside_LeafFunc = true; \
   1.774 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
   1.775 +				g_Inside_LeafFunc = false; \
   1.776 +				if (ms_DoRecall) \
   1.777 +				{ \
   1.778 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.779 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
   1.780 +				} \
   1.781 +				else \
   1.782 +					RETURN_META(MRES_IGNORED); \
   1.783 +			} \
   1.784 +		}; \
   1.785 +		struct Delegate2 : public MyDelegate \
   1.786 +		{ \
   1.787 +			virtual void Call(param1 p1, param2 p2, param3 p3, const char *buf) \
   1.788 +			{ \
   1.789 +				g_Inside_LeafFunc = true; \
   1.790 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
   1.791 +				g_Inside_LeafFunc = false; \
   1.792 +				if (ms_DoRecall) \
   1.793 +				{ \
   1.794 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.795 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
   1.796 +				} \
   1.797 +				else \
   1.798 +					RETURN_META(MRES_SUPERCEDE); \
   1.799 +			} \
   1.800 +		}; \
   1.801 +		struct Delegate3 : public MyDelegate \
   1.802 +		{ \
   1.803 +			virtual void Call(param1 p1, param2 p2, param3 p3, const char *buf) \
   1.804 +			{ \
   1.805 +				g_Inside_LeafFunc = true; \
   1.806 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
   1.807 +				g_Inside_LeafFunc = false; \
   1.808 +				if (ms_DoRecall) \
   1.809 +				{ \
   1.810 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.811 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
   1.812 +				} \
   1.813 +				else \
   1.814 +					RETURN_META(MRES_IGNORED); \
   1.815 +			} \
   1.816 +		}; \
   1.817 +		struct Delegate4 : public MyDelegate \
   1.818 +		{ \
   1.819 +			virtual void Call(param1 p1, param2 p2, param3 p3, const char *buf) \
   1.820 +			{ \
   1.821 +				g_Inside_LeafFunc = true; \
   1.822 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
   1.823 +				g_Inside_LeafFunc = false; \
   1.824 +				if (ms_DoRecall) \
   1.825 +				{ \
   1.826 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.827 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
   1.828 +				} \
   1.829 +				else \
   1.830 +					RETURN_META(MRES_SUPERCEDE); \
   1.831 +			}; \
   1.832 +		}; \
   1.833 +	}; \
   1.834 +	\
   1.835 +	bool TestClass##id::ms_DoRecall = false; \
   1.836 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.837 +
   1.838 +
   1.839 +#define THGM_MAKE_TEST3_vafmt(id, ret_type, param1, param2, param3) \
   1.840 +	struct TestClass##id; \
   1.841 +	typedef ret_type RetType##id; \
   1.842 +	typedef ParamState3<0, param1, param2, param3 > ParamState_m##id; \
   1.843 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.844 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.845 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.846 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.847 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.848 +	\
   1.849 +	struct TestClass##id \
   1.850 +	{ \
   1.851 +		static bool ms_DoRecall; \
   1.852 +		\
   1.853 +		virtual ret_type Func(param1 p1, param2 p2, param3 p3) \
   1.854 +		{ \
   1.855 +			g_Inside_LeafFunc = true; \
   1.856 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3))); \
   1.857 +			g_Inside_LeafFunc = false; \
   1.858 +			\
   1.859 +			return MakeRet< ret_type >::Do(0); \
   1.860 +		} \
   1.861 +		\
   1.862 +		struct Delegate1 : public MyDelegate \
   1.863 +		{ \
   1.864 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3) \
   1.865 +			{ \
   1.866 +				g_Inside_LeafFunc = true; \
   1.867 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3))); \
   1.868 +				g_Inside_LeafFunc = false; \
   1.869 +				if (ms_DoRecall) \
   1.870 +				{ \
   1.871 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.872 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2, p3)); \
   1.873 +				} \
   1.874 +				else \
   1.875 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
   1.876 +			} \
   1.877 +		}; \
   1.878 +		struct Delegate2 : public MyDelegate \
   1.879 +		{ \
   1.880 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3) \
   1.881 +			{ \
   1.882 +				g_Inside_LeafFunc = true; \
   1.883 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3))); \
   1.884 +				g_Inside_LeafFunc = false; \
   1.885 +				if (ms_DoRecall) \
   1.886 +				{ \
   1.887 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.888 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2, p3)); \
   1.889 +				} \
   1.890 +				else \
   1.891 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
   1.892 +			} \
   1.893 +		}; \
   1.894 +		struct Delegate3 : public MyDelegate \
   1.895 +		{ \
   1.896 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3) \
   1.897 +			{ \
   1.898 +				g_Inside_LeafFunc = true; \
   1.899 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3))); \
   1.900 +				g_Inside_LeafFunc = false; \
   1.901 +				if (ms_DoRecall) \
   1.902 +				{ \
   1.903 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.904 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2, p3)); \
   1.905 +				} \
   1.906 +				else \
   1.907 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
   1.908 +			} \
   1.909 +		}; \
   1.910 +		struct Delegate4 : public MyDelegate \
   1.911 +		{ \
   1.912 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3) \
   1.913 +			{ \
   1.914 +				g_Inside_LeafFunc = true; \
   1.915 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3))); \
   1.916 +				g_Inside_LeafFunc = false; \
   1.917 +				if (ms_DoRecall) \
   1.918 +				{ \
   1.919 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.920 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2, p3)); \
   1.921 +				} \
   1.922 +				else \
   1.923 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
   1.924 +			}; \
   1.925 +		}; \
   1.926 +	}; \
   1.927 +	\
   1.928 +	bool TestClass##id::ms_DoRecall = false; \
   1.929 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
   1.930 +
   1.931 +
   1.932  #define THGM_SETUP_PI3(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags) \
   1.933  	void setuppi_##id() \
   1.934  	{ \
   1.935 @@ -1424,6 +2251,197 @@
   1.936  	bool TestClass##id::ms_DoRecall = false; \
   1.937  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.938  	
   1.939 +#define THGM_MAKE_TEST4_vafmt_void(id, param1, param2, param3, param4) \
   1.940 +	struct TestClass##id; \
   1.941 +	typedef ParamState5<0, param1, param2, param3, param4, std::string > ParamState_m##id; \
   1.942 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.943 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.944 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.945 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.946 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.947 +	\
   1.948 +	struct TestClass##id \
   1.949 +	{ \
   1.950 +		static bool ms_DoRecall; \
   1.951 +		\
   1.952 +		virtual void Func(param1 p1, param2 p2, param3 p3, param4 p4, const char *fmt, ...) \
   1.953 +		{ \
   1.954 +			g_Inside_LeafFunc = true; \
   1.955 +			\
   1.956 +			char buf[9999]; \
   1.957 +			va_list ap; \
   1.958 +			va_start(ap, fmt); \
   1.959 +			vsnprintf(buf, 9998, fmt, ap); \
   1.960 +			buf[9998] = 0; \
   1.961 +			va_end(ap); \
   1.962 +			\
   1.963 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, std::string(buf)))); \
   1.964 +			g_Inside_LeafFunc = false; \
   1.965 +		} \
   1.966 +		\
   1.967 +		struct Delegate1 : public MyDelegate \
   1.968 +		{ \
   1.969 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
   1.970 +			{ \
   1.971 +				g_Inside_LeafFunc = true; \
   1.972 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
   1.973 +				g_Inside_LeafFunc = false; \
   1.974 +				if (ms_DoRecall) \
   1.975 +				{ \
   1.976 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
   1.977 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
   1.978 +				} \
   1.979 +				else \
   1.980 +					RETURN_META(MRES_IGNORED); \
   1.981 +			} \
   1.982 +		}; \
   1.983 +		struct Delegate2 : public MyDelegate \
   1.984 +		{ \
   1.985 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
   1.986 +			{ \
   1.987 +				g_Inside_LeafFunc = true; \
   1.988 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
   1.989 +				g_Inside_LeafFunc = false; \
   1.990 +				if (ms_DoRecall) \
   1.991 +				{ \
   1.992 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
   1.993 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
   1.994 +				} \
   1.995 +				else \
   1.996 +					RETURN_META(MRES_SUPERCEDE); \
   1.997 +			} \
   1.998 +		}; \
   1.999 +		struct Delegate3 : public MyDelegate \
  1.1000 +		{ \
  1.1001 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
  1.1002 +			{ \
  1.1003 +				g_Inside_LeafFunc = true; \
  1.1004 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
  1.1005 +				g_Inside_LeafFunc = false; \
  1.1006 +				if (ms_DoRecall) \
  1.1007 +				{ \
  1.1008 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
  1.1009 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
  1.1010 +				} \
  1.1011 +				else \
  1.1012 +					RETURN_META(MRES_IGNORED); \
  1.1013 +			} \
  1.1014 +		}; \
  1.1015 +		struct Delegate4 : public MyDelegate \
  1.1016 +		{ \
  1.1017 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
  1.1018 +			{ \
  1.1019 +				g_Inside_LeafFunc = true; \
  1.1020 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
  1.1021 +				g_Inside_LeafFunc = false; \
  1.1022 +				if (ms_DoRecall) \
  1.1023 +				{ \
  1.1024 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
  1.1025 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
  1.1026 +				} \
  1.1027 +				else \
  1.1028 +					RETURN_META(MRES_SUPERCEDE); \
  1.1029 +			}; \
  1.1030 +		}; \
  1.1031 +	}; \
  1.1032 +	\
  1.1033 +	bool TestClass##id::ms_DoRecall = false; \
  1.1034 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
  1.1035 +
  1.1036 +
  1.1037 +#define THGM_MAKE_TEST4_vafmt(id, ret_type, param1, param2, param3, param4) \
  1.1038 +	struct TestClass##id; \
  1.1039 +	typedef ret_type RetType##id; \
  1.1040 +	typedef ParamState4<0, param1, param2, param3, param4 > ParamState_m##id; \
  1.1041 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
  1.1042 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1043 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1044 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1045 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1046 +	\
  1.1047 +	struct TestClass##id \
  1.1048 +	{ \
  1.1049 +		static bool ms_DoRecall; \
  1.1050 +		\
  1.1051 +		virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4) \
  1.1052 +		{ \
  1.1053 +			g_Inside_LeafFunc = true; \
  1.1054 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4))); \
  1.1055 +			g_Inside_LeafFunc = false; \
  1.1056 +			\
  1.1057 +			return MakeRet< ret_type >::Do(0); \
  1.1058 +		} \
  1.1059 +		\
  1.1060 +		struct Delegate1 : public MyDelegate \
  1.1061 +		{ \
  1.1062 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4) \
  1.1063 +			{ \
  1.1064 +				g_Inside_LeafFunc = true; \
  1.1065 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4))); \
  1.1066 +				g_Inside_LeafFunc = false; \
  1.1067 +				if (ms_DoRecall) \
  1.1068 +				{ \
  1.1069 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
  1.1070 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2, p3, p4)); \
  1.1071 +				} \
  1.1072 +				else \
  1.1073 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
  1.1074 +			} \
  1.1075 +		}; \
  1.1076 +		struct Delegate2 : public MyDelegate \
  1.1077 +		{ \
  1.1078 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4) \
  1.1079 +			{ \
  1.1080 +				g_Inside_LeafFunc = true; \
  1.1081 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4))); \
  1.1082 +				g_Inside_LeafFunc = false; \
  1.1083 +				if (ms_DoRecall) \
  1.1084 +				{ \
  1.1085 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
  1.1086 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2, p3, p4)); \
  1.1087 +				} \
  1.1088 +				else \
  1.1089 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
  1.1090 +			} \
  1.1091 +		}; \
  1.1092 +		struct Delegate3 : public MyDelegate \
  1.1093 +		{ \
  1.1094 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4) \
  1.1095 +			{ \
  1.1096 +				g_Inside_LeafFunc = true; \
  1.1097 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4))); \
  1.1098 +				g_Inside_LeafFunc = false; \
  1.1099 +				if (ms_DoRecall) \
  1.1100 +				{ \
  1.1101 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
  1.1102 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2, p3, p4)); \
  1.1103 +				} \
  1.1104 +				else \
  1.1105 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
  1.1106 +			} \
  1.1107 +		}; \
  1.1108 +		struct Delegate4 : public MyDelegate \
  1.1109 +		{ \
  1.1110 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4) \
  1.1111 +			{ \
  1.1112 +				g_Inside_LeafFunc = true; \
  1.1113 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4))); \
  1.1114 +				g_Inside_LeafFunc = false; \
  1.1115 +				if (ms_DoRecall) \
  1.1116 +				{ \
  1.1117 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
  1.1118 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2, p3, p4)); \
  1.1119 +				} \
  1.1120 +				else \
  1.1121 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
  1.1122 +			}; \
  1.1123 +		}; \
  1.1124 +	}; \
  1.1125 +	\
  1.1126 +	bool TestClass##id::ms_DoRecall = false; \
  1.1127 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
  1.1128 +
  1.1129 +
  1.1130  #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) \
  1.1131  	void setuppi_##id() \
  1.1132  	{ \
  1.1133 @@ -1642,6 +2660,197 @@
  1.1134  	bool TestClass##id::ms_DoRecall = false; \
  1.1135  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
  1.1136  	
  1.1137 +#define THGM_MAKE_TEST5_vafmt_void(id, param1, param2, param3, param4, param5) \
  1.1138 +	struct TestClass##id; \
  1.1139 +	typedef ParamState6<0, param1, param2, param3, param4, param5, std::string > ParamState_m##id; \
  1.1140 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
  1.1141 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1142 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1143 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1144 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1145 +	\
  1.1146 +	struct TestClass##id \
  1.1147 +	{ \
  1.1148 +		static bool ms_DoRecall; \
  1.1149 +		\
  1.1150 +		virtual void Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *fmt, ...) \
  1.1151 +		{ \
  1.1152 +			g_Inside_LeafFunc = true; \
  1.1153 +			\
  1.1154 +			char buf[9999]; \
  1.1155 +			va_list ap; \
  1.1156 +			va_start(ap, fmt); \
  1.1157 +			vsnprintf(buf, 9998, fmt, ap); \
  1.1158 +			buf[9998] = 0; \
  1.1159 +			va_end(ap); \
  1.1160 +			\
  1.1161 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5, std::string(buf)))); \
  1.1162 +			g_Inside_LeafFunc = false; \
  1.1163 +		} \
  1.1164 +		\
  1.1165 +		struct Delegate1 : public MyDelegate \
  1.1166 +		{ \
  1.1167 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
  1.1168 +			{ \
  1.1169 +				g_Inside_LeafFunc = true; \
  1.1170 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
  1.1171 +				g_Inside_LeafFunc = false; \
  1.1172 +				if (ms_DoRecall) \
  1.1173 +				{ \
  1.1174 +					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); \
  1.1175 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
  1.1176 +				} \
  1.1177 +				else \
  1.1178 +					RETURN_META(MRES_IGNORED); \
  1.1179 +			} \
  1.1180 +		}; \
  1.1181 +		struct Delegate2 : public MyDelegate \
  1.1182 +		{ \
  1.1183 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
  1.1184 +			{ \
  1.1185 +				g_Inside_LeafFunc = true; \
  1.1186 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
  1.1187 +				g_Inside_LeafFunc = false; \
  1.1188 +				if (ms_DoRecall) \
  1.1189 +				{ \
  1.1190 +					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); \
  1.1191 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
  1.1192 +				} \
  1.1193 +				else \
  1.1194 +					RETURN_META(MRES_SUPERCEDE); \
  1.1195 +			} \
  1.1196 +		}; \
  1.1197 +		struct Delegate3 : public MyDelegate \
  1.1198 +		{ \
  1.1199 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
  1.1200 +			{ \
  1.1201 +				g_Inside_LeafFunc = true; \
  1.1202 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
  1.1203 +				g_Inside_LeafFunc = false; \
  1.1204 +				if (ms_DoRecall) \
  1.1205 +				{ \
  1.1206 +					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); \
  1.1207 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
  1.1208 +				} \
  1.1209 +				else \
  1.1210 +					RETURN_META(MRES_IGNORED); \
  1.1211 +			} \
  1.1212 +		}; \
  1.1213 +		struct Delegate4 : public MyDelegate \
  1.1214 +		{ \
  1.1215 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
  1.1216 +			{ \
  1.1217 +				g_Inside_LeafFunc = true; \
  1.1218 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
  1.1219 +				g_Inside_LeafFunc = false; \
  1.1220 +				if (ms_DoRecall) \
  1.1221 +				{ \
  1.1222 +					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); \
  1.1223 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
  1.1224 +				} \
  1.1225 +				else \
  1.1226 +					RETURN_META(MRES_SUPERCEDE); \
  1.1227 +			}; \
  1.1228 +		}; \
  1.1229 +	}; \
  1.1230 +	\
  1.1231 +	bool TestClass##id::ms_DoRecall = false; \
  1.1232 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
  1.1233 +
  1.1234 +
  1.1235 +#define THGM_MAKE_TEST5_vafmt(id, ret_type, param1, param2, param3, param4, param5) \
  1.1236 +	struct TestClass##id; \
  1.1237 +	typedef ret_type RetType##id; \
  1.1238 +	typedef ParamState5<0, param1, param2, param3, param4, param5 > ParamState_m##id; \
  1.1239 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
  1.1240 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1241 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1242 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1243 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1244 +	\
  1.1245 +	struct TestClass##id \
  1.1246 +	{ \
  1.1247 +		static bool ms_DoRecall; \
  1.1248 +		\
  1.1249 +		virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
  1.1250 +		{ \
  1.1251 +			g_Inside_LeafFunc = true; \
  1.1252 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5))); \
  1.1253 +			g_Inside_LeafFunc = false; \
  1.1254 +			\
  1.1255 +			return MakeRet< ret_type >::Do(0); \
  1.1256 +		} \
  1.1257 +		\
  1.1258 +		struct Delegate1 : public MyDelegate \
  1.1259 +		{ \
  1.1260 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
  1.1261 +			{ \
  1.1262 +				g_Inside_LeafFunc = true; \
  1.1263 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5))); \
  1.1264 +				g_Inside_LeafFunc = false; \
  1.1265 +				if (ms_DoRecall) \
  1.1266 +				{ \
  1.1267 +					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); \
  1.1268 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2, p3, p4, p5)); \
  1.1269 +				} \
  1.1270 +				else \
  1.1271 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
  1.1272 +			} \
  1.1273 +		}; \
  1.1274 +		struct Delegate2 : public MyDelegate \
  1.1275 +		{ \
  1.1276 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
  1.1277 +			{ \
  1.1278 +				g_Inside_LeafFunc = true; \
  1.1279 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5))); \
  1.1280 +				g_Inside_LeafFunc = false; \
  1.1281 +				if (ms_DoRecall) \
  1.1282 +				{ \
  1.1283 +					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); \
  1.1284 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2, p3, p4, p5)); \
  1.1285 +				} \
  1.1286 +				else \
  1.1287 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
  1.1288 +			} \
  1.1289 +		}; \
  1.1290 +		struct Delegate3 : public MyDelegate \
  1.1291 +		{ \
  1.1292 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
  1.1293 +			{ \
  1.1294 +				g_Inside_LeafFunc = true; \
  1.1295 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5))); \
  1.1296 +				g_Inside_LeafFunc = false; \
  1.1297 +				if (ms_DoRecall) \
  1.1298 +				{ \
  1.1299 +					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); \
  1.1300 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2, p3, p4, p5)); \
  1.1301 +				} \
  1.1302 +				else \
  1.1303 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
  1.1304 +			} \
  1.1305 +		}; \
  1.1306 +		struct Delegate4 : public MyDelegate \
  1.1307 +		{ \
  1.1308 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5) \
  1.1309 +			{ \
  1.1310 +				g_Inside_LeafFunc = true; \
  1.1311 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5))); \
  1.1312 +				g_Inside_LeafFunc = false; \
  1.1313 +				if (ms_DoRecall) \
  1.1314 +				{ \
  1.1315 +					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); \
  1.1316 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2, p3, p4, p5)); \
  1.1317 +				} \
  1.1318 +				else \
  1.1319 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
  1.1320 +			}; \
  1.1321 +		}; \
  1.1322 +	}; \
  1.1323 +	\
  1.1324 +	bool TestClass##id::ms_DoRecall = false; \
  1.1325 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
  1.1326 +
  1.1327 +
  1.1328  #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) \
  1.1329  	void setuppi_##id() \
  1.1330  	{ \
  1.1331 @@ -1867,6 +3076,197 @@
  1.1332  	bool TestClass##id::ms_DoRecall = false; \
  1.1333  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
  1.1334  	
  1.1335 +#define THGM_MAKE_TEST6_vafmt_void(id, param1, param2, param3, param4, param5, param6) \
  1.1336 +	struct TestClass##id; \
  1.1337 +	typedef ParamState7<0, param1, param2, param3, param4, param5, param6, std::string > ParamState_m##id; \
  1.1338 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
  1.1339 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1340 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1341 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1342 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1343 +	\
  1.1344 +	struct TestClass##id \
  1.1345 +	{ \
  1.1346 +		static bool ms_DoRecall; \
  1.1347 +		\
  1.1348 +		virtual void Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *fmt, ...) \
  1.1349 +		{ \
  1.1350 +			g_Inside_LeafFunc = true; \
  1.1351 +			\
  1.1352 +			char buf[9999]; \
  1.1353 +			va_list ap; \
  1.1354 +			va_start(ap, fmt); \
  1.1355 +			vsnprintf(buf, 9998, fmt, ap); \
  1.1356 +			buf[9998] = 0; \
  1.1357 +			va_end(ap); \
  1.1358 +			\
  1.1359 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5, p6, std::string(buf)))); \
  1.1360 +			g_Inside_LeafFunc = false; \
  1.1361 +		} \
  1.1362 +		\
  1.1363 +		struct Delegate1 : public MyDelegate \
  1.1364 +		{ \
  1.1365 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
  1.1366 +			{ \
  1.1367 +				g_Inside_LeafFunc = true; \
  1.1368 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
  1.1369 +				g_Inside_LeafFunc = false; \
  1.1370 +				if (ms_DoRecall) \
  1.1371 +				{ \
  1.1372 +					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); \
  1.1373 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
  1.1374 +				} \
  1.1375 +				else \
  1.1376 +					RETURN_META(MRES_IGNORED); \
  1.1377 +			} \
  1.1378 +		}; \
  1.1379 +		struct Delegate2 : public MyDelegate \
  1.1380 +		{ \
  1.1381 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
  1.1382 +			{ \
  1.1383 +				g_Inside_LeafFunc = true; \
  1.1384 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
  1.1385 +				g_Inside_LeafFunc = false; \
  1.1386 +				if (ms_DoRecall) \
  1.1387 +				{ \
  1.1388 +					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); \
  1.1389 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
  1.1390 +				} \
  1.1391 +				else \
  1.1392 +					RETURN_META(MRES_SUPERCEDE); \
  1.1393 +			} \
  1.1394 +		}; \
  1.1395 +		struct Delegate3 : public MyDelegate \
  1.1396 +		{ \
  1.1397 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
  1.1398 +			{ \
  1.1399 +				g_Inside_LeafFunc = true; \
  1.1400 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
  1.1401 +				g_Inside_LeafFunc = false; \
  1.1402 +				if (ms_DoRecall) \
  1.1403 +				{ \
  1.1404 +					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); \
  1.1405 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
  1.1406 +				} \
  1.1407 +				else \
  1.1408 +					RETURN_META(MRES_IGNORED); \
  1.1409 +			} \
  1.1410 +		}; \
  1.1411 +		struct Delegate4 : public MyDelegate \
  1.1412 +		{ \
  1.1413 +			virtual void Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
  1.1414 +			{ \
  1.1415 +				g_Inside_LeafFunc = true; \
  1.1416 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
  1.1417 +				g_Inside_LeafFunc = false; \
  1.1418 +				if (ms_DoRecall) \
  1.1419 +				{ \
  1.1420 +					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); \
  1.1421 +					RETURN_META_NEWPARAMS(MRES_IGNORED, &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
  1.1422 +				} \
  1.1423 +				else \
  1.1424 +					RETURN_META(MRES_SUPERCEDE); \
  1.1425 +			}; \
  1.1426 +		}; \
  1.1427 +	}; \
  1.1428 +	\
  1.1429 +	bool TestClass##id::ms_DoRecall = false; \
  1.1430 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
  1.1431 +
  1.1432 +
  1.1433 +#define THGM_MAKE_TEST6_vafmt(id, ret_type, param1, param2, param3, param4, param5, param6) \
  1.1434 +	struct TestClass##id; \
  1.1435 +	typedef ret_type RetType##id; \
  1.1436 +	typedef ParamState6<0, param1, param2, param3, param4, param5, param6 > ParamState_m##id; \
  1.1437 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
  1.1438 +	MAKE_STATE_3(State_Deleg1_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1439 +	MAKE_STATE_3(State_Deleg2_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1440 +	MAKE_STATE_3(State_Deleg3_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1441 +	MAKE_STATE_3(State_Deleg4_##id, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
  1.1442 +	\
  1.1443 +	struct TestClass##id \
  1.1444 +	{ \
  1.1445 +		static bool ms_DoRecall; \
  1.1446 +		\
  1.1447 +		virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
  1.1448 +		{ \
  1.1449 +			g_Inside_LeafFunc = true; \
  1.1450 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
  1.1451 +			g_Inside_LeafFunc = false; \
  1.1452 +			\
  1.1453 +			return MakeRet< ret_type >::Do(0); \
  1.1454 +		} \
  1.1455 +		\
  1.1456 +		struct Delegate1 : public MyDelegate \
  1.1457 +		{ \
  1.1458 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
  1.1459 +			{ \
  1.1460 +				g_Inside_LeafFunc = true; \
  1.1461 +				ADD_STATE(State_Deleg1_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
  1.1462 +				g_Inside_LeafFunc = false; \
  1.1463 +				if (ms_DoRecall) \
  1.1464 +				{ \
  1.1465 +					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); \
  1.1466 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(1), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6)); \
  1.1467 +				} \
  1.1468 +				else \
  1.1469 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(1)); \
  1.1470 +			} \
  1.1471 +		}; \
  1.1472 +		struct Delegate2 : public MyDelegate \
  1.1473 +		{ \
  1.1474 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
  1.1475 +			{ \
  1.1476 +				g_Inside_LeafFunc = true; \
  1.1477 +				ADD_STATE(State_Deleg2_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
  1.1478 +				g_Inside_LeafFunc = false; \
  1.1479 +				if (ms_DoRecall) \
  1.1480 +				{ \
  1.1481 +					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); \
  1.1482 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6)); \
  1.1483 +				} \
  1.1484 +				else \
  1.1485 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(2)); \
  1.1486 +			} \
  1.1487 +		}; \
  1.1488 +		struct Delegate3 : public MyDelegate \
  1.1489 +		{ \
  1.1490 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
  1.1491 +			{ \
  1.1492 +				g_Inside_LeafFunc = true; \
  1.1493 +				ADD_STATE(State_Deleg3_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
  1.1494 +				g_Inside_LeafFunc = false; \
  1.1495 +				if (ms_DoRecall) \
  1.1496 +				{ \
  1.1497 +					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); \
  1.1498 +					RETURN_META_VALUE_NEWPARAMS(MRES_IGNORED, MakeRet< ret_type >::Do(3), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6)); \
  1.1499 +				} \
  1.1500 +				else \
  1.1501 +					RETURN_META_VALUE(MRES_IGNORED, MakeRet< ret_type >::Do(3)); \
  1.1502 +			} \
  1.1503 +		}; \
  1.1504 +		struct Delegate4 : public MyDelegate \
  1.1505 +		{ \
  1.1506 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6) \
  1.1507 +			{ \
  1.1508 +				g_Inside_LeafFunc = true; \
  1.1509 +				ADD_STATE(State_Deleg4_##id(META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6))); \
  1.1510 +				g_Inside_LeafFunc = false; \
  1.1511 +				if (ms_DoRecall) \
  1.1512 +				{ \
  1.1513 +					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); \
  1.1514 +					RETURN_META_VALUE_NEWPARAMS(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6)); \
  1.1515 +				} \
  1.1516 +				else \
  1.1517 +					RETURN_META_VALUE(MRES_SUPERCEDE, MakeRet< ret_type >::Do(4)); \
  1.1518 +			}; \
  1.1519 +		}; \
  1.1520 +	}; \
  1.1521 +	\
  1.1522 +	bool TestClass##id::ms_DoRecall = false; \
  1.1523 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall)
  1.1524 +
  1.1525 +
  1.1526  #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) \
  1.1527  	void setuppi_##id() \
  1.1528  	{ \