예제 #1
0
        public DdcInfo Ddc(out uint index)
        {
            index = 0;
            var size = Marshal.SizeOf(typeof(NativeDefinitions.G3XDDC_DDC_INFO));
            var ptr  = Marshal.AllocHGlobal(size);

            try
            {
                _radio.Check(_api.GetDdc1(_radio.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);
            }
        }