blob: 53d91adbac81ec0257fbe52cdd9ae9a65a4dd581 [file] [log] [blame]
Alexandre Julliardf90efa91998-06-14 15:24:15 +00001/*
2 * 386-specific Win32 dll<->dll snooping functions
3 *
4 * Copyright 1998 Marcus Meissner
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00005 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Alexandre Julliardf90efa91998-06-14 15:24:15 +000019 */
20
Patrik Stridvall96336321999-10-24 22:13:47 +000021#include "config.h"
Alexandre Julliard894b1882002-04-25 21:40:56 +000022#include "wine/port.h"
Alexandre Julliardf90efa91998-06-14 15:24:15 +000023
24#include <assert.h>
Alexandre Julliard383da682000-02-10 22:15:21 +000025#include <stdio.h>
Marcus Meissner317af321999-02-17 13:51:06 +000026#include <string.h>
Alexandre Julliardf90efa91998-06-14 15:24:15 +000027#include "winbase.h"
28#include "winnt.h"
Patrik Stridvall9c1de6d2002-09-12 22:07:02 +000029#include "winternl.h"
Alexandre Julliardf90efa91998-06-14 15:24:15 +000030#include "snoop.h"
Alexandre Julliardf90efa91998-06-14 15:24:15 +000031#include "stackframe.h"
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000032#include "wine/debug.h"
Uwe Bonnes69277bb2000-04-23 20:38:49 +000033#include "wine/exception.h"
Peter Hunnisett73ab6492002-02-25 20:10:35 +000034#include "msvcrt/excpt.h"
Alexandre Julliardf90efa91998-06-14 15:24:15 +000035
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000036WINE_DEFAULT_DEBUG_CHANNEL(snoop);
Patrik Stridvallb4b9fae1999-04-19 14:56:29 +000037
Uwe Bonnes69277bb2000-04-23 20:38:49 +000038static WINE_EXCEPTION_FILTER(page_fault)
39{
Rein Klazes2826f572000-09-19 02:39:59 +000040 if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ||
41 GetExceptionCode() == EXCEPTION_PRIV_INSTRUCTION)
Uwe Bonnes69277bb2000-04-23 20:38:49 +000042 return EXCEPTION_EXECUTE_HANDLER;
43 return EXCEPTION_CONTINUE_SEARCH;
44}
45
Alexandre Julliarda061b842002-06-04 17:48:41 +000046extern const char **debug_snoop_excludelist;
47extern const char **debug_snoop_includelist;
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +000048
Ulrich Weigand6ca85a51999-11-14 21:28:57 +000049#ifdef __i386__
50
Rein Klazes43a98a61999-11-14 19:44:43 +000051extern void WINAPI SNOOP_Entry();
52extern void WINAPI SNOOP_Return();
Alexandre Julliard06b97891999-05-13 16:13:17 +000053
Patrik Stridvallc7a8dde1999-04-25 12:36:53 +000054#include "pshpack1.h"
Alexandre Julliardf90efa91998-06-14 15:24:15 +000055
56typedef struct tagSNOOP_FUN {
57 /* code part */
58 BYTE lcall; /* 0xe8 call snoopentry (relative) */
59 /* NOTE: If you move snoopentry OR nrofargs fix the relative offset
60 * calculation!
61 */
62 DWORD snoopentry; /* SNOOP_Entry relative */
63 /* unreached */
64 int nrofargs;
Alexandre Julliarda3960291999-02-26 11:11:13 +000065 FARPROC origfun;
Alexandre Julliardf90efa91998-06-14 15:24:15 +000066 char *name;
67} SNOOP_FUN;
68
69typedef struct tagSNOOP_DLL {
Alexandre Julliarda3960291999-02-26 11:11:13 +000070 HMODULE hmod;
Alexandre Julliardf90efa91998-06-14 15:24:15 +000071 SNOOP_FUN *funs;
Andreas Mohr9abd5532001-05-24 18:43:16 +000072 DWORD ordbase;
Alexandre Julliard908464d2000-11-01 03:11:12 +000073 DWORD nrofordinals;
Alexandre Julliardf90efa91998-06-14 15:24:15 +000074 struct tagSNOOP_DLL *next;
Alexandre Julliard5f728ca2001-07-24 21:45:22 +000075 char name[1];
Alexandre Julliardf90efa91998-06-14 15:24:15 +000076} SNOOP_DLL;
Alexandre Julliard5f728ca2001-07-24 21:45:22 +000077
Alexandre Julliardf90efa91998-06-14 15:24:15 +000078typedef struct tagSNOOP_RETURNENTRY {
79 /* code part */
80 BYTE lcall; /* 0xe8 call snoopret relative*/
81 /* NOTE: If you move snoopret OR origreturn fix the relative offset
82 * calculation!
83 */
84 DWORD snoopret; /* SNOOP_Ret relative */
85 /* unreached */
Alexandre Julliarda3960291999-02-26 11:11:13 +000086 FARPROC origreturn;
Alexandre Julliardf90efa91998-06-14 15:24:15 +000087 SNOOP_DLL *dll;
88 DWORD ordinal;
89 DWORD origESP;
90 DWORD *args; /* saved args across a stdcall */
91} SNOOP_RETURNENTRY;
92
93typedef struct tagSNOOP_RETURNENTRIES {
94 SNOOP_RETURNENTRY entry[4092/sizeof(SNOOP_RETURNENTRY)];
95 struct tagSNOOP_RETURNENTRIES *next;
96} SNOOP_RETURNENTRIES;
97
Patrik Stridvallc7a8dde1999-04-25 12:36:53 +000098#include "poppack.h"
Alexandre Julliardf90efa91998-06-14 15:24:15 +000099
100static SNOOP_DLL *firstdll = NULL;
101static SNOOP_RETURNENTRIES *firstrets = NULL;
102
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000103/***********************************************************************
104 * SNOOP_ShowDebugmsgSnoop
105 *
106 * Simple function to decide if a particular debugging message is
107 * wanted.
108 */
109int SNOOP_ShowDebugmsgSnoop(const char *dll, int ord, const char *fname) {
110
111 if(debug_snoop_excludelist || debug_snoop_includelist) {
Alexandre Julliarda061b842002-06-04 17:48:41 +0000112 const char **listitem;
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000113 char buf[80];
114 int len, len2, itemlen, show;
115
116 if(debug_snoop_excludelist) {
117 show = 1;
118 listitem = debug_snoop_excludelist;
119 } else {
120 show = 0;
121 listitem = debug_snoop_includelist;
122 }
123 len = strlen(dll);
124 assert(len < 64);
125 sprintf(buf, "%s.%d", dll, ord);
126 len2 = strlen(buf);
127 for(; *listitem; listitem++) {
128 itemlen = strlen(*listitem);
Lawson Whitneybae8af22001-02-12 01:19:04 +0000129 if((itemlen == len && !strncasecmp(*listitem, buf, len)) ||
130 (itemlen == len2 && !strncasecmp(*listitem, buf, len2)) ||
131 !strcasecmp(*listitem, fname)) {
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000132 show = !show;
133 break;
134 }
135 }
136 return show;
137 }
138 return 1;
139}
140
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000141void
Andreas Mohr9abd5532001-05-24 18:43:16 +0000142SNOOP_RegisterDLL(HMODULE hmod,LPCSTR name,DWORD ordbase,DWORD nrofordinals) {
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000143 SNOOP_DLL **dll = &(firstdll);
144 char *s;
145
Dmitry Timoshkov23d4aab2002-04-02 02:49:42 +0000146 TRACE("hmod=%x, name=%s, ordbase=%ld, nrofordinals=%ld\n",
147 hmod, name, ordbase, nrofordinals);
148
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000149 if (!TRACE_ON(snoop)) return;
150 while (*dll) {
151 if ((*dll)->hmod == hmod)
Dmitry Timoshkov23d4aab2002-04-02 02:49:42 +0000152 {
153 /* another dll, loaded at the same address */
154 VirtualFree((*dll)->funs, (*dll)->nrofordinals*sizeof(SNOOP_FUN), MEM_RELEASE);
155 break;
156 }
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000157 dll = &((*dll)->next);
158 }
Dmitry Timoshkov23d4aab2002-04-02 02:49:42 +0000159 *dll = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *dll, sizeof(SNOOP_DLL)+strlen(name));
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000160 (*dll)->hmod = hmod;
Andreas Mohr9abd5532001-05-24 18:43:16 +0000161 (*dll)->ordbase = ordbase;
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000162 (*dll)->nrofordinals = nrofordinals;
Alexandre Julliard5f728ca2001-07-24 21:45:22 +0000163 strcpy( (*dll)->name, name );
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000164 if ((s=strrchr((*dll)->name,'.')))
165 *s='\0';
166 (*dll)->funs = VirtualAlloc(NULL,nrofordinals*sizeof(SNOOP_FUN),MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE);
167 memset((*dll)->funs,0,nrofordinals*sizeof(SNOOP_FUN));
168 if (!(*dll)->funs) {
Alexandre Julliard90476d62000-02-16 22:47:24 +0000169 HeapFree(GetProcessHeap(),0,*dll);
Alexandre Julliard9fe7a251999-05-14 08:17:14 +0000170 FIXME("out of memory\n");
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000171 return;
172 }
173}
174
Alexandre Julliarda3960291999-02-26 11:11:13 +0000175FARPROC
176SNOOP_GetProcAddress(HMODULE hmod,LPCSTR name,DWORD ordinal,FARPROC origfun) {
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000177 SNOOP_DLL *dll = firstdll;
178 SNOOP_FUN *fun;
Alexandre Julliarda5dea212002-08-09 19:57:38 +0000179 IMAGE_SECTION_HEADER *sec;
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000180
181 if (!TRACE_ON(snoop)) return origfun;
182 if (!*(LPBYTE)origfun) /* 0x00 is an imposs. opcode, poss. dataref. */
183 return origfun;
Alexandre Julliarda5dea212002-08-09 19:57:38 +0000184
185 sec = RtlImageRvaToSection( RtlImageNtHeader(hmod), hmod, (char *)origfun - (char *)hmod );
186
187 if (!sec || !(sec->Characteristics & IMAGE_SCN_CNT_CODE))
188 return origfun; /* most likely a data reference */
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000189
190 while (dll) {
191 if (hmod == dll->hmod)
192 break;
193 dll=dll->next;
194 }
195 if (!dll) /* probably internal */
196 return origfun;
Marcus Meissner30c112e1998-11-14 17:06:55 +0000197 if (!SNOOP_ShowDebugmsgSnoop(dll->name,ordinal,name))
198 return origfun;
Alexandre Julliard908464d2000-11-01 03:11:12 +0000199 assert(ordinal < dll->nrofordinals);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000200 fun = dll->funs+ordinal;
Vincent Béron9a624912002-05-31 23:06:46 +0000201 if (!fun->name)
Uwe Bonnes574a10e2001-07-14 00:43:57 +0000202 {
Alexandre Julliard5f728ca2001-07-24 21:45:22 +0000203 fun->name = HeapAlloc(GetProcessHeap(),0,strlen(name)+1);
204 strcpy( fun->name, name );
Uwe Bonnes574a10e2001-07-14 00:43:57 +0000205 fun->lcall = 0xe8;
206 /* NOTE: origreturn struct member MUST come directly after snoopentry */
207 fun->snoopentry = (char*)SNOOP_Entry-((char*)(&fun->nrofargs));
208 fun->origfun = origfun;
209 fun->nrofargs = -1;
210 }
Alexandre Julliarda3960291999-02-26 11:11:13 +0000211 return (FARPROC)&(fun->lcall);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000212}
213
Alexandre Julliard0aa28b52002-05-17 02:55:48 +0000214static void SNOOP_PrintArg(DWORD x)
215{
216 int i,nostring;
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000217
Alexandre Julliard0aa28b52002-05-17 02:55:48 +0000218 DPRINTF("%08lx",x);
219 if ( !HIWORD(x) ) return; /* trivial reject to avoid faults */
220 __TRY
221 {
222 LPBYTE s=(LPBYTE)x;
223 i=0;nostring=0;
224 while (i<80) {
225 if (s[i]==0) break;
226 if (s[i]<0x20) {nostring=1;break;}
227 if (s[i]>=0x80) {nostring=1;break;}
228 i++;
229 }
230 if (!nostring && i > 5)
231 DPRINTF(" %s",debugstr_an((LPSTR)x,i));
232 else /* try unicode */
233 {
234 LPWSTR s=(LPWSTR)x;
235 i=0;nostring=0;
236 while (i<80) {
237 if (s[i]==0) break;
238 if (s[i]<0x20) {nostring=1;break;}
239 if (s[i]>0x100) {nostring=1;break;}
240 i++;
241 }
242 if (!nostring && i > 5) DPRINTF(" %s",debugstr_wn((LPWSTR)x,i));
243 }
244 }
245 __EXCEPT(page_fault)
246 {
247 }
248 __ENDTRY
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000249}
250
Alexandre Julliardd8fab2e2000-09-25 23:53:07 +0000251#define CALLER1REF (*(DWORD*)context->Esp)
Ulrich Weigand6ca85a51999-11-14 21:28:57 +0000252
Ulrich Weigand6ca85a51999-11-14 21:28:57 +0000253void WINAPI SNOOP_DoEntry( CONTEXT86 *context )
Alexandre Julliard06b97891999-05-13 16:13:17 +0000254{
Alexandre Julliardd8fab2e2000-09-25 23:53:07 +0000255 DWORD ordinal=0,entry = context->Eip - 5;
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000256 SNOOP_DLL *dll = firstdll;
257 SNOOP_FUN *fun = NULL;
258 SNOOP_RETURNENTRIES **rets = &firstrets;
259 SNOOP_RETURNENTRY *ret;
Dimitrie O. Paun334a42f2000-10-29 18:07:04 +0000260 int i=0, max;
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000261
262 while (dll) {
263 if ( ((char*)entry>=(char*)dll->funs) &&
264 ((char*)entry<=(char*)(dll->funs+dll->nrofordinals))
265 ) {
266 fun = (SNOOP_FUN*)entry;
267 ordinal = fun-dll->funs;
268 break;
269 }
270 dll=dll->next;
271 }
272 if (!dll) {
Alexandre Julliard9fe7a251999-05-14 08:17:14 +0000273 FIXME("entrypoint 0x%08lx not found\n",entry);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000274 return; /* oops */
275 }
276 /* guess cdecl ... */
277 if (fun->nrofargs<0) {
278 /* Typical cdecl return frame is:
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000279 * add esp, xxxxxxxx
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000280 * which has (for xxxxxxxx up to 255 the opcode "83 C4 xx".
Marcus Meissner41786291998-10-11 10:47:02 +0000281 * (after that 81 C2 xx xx xx xx)
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000282 */
283 LPBYTE reteip = (LPBYTE)CALLER1REF;
284
Alexandre Julliard829fe321998-07-26 14:27:39 +0000285 if (reteip) {
286 if ((reteip[0]==0x83)&&(reteip[1]==0xc4))
287 fun->nrofargs=reteip[2]/4;
288 }
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000289 }
290
Alexandre Julliarda0d77311998-09-13 16:32:00 +0000291
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000292 while (*rets) {
293 for (i=0;i<sizeof((*rets)->entry)/sizeof((*rets)->entry[0]);i++)
294 if (!(*rets)->entry[i].origreturn)
295 break;
296 if (i!=sizeof((*rets)->entry)/sizeof((*rets)->entry[0]))
297 break;
298 rets = &((*rets)->next);
299 }
300 if (!*rets) {
301 *rets = VirtualAlloc(NULL,4096,MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE);
302 memset(*rets,0,4096);
303 i = 0; /* entry 0 is free */
304 }
305 ret = &((*rets)->entry[i]);
306 ret->lcall = 0xe8;
307 /* NOTE: origreturn struct member MUST come directly after snoopret */
308 ret->snoopret = ((char*)SNOOP_Return)-(char*)(&ret->origreturn);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000309 ret->origreturn = (FARPROC)CALLER1REF;
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000310 CALLER1REF = (DWORD)&ret->lcall;
311 ret->dll = dll;
312 ret->args = NULL;
313 ret->ordinal = ordinal;
Alexandre Julliardd8fab2e2000-09-25 23:53:07 +0000314 ret->origESP = context->Esp;
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000315
Alexandre Julliardd8fab2e2000-09-25 23:53:07 +0000316 context->Eip = (DWORD)fun->origfun;
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000317
Andreas Mohr9abd5532001-05-24 18:43:16 +0000318 DPRINTF("%08lx:CALL %s.%ld: %s(",GetCurrentThreadId(),dll->name,dll->ordbase+ordinal,fun->name);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000319 if (fun->nrofargs>0) {
320 max = fun->nrofargs; if (max>16) max=16;
321 for (i=0;i<max;i++)
Alexandre Julliard0aa28b52002-05-17 02:55:48 +0000322 {
323 SNOOP_PrintArg(*(DWORD*)(context->Esp + 4 + sizeof(DWORD)*i));
324 if (i<fun->nrofargs-1) DPRINTF(",");
325 }
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000326 if (max!=fun->nrofargs)
327 DPRINTF(" ...");
328 } else if (fun->nrofargs<0) {
329 DPRINTF("<unknown, check return>");
Alexandre Julliard90476d62000-02-16 22:47:24 +0000330 ret->args = HeapAlloc(GetProcessHeap(),0,16*sizeof(DWORD));
Alexandre Julliardd8fab2e2000-09-25 23:53:07 +0000331 memcpy(ret->args,(LPBYTE)(context->Esp + 4),sizeof(DWORD)*16);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000332 }
Francois Gougete17d1a32001-05-08 00:13:38 +0000333 DPRINTF(") ret=%08lx\n",(DWORD)ret->origreturn);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000334}
335
Alexandre Julliard85d666a2000-12-12 00:49:45 +0000336
Ulrich Weigand6ca85a51999-11-14 21:28:57 +0000337void WINAPI SNOOP_DoReturn( CONTEXT86 *context )
Alexandre Julliard06b97891999-05-13 16:13:17 +0000338{
Alexandre Julliardd8fab2e2000-09-25 23:53:07 +0000339 SNOOP_RETURNENTRY *ret = (SNOOP_RETURNENTRY*)(context->Eip - 5);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000340
341 /* We haven't found out the nrofargs yet. If we called a cdecl
Alexandre Julliardebfc0fe1998-06-28 18:40:26 +0000342 * function it is too late anyway and we can just set '0' (which
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000343 * will be the difference between orig and current ESP
344 * If stdcall -> everything ok.
345 */
346 if (ret->dll->funs[ret->ordinal].nrofargs<0)
Alexandre Julliardd8fab2e2000-09-25 23:53:07 +0000347 ret->dll->funs[ret->ordinal].nrofargs=(context->Esp - ret->origESP-4)/4;
348 context->Eip = (DWORD)ret->origreturn;
Marcus Meissner41786291998-10-11 10:47:02 +0000349 if (ret->args) {
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000350 int i,max;
351
Francois Gougete17d1a32001-05-08 00:13:38 +0000352 DPRINTF("%08lx:RET %s.%ld: %s(",
353 GetCurrentThreadId(),
Andreas Mohr9abd5532001-05-24 18:43:16 +0000354 ret->dll->name,ret->dll->ordbase+ret->ordinal,ret->dll->funs[ret->ordinal].name);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000355 max = ret->dll->funs[ret->ordinal].nrofargs;
356 if (max>16) max=16;
357
358 for (i=0;i<max;i++)
Alexandre Julliard0aa28b52002-05-17 02:55:48 +0000359 {
360 SNOOP_PrintArg(ret->args[i]);
361 if (i<max-1) DPRINTF(",");
362 }
Francois Gougete17d1a32001-05-08 00:13:38 +0000363 DPRINTF(") retval = %08lx ret=%08lx\n",
364 context->Eax,(DWORD)ret->origreturn );
Alexandre Julliard90476d62000-02-16 22:47:24 +0000365 HeapFree(GetProcessHeap(),0,ret->args);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000366 ret->args = NULL;
367 } else
Uwe Bonnes0249fcd2001-07-18 20:00:06 +0000368 DPRINTF("%08lx:RET %s.%ld: %s() retval = %08lx ret=%08lx\n",
Francois Gougete17d1a32001-05-08 00:13:38 +0000369 GetCurrentThreadId(),
Andreas Mohr9abd5532001-05-24 18:43:16 +0000370 ret->dll->name,ret->dll->ordbase+ret->ordinal,ret->dll->funs[ret->ordinal].name,
Uwe Bonnes0249fcd2001-07-18 20:00:06 +0000371 context->Eax, (DWORD)ret->origreturn);
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000372 ret->origreturn = NULL; /* mark as empty */
373}
Alexandre Julliard85d666a2000-12-12 00:49:45 +0000374
375/* assembly wrappers that save the context */
376__ASM_GLOBAL_FUNC( SNOOP_Entry,
Alexandre Julliardeb9a8632001-12-11 00:50:33 +0000377 "call " __ASM_NAME("__wine_call_from_32_regs") "\n\t"
Alexandre Julliard85d666a2000-12-12 00:49:45 +0000378 ".long " __ASM_NAME("SNOOP_DoEntry") ",0" );
379__ASM_GLOBAL_FUNC( SNOOP_Return,
Alexandre Julliardeb9a8632001-12-11 00:50:33 +0000380 "call " __ASM_NAME("__wine_call_from_32_regs") "\n\t"
Alexandre Julliard85d666a2000-12-12 00:49:45 +0000381 ".long " __ASM_NAME("SNOOP_DoReturn") ",0" );
382
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000383#else /* !__i386__ */
Warren Bairdc43b5c82002-05-16 23:08:01 +0000384void SNOOP_RegisterDLL(HMODULE hmod,LPCSTR name,DWORD nrofordinals, DWORD dw) {
Ulrich Weigand9a07b162000-12-27 18:37:37 +0000385 if (!TRACE_ON(snoop)) return;
Alexandre Julliard9fe7a251999-05-14 08:17:14 +0000386 FIXME("snooping works only on i386 for now.\n");
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000387}
388
Alexandre Julliarda3960291999-02-26 11:11:13 +0000389FARPROC SNOOP_GetProcAddress(HMODULE hmod,LPCSTR name,DWORD ordinal,FARPROC origfun) {
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000390 return origfun;
391}
Alexandre Julliardf90efa91998-06-14 15:24:15 +0000392#endif /* !__i386__ */