Hi. I'd like to call a function which is named exactly like the calling function. The called function is inside another DLL. Putting simple "call function_name" creates a recursive call to the calling function instead of the one I want to call. I can't use LoadLibrary/GetProcAddress/FreeLibrary. Actually, there ARE ways to get around this problem, but I'd like to make this in a 'clean' way. Any ideas? (The called function has exactly the same parameters)
Posted on 2006-03-26 15:20:22 by ti_mo_n
use 'extrn' to let the assembler know that the procedure isn't in the current code, the format for this goes as:


Where PROCNAME is the procedure and BYTES is the number of bytes the arguments take up. In the following example, I show calling ExitProcess which takes a single dword argument.

includelib kernel32.lib
extrn __imp__ExitProcess@4
push 0
call [__imp__ExitProcess@4]

It's simple enough, hope that's what you are looking for.

Bryant Keller
Posted on 2006-03-26 15:46:23 by Synfire