private static Asarwrittenblock[] CleanWrittenBlocks(RawAsarWrittenBlock *ptr, int length) { Asarwrittenblock[] output = new Asarwrittenblock[length]; // Copy unmanaged to managed memory to avoid potential errors in case the area // gets cleared by Asar. for (int i = 0; i < length; i++) { output[i].Snesoffset = ptr[i].snesoffset; output[i].Numbytes = ptr[i].numbytes; output[i].Pcoffset = ptr[i].pcoffset; } return(output); }
private static Asarwrittenblock[] cleanwrittenblocks(Rawasarwrittenblock *ptr, int length) { Asarwrittenblock[] output = new Asarwrittenblock[length]; // Better create a new array // to avoid pointer erros, corruption and may other problems. for (int i = 0; i < length; i++) { output[i].Snesoffset = ptr[i].snesoffset; output[i].Numbytes = ptr[i].numbytes; output[i].Pcoffset = ptr[i].pcoffset; } return(output); }