Exemple #1
0
        private void ReleaseUnmanagedResources()
        {
            if (_native == null)
            {
                return;
            }

            var native = _native;

            Native.fido_dev_info_free(&native, _capacity);
            _native = null;
        }
Exemple #2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="capacity">The maximum number of devices to search for</param>
        /// <exception cref="OutOfMemoryException" />
        /// <exception cref="CtapException">Thrown if an error occurs while enumerating the devices</exception>
        public FidoDeviceInfoList(int capacity)
        {
            _capacity = (UIntPtr)capacity;
            _native   = Native.fido_dev_info_new(_capacity);
            if (_native == null)
            {
                throw new OutOfMemoryException();
            }

            var olen = UIntPtr.Zero;

            Native.fido_dev_info_manifest(_native, _capacity, &olen).Check();
            _count = (int)olen;
        }
Exemple #3
0
 public FidoDeviceInfoEnumerator(fido_dev_info_t *native, int count)
 {
     _native = native;
     _count  = count;
 }