hi all,

i need some help about calling conventions:
i have the following 32bit code where i use STDCALL convention. I need to call the dll function MyProc but in the DLL i use windows pascal convention. So i get confused ...



model flat,stdcall

.data
A BYTE 1
B DWORD 2
C DWORD 3
....
....
....
call MyProc A,B,C
....


the DLL start as follow



model flat,windows pascal
...
...

MyProc A:BYTE, B:DWORD, C:DWORD
...
...
...
ret
MyProc endp


Is the order of the parameters declared after MyProc correct or have i to invert them ?

Thanks, B7
Posted on 2001-11-27 14:06:48 by Bit7
I think INVOKE knows the difference. So as long as you use INVOKE to call the PROC, you shouldn't have to worry about it.

Add the /Sg flag to ML and check out the generated code in the listing. :)
Posted on 2001-11-27 14:43:51 by S/390
You'll probably have to set up a prototype for the function in the
DLL, telling your assembler that it deviates from the stdcall and
is actually using pascal calling convention.
Posted on 2001-11-27 14:45:29 by f0dder
thanks,

S/390, the problem is that i'm unfortunately using tasm :( and i can't use INVOKE. I will try with a prototype declaration.
Bye
Posted on 2001-11-27 15:20:09 by Bit7