Interfacing with C - pointer problem



I try to call some C code, so I wrote me a simple interface, but it
does not what I expected.

It looks like this:

type LPSTR is access all String;

procedure C_Func (x : LPSTR); -- expects an address (C-pointer, 32-
bit)
pragma Import (STDCALL, C_Func, "C_Func");

procedure Q is
data : aliased String := "ABC" & Ascii.Nul;

begin
C_Func (data'unchecked_access);
end Q;

This does not work correct. What I found is, that data'Address is 32
bit and LPSTR is 64 bit.

How to manage this?

I tried a "pragma Convention (C, LPSTR);" but this gives a warning. So
what would be the right way?

Thanks in advance,
Gerd

.