2 using System.Runtime.InteropServices;
6 public static int Main () {
7 byte [] bytesrc = new byte [20];
8 byte [] bytedest = new byte [20];
10 IntPtr dest = Marshal.AllocHGlobal (1024);
12 foreach (byte b in bytesrc)
17 Marshal.Copy (bytesrc, 2, dest, 10);
19 if (Marshal.ReadByte (dest, 0) != 2)
21 if (Marshal.ReadByte (dest, 9) != 11)
24 Marshal.Copy (dest, bytedest, 2, 10);
26 if (bytedest [2] != 2)
28 if (bytedest [11] != 11)