How can I pass in a pointer to a pointer of a UInt16 array to a Marshalled function?
问题 I'm attempting to send a pointer to a pointer of a UInt16 array to a marshalled function like so in C#: C++: int foo(Unsigned_16_Type** Buffer_Pointer); C#: [DllImport("example.dll")] public static extern int foo(IntPtr Buffer_Pointer); UInt16[] bufferArray = new UInt16[32]; IntPtr p_Buffer = (IntPtr)Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(UInt16)) * bufferArray.Length); Marshal.Copy(bufferArray, 0, p_Buffer, bufferArray.Length); //Issue is here GCHandle handle = GCHandle.Alloc(p_Buffer,