private static IntPtr[] PrepareOutputPointers(RdcBufferPointer[] rdcBufferPointers)
{
var result = new IntPtr[rdcBufferPointers.Length];
for (var i = 0; i < rdcBufferPointers.Length; i++)
{
result[i] = Marshal.AllocCoTaskMem(Marshal.SizeOf(rdcBufferPointers[i]));
Marshal.StructureToPtr(rdcBufferPointers[i], result[i], false);
}
return result;
}