public static IntPtr GetInt16s(short[] input) { IntPtr output = IntPtr.Zero; if (input != null) { output = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(Int16))*input.Length); Marshal.Copy(input, 0, output, input.Length); } return output; }