修改后的,还是不行
byte[] bytes = new byte[iLen];
//写入处理数据流
...
IntPtr p = Marshal.AllocHGlobal(iLen*sizeof(byte));
Marshal.Copy(bytes, 0, p, iLen);
int result = ImpDll.KAER_InputData(phHandle, p, (long)iLen);
Marshal.FreeHGlobal(p);
DLL:
[DllImport("SimpleClinet.dll", EntryPoint = "KAER_InputData")]
public unsafe static extern int KAER_InputData(long hHandle, IntPtr pBuf, long lSize);