source: trunk/include/dbgwrap.h@ 8384

Last change on this file since 8384 was 7922, checked in by sandervl, 24 years ago

updates

File size: 27.3 KB
Line 
1#ifndef __DBBWRAP_H__
2#define __DBBWRAP_H__
3
4#include <odinwrap.h>
5
6typedef DWORD (* WIN32API DBG_WINPROC0)();
7typedef DWORD (* WIN32API DBG_WINPROC4)(DWORD);
8typedef DWORD (* WIN32API DBG_WINPROC4_NORET)(DWORD);
9typedef DWORD (* WIN32API DBG_WINPROC8)(DWORD, DWORD);
10typedef DWORD (* WIN32API DBG_WINPROC12)(DWORD, DWORD, DWORD);
11typedef DWORD (* WIN32API DBG_WINPROC16)(DWORD, DWORD, DWORD, DWORD);
12typedef DWORD (* WIN32API DBG_WINPROC20)(DWORD, DWORD, DWORD, DWORD, DWORD);
13typedef DWORD (* WIN32API DBG_WINPROC24)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
14typedef DWORD (* WIN32API DBG_WINPROC28)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
15typedef DWORD (* WIN32API DBG_WINPROC32)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
16typedef DWORD (* WIN32API DBG_WINPROC36)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
17typedef DWORD (* WIN32API DBG_WINPROC40)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
18typedef DWORD (* WIN32API DBG_WINPROC44)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
19typedef DWORD (* WIN32API DBG_WINPROC48)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
20typedef DWORD (* WIN32API DBG_WINPROC52)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
21
22#define DEBUGWRAP0(a) \
23DWORD WIN32API Dbg##a() \
24{ \
25 DWORD ret; \
26 dprintf((DBGWRAP_MODULE": %s", #a)); \
27 dbg_ThreadPushCall(#a); \
28 ret = (DWORD)a(); \
29 dbg_ThreadPopCall(); \
30 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
31 return ret; \
32}
33
34#define DEBUGWRAP0_NORET(a) \
35void WIN32API Dbg##a() \
36{ \
37 DWORD ret; \
38 dprintf((DBGWRAP_MODULE": %s", #a)); \
39 dbg_ThreadPushCall(#a); \
40 a(); \
41 dbg_ThreadPopCall(); \
42}
43
44#define DEBUGWRAP4(a) \
45DWORD WIN32API Dbg##a(DWORD arg1) \
46{ \
47 DWORD ret; \
48 dprintf((DBGWRAP_MODULE": %s %x", #a, arg1)); \
49 dbg_ThreadPushCall(#a); \
50 ret = ((DBG_WINPROC4)a)(arg1); \
51 dbg_ThreadPopCall(); \
52 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
53 return ret; \
54}
55
56#define DEBUGWRAP4_NORET(a) \
57void WIN32API Dbg##a(DWORD arg1) \
58{ \
59 dprintf((DBGWRAP_MODULE": %s %x", #a, arg1)); \
60 dbg_ThreadPushCall(#a); \
61 ((DBG_WINPROC4_NORET)a)(arg1); \
62 dbg_ThreadPopCall(); \
63}
64
65#define DEBUGWRAP8(a) \
66DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2) \
67{ \
68 DWORD ret; \
69 dprintf((DBGWRAP_MODULE": %s %x %x", #a, arg1, arg2)); \
70 dbg_ThreadPushCall(#a); \
71 ret = ((DBG_WINPROC8)a)(arg1, arg2); \
72 dbg_ThreadPopCall(); \
73 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
74 return ret; \
75}
76
77#define DEBUGWRAP12(a) \
78DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3) \
79{ \
80 DWORD ret; \
81 dprintf((DBGWRAP_MODULE": %s %x %x %x", #a, arg1, arg2, arg3)); \
82 dbg_ThreadPushCall(#a); \
83 ret = ((DBG_WINPROC12)a)(arg1, arg2, arg3); \
84 dbg_ThreadPopCall(); \
85 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
86 return ret; \
87}
88
89#define DEBUGWRAP16(a) \
90DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4) \
91{ \
92 DWORD ret; \
93 dprintf((DBGWRAP_MODULE": %s %x %x %x %x", #a, arg1, arg2, arg3, arg4)); \
94 dbg_ThreadPushCall(#a); \
95 ret = ((DBG_WINPROC16)a)(arg1, arg2, arg3, arg4); \
96 dbg_ThreadPopCall(); \
97 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
98 return ret; \
99}
100
101#define DEBUGWRAP20(a) \
102DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5) \
103{ \
104 DWORD ret; \
105 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5)); \
106 dbg_ThreadPushCall(#a); \
107 ret = ((DBG_WINPROC20)a)(arg1, arg2, arg3, arg4, arg5); \
108 dbg_ThreadPopCall(); \
109 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
110 return ret; \
111}
112
113#define DEBUGWRAP24(a) \
114DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6) \
115{ \
116 DWORD ret; \
117 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg6)); \
118 dbg_ThreadPushCall(#a); \
119 ret = ((DBG_WINPROC24)a)(arg1, arg2, arg3, arg4, arg5, arg6); \
120 dbg_ThreadPopCall(); \
121 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
122 return ret; \
123}
124
125#define DEBUGWRAP28(a) \
126DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7) \
127{ \
128 DWORD ret; \
129 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7)); \
130 dbg_ThreadPushCall(#a); \
131 ret = ((DBG_WINPROC28)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
132 dbg_ThreadPopCall(); \
133 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
134 return ret; \
135}
136
137#define DEBUGWRAP32(a) \
138DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8) \
139{ \
140 DWORD ret; \
141 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x %x ", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8)); \
142 dbg_ThreadPushCall(#a); \
143 ret = ((DBG_WINPROC32)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
144 dbg_ThreadPopCall(); \
145 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
146 return ret; \
147}
148
149#define DEBUGWRAP36(a) \
150DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9) \
151{ \
152 DWORD ret; \
153 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9)); \
154 dbg_ThreadPushCall(#a); \
155 ret = ((DBG_WINPROC36)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
156 dbg_ThreadPopCall(); \
157 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
158 return ret; \
159}
160
161#define DEBUGWRAP40(a) \
162DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10) \
163{ \
164 DWORD ret; \
165 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10)); \
166 dbg_ThreadPushCall(#a); \
167 ret = ((DBG_WINPROC40)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
168 dbg_ThreadPopCall(); \
169 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
170 return ret; \
171}
172
173#define DEBUGWRAP44(a) \
174DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11) \
175{ \
176 DWORD ret; \
177 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11)); \
178 dbg_ThreadPushCall(#a); \
179 ret = ((DBG_WINPROC44)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
180 dbg_ThreadPopCall(); \
181 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
182 return ret; \
183}
184
185#define DEBUGWRAP48(a) \
186DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12) \
187{ \
188 DWORD ret; \
189 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11, arg12)); \
190 dbg_ThreadPushCall(#a); \
191 ret = ((DBG_WINPROC48)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
192 dbg_ThreadPopCall(); \
193 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
194 return ret; \
195}
196
197#define DEBUGWRAP52(a) \
198DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13) \
199{ \
200 DWORD ret; \
201 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11, arg12, arg13)); \
202 dbg_ThreadPushCall(#a); \
203 ret = ((DBG_WINPROC52)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
204 dbg_ThreadPopCall(); \
205 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
206 return ret; \
207}
208
209//level 2 logging
210
211#define DEBUGWRAP_LVL2_0(a) \
212DWORD WIN32API Dbg##a() \
213{ \
214 DWORD ret; \
215 dprintf2((DBGWRAP_MODULE": %s", #a)); \
216 dbg_ThreadPushCall(#a); \
217 ret = ((DBG_WINPROC0)a)(); \
218 dbg_ThreadPopCall(); \
219 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
220 return ret; \
221}
222
223#define DEBUGWRAP_LVL2_4(a) \
224DWORD WIN32API Dbg##a(DWORD arg1) \
225{ \
226 DWORD ret; \
227 dprintf2((DBGWRAP_MODULE": %s %x", #a, arg1)); \
228 dbg_ThreadPushCall(#a); \
229 ret = ((DBG_WINPROC4)a)(arg1); \
230 dbg_ThreadPopCall(); \
231 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
232 return ret; \
233}
234
235#define DEBUGWRAP_LVL2_8(a) \
236DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2) \
237{ \
238 DWORD ret; \
239 dprintf2((DBGWRAP_MODULE": %s %x %x", #a, arg1, arg2)); \
240 dbg_ThreadPushCall(#a); \
241 ret = ((DBG_WINPROC8)a)(arg1, arg2); \
242 dbg_ThreadPopCall(); \
243 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
244 return ret; \
245}
246
247#define DEBUGWRAP_LVL2_12(a) \
248DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3) \
249{ \
250 DWORD ret; \
251 dprintf2((DBGWRAP_MODULE": %s %x %x %x", #a, arg1, arg2, arg3)); \
252 dbg_ThreadPushCall(#a); \
253 ret = ((DBG_WINPROC12)a)(arg1, arg2, arg3); \
254 dbg_ThreadPopCall(); \
255 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
256 return ret; \
257}
258
259#define DEBUGWRAP_LVL2_16(a) \
260DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4) \
261{ \
262 DWORD ret; \
263 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x", #a, arg1, arg2, arg3, arg4)); \
264 dbg_ThreadPushCall(#a); \
265 ret = ((DBG_WINPROC16)a)(arg1, arg2, arg3, arg4); \
266 dbg_ThreadPopCall(); \
267 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
268 return ret; \
269}
270
271#define DEBUGWRAP_LVL2_20(a) \
272DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5) \
273{ \
274 DWORD ret; \
275 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5)); \
276 dbg_ThreadPushCall(#a); \
277 ret = ((DBG_WINPROC20)a)(arg1, arg2, arg3, arg4, arg5); \
278 dbg_ThreadPopCall(); \
279 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
280 return ret; \
281}
282
283#define DEBUGWRAP_LVL2_24(a) \
284DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6) \
285{ \
286 DWORD ret; \
287 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg6)); \
288 dbg_ThreadPushCall(#a); \
289 ret = ((DBG_WINPROC24)a)(arg1, arg2, arg3, arg4, arg5, arg6); \
290 dbg_ThreadPopCall(); \
291 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
292 return ret; \
293}
294
295#define DEBUGWRAP_LVL2_28(a) \
296DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7) \
297{ \
298 DWORD ret; \
299 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7)); \
300 dbg_ThreadPushCall(#a); \
301 ret = ((DBG_WINPROC28)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
302 dbg_ThreadPopCall(); \
303 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
304 return ret; \
305}
306
307#define DEBUGWRAP_LVL2_32(a) \
308DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8) \
309{ \
310 DWORD ret; \
311 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8)); \
312 dbg_ThreadPushCall(#a); \
313 ret = ((DBG_WINPROC32)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
314 dbg_ThreadPopCall(); \
315 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
316 return ret; \
317}
318
319#define DEBUGWRAP_LVL2_36(a) \
320DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9) \
321{ \
322 DWORD ret; \
323 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9)); \
324 dbg_ThreadPushCall(#a); \
325 ret = ((DBG_WINPROC36)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
326 dbg_ThreadPopCall(); \
327 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
328 return ret; \
329}
330
331#define DEBUGWRAP_LVL2_40(a) \
332DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10) \
333{ \
334 DWORD ret; \
335 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10)); \
336 dbg_ThreadPushCall(#a); \
337 ret = ((DBG_WINPROC40)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
338 dbg_ThreadPopCall(); \
339 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
340 return ret; \
341}
342
343#define DEBUGWRAP_LVL2_44(a) \
344DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11) \
345{ \
346 DWORD ret; \
347 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11)); \
348 dbg_ThreadPushCall(#a); \
349 ret = ((DBG_WINPROC44)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
350 dbg_ThreadPopCall(); \
351 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
352 return ret; \
353}
354
355#define DEBUGWRAP_LVL2_48(a) \
356DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12) \
357{ \
358 DWORD ret; \
359 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11, arg12)); \
360 dbg_ThreadPushCall(#a); \
361 ret = ((DBG_WINPROC48)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
362 dbg_ThreadPopCall(); \
363 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
364 return ret; \
365}
366
367#define DEBUGWRAP_LVL2_52(a) \
368DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13) \
369{ \
370 DWORD ret; \
371 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11, arg12, arg13)); \
372 dbg_ThreadPushCall(#a); \
373 ret = ((DBG_WINPROC52)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
374 dbg_ThreadPopCall(); \
375 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
376 return ret; \
377}
378
379
380//level 1 logging without function definitions
381
382#define NODEF_DEBUGWRAP0(a) \
383DWORD WIN32API a(); \
384DWORD WIN32API Dbg##a() \
385{ \
386 DWORD ret; \
387 dprintf((DBGWRAP_MODULE": %s", #a)); \
388 dbg_ThreadPushCall(#a); \
389 ret = (DWORD)a(); \
390 dbg_ThreadPopCall(); \
391 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
392 return ret; \
393}
394
395#define NODEF_DEBUGWRAP0_NORET(a) \
396void WIN32API a(); \
397void WIN32API Dbg##a() \
398{ \
399 DWORD ret; \
400 dprintf((DBGWRAP_MODULE": %s", #a)); \
401 dbg_ThreadPushCall(#a); \
402 a(); \
403 dbg_ThreadPopCall(); \
404}
405
406#define NODEF_DEBUGWRAP4(a) \
407DWORD WIN32API a(DWORD arg1); \
408DWORD WIN32API Dbg##a(DWORD arg1) \
409{ \
410 DWORD ret; \
411 dprintf((DBGWRAP_MODULE": %s %x", #a, arg1)); \
412 dbg_ThreadPushCall(#a); \
413 ret = ((DBG_WINPROC4)a)(arg1); \
414 dbg_ThreadPopCall(); \
415 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
416 return ret; \
417}
418
419#define NODEF_DEBUGWRAP4_NORET(a) \
420void WIN32API a(DWORD arg1); \
421void WIN32API Dbg##a(DWORD arg1) \
422{ \
423 dprintf((DBGWRAP_MODULE": %s %x", #a, arg1)); \
424 dbg_ThreadPushCall(#a); \
425 ((DBG_WINPROC4_NORET)a)(arg1); \
426 dbg_ThreadPopCall(); \
427}
428
429#define NODEF_DEBUGWRAP8(a) \
430DWORD WIN32API a(DWORD arg1, DWORD arg2); \
431DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2) \
432{ \
433 DWORD ret; \
434 dprintf((DBGWRAP_MODULE": %s %x %x", #a, arg1, arg2)); \
435 dbg_ThreadPushCall(#a); \
436 ret = ((DBG_WINPROC8)a)(arg1, arg2); \
437 dbg_ThreadPopCall(); \
438 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
439 return ret; \
440}
441
442#define NODEF_DEBUGWRAP12(a) \
443DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3); \
444DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3) \
445{ \
446 DWORD ret; \
447 dprintf((DBGWRAP_MODULE": %s %x %x %x", #a, arg1, arg2, arg3)); \
448 dbg_ThreadPushCall(#a); \
449 ret = ((DBG_WINPROC12)a)(arg1, arg2, arg3); \
450 dbg_ThreadPopCall(); \
451 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
452 return ret; \
453}
454
455#define NODEF_DEBUGWRAP16(a) \
456DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4); \
457DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4) \
458{ \
459 DWORD ret; \
460 dprintf((DBGWRAP_MODULE": %s %x %x %x %x", #a, arg1, arg2, arg3, arg4)); \
461 dbg_ThreadPushCall(#a); \
462 ret = ((DBG_WINPROC16)a)(arg1, arg2, arg3, arg4); \
463 dbg_ThreadPopCall(); \
464 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
465 return ret; \
466}
467
468#define NODEF_DEBUGWRAP20(a) \
469DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5); \
470DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5) \
471{ \
472 DWORD ret; \
473 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5)); \
474 dbg_ThreadPushCall(#a); \
475 ret = ((DBG_WINPROC20)a)(arg1, arg2, arg3, arg4, arg5); \
476 dbg_ThreadPopCall(); \
477 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
478 return ret; \
479}
480
481#define NODEF_DEBUGWRAP24(a) \
482DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6); \
483DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6) \
484{ \
485 DWORD ret; \
486 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg6)); \
487 dbg_ThreadPushCall(#a); \
488 ret = ((DBG_WINPROC24)a)(arg1, arg2, arg3, arg4, arg5, arg6); \
489 dbg_ThreadPopCall(); \
490 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
491 return ret; \
492}
493
494#define NODEF_DEBUGWRAP28(a) \
495DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7); \
496DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7) \
497{ \
498 DWORD ret; \
499 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7)); \
500 dbg_ThreadPushCall(#a); \
501 ret = ((DBG_WINPROC28)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
502 dbg_ThreadPopCall(); \
503 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
504 return ret; \
505}
506
507#define NODEF_DEBUGWRAP32(a) \
508DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8); \
509DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8) \
510{ \
511 DWORD ret; \
512 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8)); \
513 dbg_ThreadPushCall(#a); \
514 ret = ((DBG_WINPROC32)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
515 dbg_ThreadPopCall(); \
516 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
517 return ret; \
518}
519
520#define NODEF_DEBUGWRAP36(a) \
521DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9); \
522DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9) \
523{ \
524 DWORD ret; \
525 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9)); \
526 dbg_ThreadPushCall(#a); \
527 ret = ((DBG_WINPROC36)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
528 dbg_ThreadPopCall(); \
529 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
530 return ret; \
531}
532
533#define NODEF_DEBUGWRAP40(a) \
534DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10); \
535DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10) \
536{ \
537 DWORD ret; \
538 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10)); \
539 dbg_ThreadPushCall(#a); \
540 ret = ((DBG_WINPROC40)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
541 dbg_ThreadPopCall(); \
542 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
543 return ret; \
544}
545
546#define NODEF_DEBUGWRAP44(a) \
547DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11); \
548DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11) \
549{ \
550 DWORD ret; \
551 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11)); \
552 dbg_ThreadPushCall(#a); \
553 ret = ((DBG_WINPROC44)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
554 dbg_ThreadPopCall(); \
555 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
556 return ret; \
557}
558
559#define NODEF_DEBUGWRAP48(a) \
560DWORD WIN32API a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12); \
561DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12) \
562{ \
563 DWORD ret; \
564 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11, arg12)); \
565 dbg_ThreadPushCall(#a); \
566 ret = ((DBG_WINPROC48)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
567 dbg_ThreadPopCall(); \
568 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
569 return ret; \
570}
571
572#define NODEF_DEBUGWRAP52(a) \
573DWORD WIN32API #a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13); \
574DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10, DWORD arg11, DWORD arg12, DWORD arg13) \
575{ \
576 DWORD ret; \
577 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x %x %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11, arg12, arg13)); \
578 dbg_ThreadPushCall(#a); \
579 ret = ((DBG_WINPROC52)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \
580 dbg_ThreadPopCall(); \
581 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
582 return ret; \
583}
584
585#endif
586
Note: See TracBrowser for help on using the repository browser.