public void Open()
        {
            var handle = WinDivertNative.WinDivertOpen(Filter, WinDivertLayer.Network, 0, 1);

            if (handle == IntPtr.Zero || handle == new IntPtr(-1))
            {
                ThrowLastWin32Error("Failed to open");
            }
            Handle = handle;
        }
Esempio n. 2
0
        public void Open()
        {
            var handle = WinDivertNative.WinDivertOpen(Filter, Layer, Priority, Flags);

            if (handle == IntPtr.Zero || handle == new IntPtr(-1))
            {
                ThrowLastWin32Error("Failed to open");
            }
            Handle = handle;
        }
Esempio n. 3
0
        public void Open(DeviceConfiguration configuration)
        {
            var handle = WinDivertNative.WinDivertOpen(Filter, Layer, Priority, Flags);

            if (handle == IntPtr.Zero || handle == new IntPtr(-1))
            {
                ThrowLastWin32Error("Failed to open");
            }
            Handle = handle;

            if (configuration.BufferSize > 0)
            {
                SetParam(WinDivertParam.QueueSize, (uint)configuration.BufferSize);
            }
        }