/// <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(); }
/// <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(); }
/// <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); }