diff --git a/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs b/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs index 398c3b5..15284b6 100644 --- a/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs +++ b/FastGithub.PacketIntercept/Dns/DnsInterceptor.cs @@ -60,7 +60,7 @@ namespace FastGithub.PacketIntercept.Dns await Task.Yield(); var handle = WinDivert.WinDivertOpen(DNS_FILTER, WinDivertLayer.Network, 0, WinDivertOpenFlags.None); - if (handle == IntPtr.Zero) + if (handle == IntPtr.MaxValue || handle == IntPtr.Zero) { return; } diff --git a/FastGithub.PacketIntercept/Tcp/TcpInterceptor.cs b/FastGithub.PacketIntercept/Tcp/TcpInterceptor.cs index ef83e85..017d5c3 100644 --- a/FastGithub.PacketIntercept/Tcp/TcpInterceptor.cs +++ b/FastGithub.PacketIntercept/Tcp/TcpInterceptor.cs @@ -48,7 +48,7 @@ namespace FastGithub.PacketIntercept.Tcp await Task.Yield(); var handle = WinDivert.WinDivertOpen(this.filter, WinDivertLayer.Network, 0, WinDivertOpenFlags.None); - if (handle == IntPtr.Zero) + if (handle == IntPtr.MaxValue || handle == IntPtr.Zero) { return; }