SNOOP_GetProcAddress: don't touch already initialized fun-entries.

This commit is contained in:
Uwe Bonnes 2001-07-14 00:43:57 +00:00 committed by Alexandre Julliard
parent 10109e6083
commit 574a10efb7
1 changed files with 9 additions and 6 deletions

View File

@ -194,12 +194,15 @@ SNOOP_GetProcAddress(HMODULE hmod,LPCSTR name,DWORD ordinal,FARPROC origfun) {
return origfun; return origfun;
assert(ordinal < dll->nrofordinals); assert(ordinal < dll->nrofordinals);
fun = dll->funs+ordinal; fun = dll->funs+ordinal;
if (!fun->name) fun->name = HEAP_strdupA(GetProcessHeap(),0,name); if (!fun->name)
fun->lcall = 0xe8; {
/* NOTE: origreturn struct member MUST come directly after snoopentry */ fun->name = HEAP_strdupA(GetProcessHeap(),0,name);
fun->snoopentry = (char*)SNOOP_Entry-((char*)(&fun->nrofargs)); fun->lcall = 0xe8;
fun->origfun = origfun; /* NOTE: origreturn struct member MUST come directly after snoopentry */
fun->nrofargs = -1; fun->snoopentry = (char*)SNOOP_Entry-((char*)(&fun->nrofargs));
fun->origfun = origfun;
fun->nrofargs = -1;
}
return (FARPROC)&(fun->lcall); return (FARPROC)&(fun->lcall);
} }