Woking with IntPtr, how can I copy with offset?

  • Thread starter Thread starter ThunderMusic
  • Start date Start date
T

ThunderMusic

Hi,
I have to copy some data to an unmanaged array pointed by an IntPtr. The
thing is Marshal.Copy only offers 4 parameters(not the actual parameters
name but what I understood of them) : Source, srcOffset, Destination(the
IntPtr), Length.

I would need and offset in the destination, something like : Source,
srcOffset, Destination(the IntPtr), dstOffset, Length.

Is there a way I can handle that simply? because I can't just call
Marshal.Copy(Source, srcOffset, Destination+dstOffset, Length). It does not
work.

Does somebody know how to achieve that?

Thanks

ThunderMusic
 
ThunderMusic said:
I have to copy some data to an unmanaged array pointed by an IntPtr. The
thing is Marshal.Copy only offers 4 parameters(not the actual parameters
name but what I understood of them) : Source, srcOffset, Destination(the
IntPtr), Length.

I would need and offset in the destination, something like : Source,
srcOffset, Destination(the IntPtr), dstOffset, Length.

Is there a way I can handle that simply? because I can't just call
Marshal.Copy(Source, srcOffset, Destination+dstOffset, Length). It does
not work.

'...(..., New IntPtr(Destination + Offset), ...)'.
 
Back
Top