In Delphi, you can copy a record by simply assigning it, thanks to the magic of the compiler.
MyData := DataSource^;
Dynamic arrays are counted by reference, so the job also serves dynamic arrays if you don't need a real deep copy. With a simple purpose, they just use the same memory.
If you do not want you to be able to copy them individually:
MyData.pPitch = Copy(pDataSource^.pPitch, Low(pDataSource^.pPitch),
High(pDataSource^.pPitch);
source
share