Presumably size
is measured in bytes. If instead, size
is the number of elements, it should be obvious how to adapt the following.
First of all, call the function as you are doing:
Int32 err = ZGetBufferADC(typeDevice, numberDSP, out pBuffer, out sizeBufferADC);
Then declare an array into which you copy the buffer.
short[] buffer = new short[sizeBufferADC/Marshal.SizeOf(typeof(short))];
Finally copy the buffer:
Marshal.Copy(pBuffer, buffer, 0, buffer.Length);
And that should be all you need to do.