diff --git a/WindivertDotnet/Filter.cs b/WindivertDotnet/Filter.cs index c484974..82eadfb 100644 --- a/WindivertDotnet/Filter.cs +++ b/WindivertDotnet/Filter.cs @@ -53,11 +53,10 @@ private Filter(Expression> expression) } /// - /// 格式化filter + /// 尝试格式化filter /// /// - /// - /// + /// /// [SupportedOSPlatform("windows")] public unsafe static string Format(string filter, WinDivertLayer layer) @@ -70,8 +69,7 @@ public unsafe static string Format(string filter, WinDivertLayer layer) var ptr = new IntPtr(buffer); return Marshal.PtrToStringAnsi(ptr) ?? string.Empty; } - - throw new FormatException($"{nameof(filter)}格式不正确"); + return filter; } ///