private static IntPtr allocGlobal(int size) { IntPtr memPtr = Marshal.AllocHGlobal(size); return memPtr; }