public DdcInfo Ddc2Info(out uint index) { index = 0; var size = Marshal.SizeOf(typeof(NativeDefinitions.G3XDDC_DDC_INFO)); var ptr = Marshal.AllocHGlobal(size); try { Check(_api.GetDdc2(GetHandle(), ref index, ptr)); var nativeInfo = (NativeDefinitions.G3XDDC_DDC_INFO) Marshal.PtrToStructure(ptr, typeof(NativeDefinitions.G3XDDC_DDC_INFO)); return(new DdcInfo(nativeInfo)); } finally { Marshal.FreeHGlobal(ptr); } }