On Mon, 28 Oct 1996, Francis Leboutte wrote:
> At 09:45 28/10/96 -0500, Bruce Tobin wrote:
> >Suppose you have the following definitions:
> >
> >(ct:defcstruct mystruct
> > ((data1 win:word)
> > (data2 win:word)
> > (data3 :char 4)))
> >
> >(ct:defun-dll my-c-fun ((pmystruct (mystruct *)))
> > :call-mode :c
> > :return-type :long
> > :library-name mylib
> > :entry-name "test-func")
> >
> >Assuming that test-func takes one argument, a
> >pointer-to-mystruct that will be filled with the
> >address of a newly created mystruct:
> >
> >1. Is my-c-fun defined correctly?
>
> Seems OK.
>
> >2. What do I pass to my-c-fun when I call it?
>
> E.g. the following *mystruct*:
>
> (defparameter *mystruct* (callocate mystruct data1 <value1> data2 <value2>))
> Francis
Would this be correct even if the dll routine is supposed to take an
unitialized pointer (to be set by the dll routine itself) as argument?
i.e., if the C code for the dll routine looked like
HRESULT testfunc(mystruct *pmystruct)
{
pmystruct = (mystruct *)malloc(sizeof(mystruct));
....
....
return 0;
}