예제 #1
0
        /// <summary>
        /// Setzt die Hardware zurück.
        /// </summary>
        public void Reset()
        {
            // Create property to set it
            var entity = new KsEntity {
                Set = CamControlIdentifier, Id = (UInt32)CAMControl.Reset, Flags = 1
            };

            // Process
            UInt32 processed;
            var    retcode = m_Method(ComInterface, ref entity, KsEntity.SizeOf, IntPtr.Zero, 0, out processed);

            if (retcode < 0)
            {
                throw new COMException("IKsControl.KsMethod", retcode);
            }
        }
예제 #2
0
        /// <summary>
        /// Aktiviert die Entschlüsselung.
        /// </summary>
        /// <param name="services">Die Liste aller zu entschlüsselnden Dienste.</param>
        public void SetServices(params ushort[] services)
        {
            // None
            if (services == null)
            {
                return;
            }
            if (services.Length < 1)
            {
                return;
            }

            // Report
            if (BDASettings.BDATraceSwitch.Enabled)
            {
                foreach (var service in services)
                {
                    Trace.WriteLine(string.Format(Properties.Resources.Trace_Decrypt, service), BDASettings.BDATraceSwitch.DisplayName);
                }
            }

            // Convert
            var identifiers = services.Select(s => (UInt32)s).ToArray();

            // Create property to set it
            var entity = new KsEntity {
                Set = CommonInterfaceIdentifier, Id = (UInt32)CommonInterface.Decrpyt, Flags = 2
            };

            // Process
            UInt32 processed;
            var    retcode = m_Property(ComInterface, ref entity, KsEntity.SizeOf, identifiers, identifiers.Length * sizeof(UInt32), out processed);

            if (retcode < 0)
            {
                throw new COMException("IKsControl.KsProperty", retcode);
            }
        }