I am currently browsing decompiled C# IL (with ILSpy) to get an impression on how some of the methods from System.Runtime.InteropServices
are (could be) implemented.
When I wanted to check how Marshal.Copy()
is implemented, I found out that it only calls CopyToNative()
, which is defined as follows:
// System.Runtime.InteropServices.Marshal
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void CopyToNative(object source, int startIndex, IntPtr destination, int length);
Where is it implemented? Is there any chance to look at its (decompiled) source code? If not, does anyone have a clue on how it could be implemented?