I am trying to use a function in C# from an unmanged C dll. I'm new to C# and am unsure if I'm doing this correctly. The function in C looks something like this:
unsigned short Function(unsigned short, unsigned long, unsigned long, unsigned short*);
[DllImport("cDLLfile.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
private static extern short Function(ushort a, UInt32 b, UInt32 c, IntPtr buffer);
The buffer is an array something like
ushort[] = new ushort[7];
I fill the array then try to pass it to Function and am getting a error. I know IntPtr is not right. What is the correct way to do this?