Mail Archives: cygwin/1998/05/29/00:45:32
Tim Newsham wrote:
> This much seems to work properly. I am having problems, however, when
> I try to actually call one of the procedures. The stack pointer (esp)
> seems to be incorrect after a call to the procedure. In particular
> I am passing in 3 4-byte arguments (12 bytes). The emitted code
> looks like:
>
> <push args>
> call *%ebx
> addl %0xc, %esp
>
You have to declare called functions as __stdcall. For example:
int __stdcall (*fptr)(int a, int b, int c);
....
fptr = GetProcAddress(dllhandle, "functionname");
(*fptr)(par1, par2, par3);
This case the emitted code will look like:
<push args>
call *%ebx
Stdcall function removes from stack pushed arguments itself.
--
Sergey Okhapkin, http://www.lexa.ru/sos
Moscow, Russia
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -