If the network is not lying to me again,
[EMAIL PROTECTED] wrote on Thu, Dec 21, 2000 at 01:37:39PM -0800:
> Francois Jacques <[EMAIL PROTECTED]> writes:
>
> > +static HRESULT
> > +INVOKE_InvokeStdCallFunction(IUnknown* pIUnk,
> > + FUNCDESC* pFuncDesc,
> > + VARIANTARG* paArgsCoerced,
> > + VARIANT* pVarResult,
> > + EXCEPINFO* pExcepInfo)
> > +{
> > + typedef DWORD (__stdcall *pDWORDRetFunc) (IUnknown*);
> > + typedef double (__stdcall *pDoubleRetFunc)(IUnknown*);
> > +
> > + HRESULT hr = E_FAIL;
> > +
> > + /* retrieve current stack pointer, keep a copy */
> > +#ifdef __GNUC__
> > +#ifdef __i386__
> > + register DWORD esp asm("esp");
> > +#endif
> > +#endif
>
> You absolutely cannot manipulate the stack behind gcc's back. There is
> no way this can work except by pure blind luck.
OK, now could you explain us why?
> You should build the
> arguments into a DWORD array and then use a switch statement to pass
> the right number of parameters, like we do in relay32/relay386.c.
We were thinking about implementing it that way, but implementing it
like it is (no limitation about the number of parameters) appeared at
the time a more efficient approach. I like the relay implementation
since it's 100% portable while this one isn't. However, and I repeat
myself here, I'd like to know why the code can't work.
Later
--
Francois Jacques, Software Designer
Macadamian Technologies Inc.