private static void RdcBufferTranslate(RdcBufferPointer[] source, IntPtr[] dest)
{
if (source.Length != dest.Length)
{
throw new ArgumentException("source and dest should have the same length");
}
// Marshal the managed structure to a native
// pointer and add it to our array.
for (var i = 0; i < dest.Length; i++)
{
dest[i] = Marshal.AllocCoTaskMem(Marshal.SizeOf(source[i]));
Marshal.StructureToPtr(source[i], dest[i], false);
}
}