Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NdisApi" /> class.
        /// </summary>
        /// <param name="handle">The filter driver handle.</param>
        protected NdisApi(SafeFilterDriverHandle handle)
        {
            Handle = handle;

            _ndisApiHelper       = new NdisApiHelper();
            _ethPacketsToMstcp   = _ndisApiHelper.CreateEthMRequest();
            _ethPacketsToAdapter = _ndisApiHelper.CreateEthMRequest();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NdisApi" /> class.
        /// </summary>
        /// <param name="handle">The filter driver handle.</param>
        /// <param name="driverNameBytes">The driver name bytes.</param>
        protected NdisApi(SafeFilterDriverHandle handle, byte[] driverNameBytes)
        {
            _driverNameBytes = driverNameBytes;
            Handle           = handle;

            _ndisApiHelper       = new NdisApiHelper();
            _ethPacketsToMstcp   = _ndisApiHelper.CreateEthMRequest();
            _ethPacketsToAdapter = _ndisApiHelper.CreateEthMRequest();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Reopens the filter driver.
        /// </summary>
        public void Reopen()
        {
            if (_driverNameBytes == null || _driverNameBytes.Length == 0)
            {
                throw new Exception("Missing driver name.");
            }


            Close();
            Handle = Native.NdisApi.OpenFilterDriver(_driverNameBytes);
        }