Referencing How to get IntPtr from byte[] in C#
I am attempting to read the data that an IntPtr is referencing into a byte [] and then back into another IntPtr. The
1- I assume bmpptr is already an unmanaged pointer, if so why do you need to 'round-trip' this back to an unmanaged pointer unmanagedPointer?
2- Marshal.SizeOf will not give you the size of the unmanaged memory allocation.
Using Marshal.Copy, you can copy the contents of unmanaged memory to a managed byte array, but you will need to know how many bytes need to be moved from the unmanaged buffer to the managed buffer. The API should ideally provide this information.