source: trunk/src/kernel32/dbgwrap.h@ 7848

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

log updates

File size: 15.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_WINPROC8)(DWORD, DWORD);
9typedef DWORD (* WIN32API DBG_WINPROC12)(DWORD, DWORD, DWORD);
10typedef DWORD (* WIN32API DBG_WINPROC16)(DWORD, DWORD, DWORD, DWORD);
11typedef DWORD (* WIN32API DBG_WINPROC20)(DWORD, DWORD, DWORD, DWORD, DWORD);
12typedef DWORD (* WIN32API DBG_WINPROC24)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
13typedef DWORD (* WIN32API DBG_WINPROC28)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
14typedef DWORD (* WIN32API DBG_WINPROC32)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
15typedef DWORD (* WIN32API DBG_WINPROC36)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
16typedef DWORD (* WIN32API DBG_WINPROC40)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
17typedef DWORD (* WIN32API DBG_WINPROC44)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
18typedef DWORD (* WIN32API DBG_WINPROC48)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
19
20#define DEBUGWRAP0(a) \
21DWORD WIN32API Dbg##a() \
22{ \
23 DWORD ret; \
24 dprintf((DBGWRAP_MODULE": %s", #a)); \
25 dbg_ThreadPushCall(#a); \
26 ret = ((DBG_WINPROC0)a)(); \
27 dbg_ThreadPopCall(); \
28 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
29 return ret; \
30}
31
32#define DEBUGWRAP4(a) \
33DWORD WIN32API Dbg##a(DWORD arg1) \
34{ \
35 DWORD ret; \
36 dprintf((DBGWRAP_MODULE": %s %x", #a, arg1)); \
37 dbg_ThreadPushCall(#a); \
38 ret = ((DBG_WINPROC4)a)(arg1); \
39 dbg_ThreadPopCall(); \
40 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
41 return ret; \
42}
43
44#define DEBUGWRAP8(a) \
45DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2) \
46{ \
47 DWORD ret; \
48 dprintf((DBGWRAP_MODULE": %s %x %x", #a, arg1, arg2)); \
49 dbg_ThreadPushCall(#a); \
50 ret = ((DBG_WINPROC8)a)(arg1, arg2); \
51 dbg_ThreadPopCall(); \
52 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
53 return ret; \
54}
55
56#define DEBUGWRAP12(a) \
57DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3) \
58{ \
59 DWORD ret; \
60 dprintf((DBGWRAP_MODULE": %s %x %x %x", #a, arg1, arg2, arg3)); \
61 dbg_ThreadPushCall(#a); \
62 ret = ((DBG_WINPROC12)a)(arg1, arg2, arg3); \
63 dbg_ThreadPopCall(); \
64 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
65 return ret; \
66}
67
68#define DEBUGWRAP16(a) \
69DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4) \
70{ \
71 DWORD ret; \
72 dprintf((DBGWRAP_MODULE": %s %x %x %x %x", #a, arg1, arg2, arg3, arg4)); \
73 dbg_ThreadPushCall(#a); \
74 ret = ((DBG_WINPROC16)a)(arg1, arg2, arg3, arg4); \
75 dbg_ThreadPopCall(); \
76 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
77 return ret; \
78}
79
80#define DEBUGWRAP20(a) \
81DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5) \
82{ \
83 DWORD ret; \
84 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5)); \
85 dbg_ThreadPushCall(#a); \
86 ret = ((DBG_WINPROC20)a)(arg1, arg2, arg3, arg4, arg5); \
87 dbg_ThreadPopCall(); \
88 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
89 return ret; \
90}
91
92#define DEBUGWRAP24(a) \
93DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6) \
94{ \
95 DWORD ret; \
96 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg6)); \
97 dbg_ThreadPushCall(#a); \
98 ret = ((DBG_WINPROC24)a)(arg1, arg2, arg3, arg4, arg5, arg6); \
99 dbg_ThreadPopCall(); \
100 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
101 return ret; \
102}
103
104#define DEBUGWRAP28(a) \
105DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7) \
106{ \
107 DWORD ret; \
108 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7)); \
109 dbg_ThreadPushCall(#a); \
110 ret = ((DBG_WINPROC28)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
111 dbg_ThreadPopCall(); \
112 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
113 return ret; \
114}
115
116#define DEBUGWRAP32(a) \
117DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8) \
118{ \
119 DWORD ret; \
120 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8)); \
121 dbg_ThreadPushCall(#a); \
122 ret = ((DBG_WINPROC32)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
123 dbg_ThreadPopCall(); \
124 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
125 return ret; \
126}
127
128#define DEBUGWRAP36(a) \
129DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9) \
130{ \
131 DWORD ret; \
132 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9)); \
133 dbg_ThreadPushCall(#a); \
134 ret = ((DBG_WINPROC36)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
135 dbg_ThreadPopCall(); \
136 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
137 return ret; \
138}
139
140#define DEBUGWRAP40(a) \
141DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10) \
142{ \
143 DWORD ret; \
144 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10)); \
145 dbg_ThreadPushCall(#a); \
146 ret = ((DBG_WINPROC40)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
147 dbg_ThreadPopCall(); \
148 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
149 return ret; \
150}
151
152#define DEBUGWRAP44(a) \
153DWORD 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) \
154{ \
155 DWORD ret; \
156 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11)); \
157 dbg_ThreadPushCall(#a); \
158 ret = ((DBG_WINPROC44)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
159 dbg_ThreadPopCall(); \
160 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
161 return ret; \
162}
163
164#define DEBUGWRAP48(a) \
165DWORD 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) \
166{ \
167 DWORD ret; \
168 dprintf((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11, arg12)); \
169 dbg_ThreadPushCall(#a); \
170 ret = ((DBG_WINPROC48)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
171 dbg_ThreadPopCall(); \
172 dprintf((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
173 return ret; \
174}
175
176//level 2 logging
177
178#define DEBUGWRAP_LVL2_0(a) \
179DWORD WIN32API Dbg##a() \
180{ \
181 DWORD ret; \
182 dprintf2((DBGWRAP_MODULE": %s", #a)); \
183 dbg_ThreadPushCall(#a); \
184 ret = ((DBG_WINPROC0)a)(); \
185 dbg_ThreadPopCall(); \
186 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
187 return ret; \
188}
189
190#define DEBUGWRAP_LVL2_4(a) \
191DWORD WIN32API Dbg##a(DWORD arg1) \
192{ \
193 DWORD ret; \
194 dprintf2((DBGWRAP_MODULE": %s %x", #a, arg1)); \
195 dbg_ThreadPushCall(#a); \
196 ret = ((DBG_WINPROC4)a)(arg1); \
197 dbg_ThreadPopCall(); \
198 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
199 return ret; \
200}
201
202#define DEBUGWRAP_LVL2_8(a) \
203DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2) \
204{ \
205 DWORD ret; \
206 dprintf2((DBGWRAP_MODULE": %s %x %x", #a, arg1, arg2)); \
207 dbg_ThreadPushCall(#a); \
208 ret = ((DBG_WINPROC8)a)(arg1, arg2); \
209 dbg_ThreadPopCall(); \
210 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
211 return ret; \
212}
213
214#define DEBUGWRAP_LVL2_12(a) \
215DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3) \
216{ \
217 DWORD ret; \
218 dprintf2((DBGWRAP_MODULE": %s %x %x %x", #a, arg1, arg2, arg3)); \
219 dbg_ThreadPushCall(#a); \
220 ret = ((DBG_WINPROC12)a)(arg1, arg2, arg3); \
221 dbg_ThreadPopCall(); \
222 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
223 return ret; \
224}
225
226#define DEBUGWRAP_LVL2_16(a) \
227DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4) \
228{ \
229 DWORD ret; \
230 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x", #a, arg1, arg2, arg3, arg4)); \
231 dbg_ThreadPushCall(#a); \
232 ret = ((DBG_WINPROC16)a)(arg1, arg2, arg3, arg4); \
233 dbg_ThreadPopCall(); \
234 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
235 return ret; \
236}
237
238#define DEBUGWRAP_LVL2_20(a) \
239DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5) \
240{ \
241 DWORD ret; \
242 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5)); \
243 dbg_ThreadPushCall(#a); \
244 ret = ((DBG_WINPROC20)a)(arg1, arg2, arg3, arg4, arg5); \
245 dbg_ThreadPopCall(); \
246 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
247 return ret; \
248}
249
250#define DEBUGWRAP_LVL2_24(a) \
251DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6) \
252{ \
253 DWORD ret; \
254 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg6)); \
255 dbg_ThreadPushCall(#a); \
256 ret = ((DBG_WINPROC24)a)(arg1, arg2, arg3, arg4, arg5, arg6); \
257 dbg_ThreadPopCall(); \
258 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
259 return ret; \
260}
261
262#define DEBUGWRAP_LVL2_28(a) \
263DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7) \
264{ \
265 DWORD ret; \
266 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7)); \
267 dbg_ThreadPushCall(#a); \
268 ret = ((DBG_WINPROC28)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
269 dbg_ThreadPopCall(); \
270 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
271 return ret; \
272}
273
274#define DEBUGWRAP_LVL2_32(a) \
275DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8) \
276{ \
277 DWORD ret; \
278 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8)); \
279 dbg_ThreadPushCall(#a); \
280 ret = ((DBG_WINPROC32)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \
281 dbg_ThreadPopCall(); \
282 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
283 return ret; \
284}
285
286#define DEBUGWRAP_LVL2_36(a) \
287DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9) \
288{ \
289 DWORD ret; \
290 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9)); \
291 dbg_ThreadPushCall(#a); \
292 ret = ((DBG_WINPROC36)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
293 dbg_ThreadPopCall(); \
294 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
295 return ret; \
296}
297
298#define DEBUGWRAP_LVL2_40(a) \
299DWORD WIN32API Dbg##a(DWORD arg1, DWORD arg2, DWORD arg3, DWORD arg4, DWORD arg5, DWORD arg6, DWORD arg7, DWORD arg8, DWORD arg9, DWORD arg10) \
300{ \
301 DWORD ret; \
302 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10)); \
303 dbg_ThreadPushCall(#a); \
304 ret = ((DBG_WINPROC40)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \
305 dbg_ThreadPopCall(); \
306 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
307 return ret; \
308}
309
310#define DEBUGWRAP_LVL2_44(a) \
311DWORD 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) \
312{ \
313 DWORD ret; \
314 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11)); \
315 dbg_ThreadPushCall(#a); \
316 ret = ((DBG_WINPROC44)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \
317 dbg_ThreadPopCall(); \
318 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
319 return ret; \
320}
321
322#define DEBUGWRAP_LVL2_48(a) \
323DWORD 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) \
324{ \
325 DWORD ret; \
326 dprintf2((DBGWRAP_MODULE": %s %x %x %x %x %x %x", #a, arg1, arg2, arg3, arg4, arg5, arg7, arg8, arg9, arg10, arg11, arg12)); \
327 dbg_ThreadPushCall(#a); \
328 ret = ((DBG_WINPROC48)a)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \
329 dbg_ThreadPopCall(); \
330 dprintf2((DBGWRAP_MODULE": %s returned %x", #a, ret)); \
331 return ret; \
332}
333
334
335#endif
336
Note: See TracBrowser for help on using the repository browser.