private void SetMemoryCap(_MemoryCap m) { IntPtr buffer = Marshal.AllocHGlobal(Marshal.SizeOf(m)); Marshal.StructureToPtr(m, buffer, false); NativeMethods.fscc_set_memory_cap(this._handle, buffer); Marshal.FreeHGlobal(buffer); }
private _MemoryCap GetMemoryCap(_MemoryCap m) { IntPtr buffer = Marshal.AllocHGlobal(Marshal.SizeOf(m)); Marshal.StructureToPtr(m, buffer, false); NativeMethods.fscc_get_memory_cap(this._handle, buffer); m = (_MemoryCap)Marshal.PtrToStructure(buffer, typeof(_MemoryCap)); Marshal.FreeHGlobal(buffer); return(m); }