Given a method with this signature in a DLL
int32_t __stdcall ndUDSReadDataByIdentifier(
TD1 *diagRef,
uint16_t ID,
uint8_t dataOut[],
int32_t *len,
int8_t *success);
How does the C# external call look like?
I tried:
[DllImport("nidiagcs.dll")]
public static extern Int32 ndUDSReadDataByIdentifier(
ref TD1 diagRef,
[MarshalAs(UnmanagedType.U2)] UInt16 ID,
byte[] dataOut,
[MarshalAs(UnmanagedType.U4)] ref Int32 len,
[MarshalAs(UnmanagedType.U1)] ref byte success);
The call is executed but the dataOut is not filled.