1 | #ifndef __DBBWRAP_H__
|
---|
2 | #define __DBBWRAP_H__
|
---|
3 |
|
---|
4 | #include <odinwrap.h>
|
---|
5 |
|
---|
6 | typedef DWORD (* WIN32API DBG_WINPROC0)();
|
---|
7 | typedef DWORD (* WIN32API DBG_WINPROC4)(DWORD);
|
---|
8 | typedef DWORD (* WIN32API DBG_WINPROC8)(DWORD, DWORD);
|
---|
9 | typedef DWORD (* WIN32API DBG_WINPROC12)(DWORD, DWORD, DWORD);
|
---|
10 | typedef DWORD (* WIN32API DBG_WINPROC16)(DWORD, DWORD, DWORD, DWORD);
|
---|
11 | typedef DWORD (* WIN32API DBG_WINPROC20)(DWORD, DWORD, DWORD, DWORD, DWORD);
|
---|
12 | typedef DWORD (* WIN32API DBG_WINPROC24)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
---|
13 | typedef DWORD (* WIN32API DBG_WINPROC28)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
---|
14 | typedef DWORD (* WIN32API DBG_WINPROC32)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
---|
15 | typedef DWORD (* WIN32API DBG_WINPROC36)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
---|
16 | typedef DWORD (* WIN32API DBG_WINPROC40)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
---|
17 | typedef DWORD (* WIN32API DBG_WINPROC44)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
---|
18 | typedef DWORD (* WIN32API DBG_WINPROC48)(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
|
---|
19 |
|
---|
20 | #define DEBUGWRAP0(a) \
|
---|
21 | DWORD 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) \
|
---|
33 | DWORD 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) \
|
---|
45 | DWORD 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) \
|
---|
57 | DWORD 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) \
|
---|
69 | DWORD 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) \
|
---|
81 | DWORD 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) \
|
---|
93 | DWORD 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) \
|
---|
105 | DWORD 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) \
|
---|
117 | DWORD 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) \
|
---|
129 | DWORD 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) \
|
---|
141 | DWORD 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) \
|
---|
153 | DWORD 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) \
|
---|
165 | DWORD 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 |
|
---|
177 | #endif
|
---|
178 |
|
---|