C#&アンマネージDLL 普通の配列の引渡し

GCHandle構造体を使うといいらしい。

[DllImport("hogehoge.dll")]
private static extern int dll_TestFunc(int frameno, IntPtr ary, int aryCount);
 
public int TestFunc(int frameno, ref float[] ary)
{
    int len = ary.Length;
 
    GCHandle gcH = GCHandle.Alloc(ary, GCHandleType.Pinned);
 
    int re = dll_TestFunc(frameno,    gcH.AddrOfPinnedObject(), len);
 
    gcH.Free();
 
    return re;
}