Subject Re: Re: [firebird-support] UDF help
Author Pavel Menshchikov
Hello Kjell,

KR> So, what actually happens if a caller using cdecl (FB) calls a routine
KR> that uses sdtcall (the UDF)?
I don't know exactly what happens... Besides Ibrahim says his UDF
works with stdcall...

But in theory, let's see:
- FB calls your "stdcall UDF"
- it saves return point, allocates memory for parameter references in
the stack (all parameters are passed by reference)
- processing goes to the UDF
- in the end, "stdcall UDF" removes the parameter references from the
stack and returns to FB
- then "cdecl FB" probably tries to remove the parameters references
from the stack once again?
Maybe Dimitry or someone else will clarify those steps, although it's
off-topic in this list.


HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com