On Monday, 16 November 2020 at 21:31:44 UTC, frame wrote:
I have a DLL in D-code which returns an object and want to pass
a struct S[] to a member function of that object. The first
element is passed correctly, the rest is just garbage. In fact
the next item is just a single byte with value 0x11 following
some 0x00.
It doesn't matter if I'm using S[], S[]* or S* with .ptr. The
length of the array is correct but the data isn't except the
first item.
Is this a trap because of extern function? How can I access the
next item? Increasing the pointer is equivalent with S[1].
What is the function prototype like and how are you declaring
that struct?