From c67a5d55c2718bc6bedd03e1fb49b5978f67324e Mon Sep 17 00:00:00 2001 From: Joran Van Craenenbroeck Date: Fri, 24 Nov 2023 11:18:26 +0100 Subject: [PATCH] code smells --- SharpPcap/LibPcap/PcapDeviceCaptureLoop.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SharpPcap/LibPcap/PcapDeviceCaptureLoop.cs b/SharpPcap/LibPcap/PcapDeviceCaptureLoop.cs index f79a04da..445b3f40 100644 --- a/SharpPcap/LibPcap/PcapDeviceCaptureLoop.cs +++ b/SharpPcap/LibPcap/PcapDeviceCaptureLoop.cs @@ -175,7 +175,9 @@ protected virtual void CaptureThread(CancellationToken cancellationToken) continue; } + #pragma warning disable S3869 // "SafeHandle.DangerousGetHandle" should not be called int res = LibPcapSafeNativeMethods.pcap_dispatch(handle, m_pcapPacketCount, Callback, handle.DangerousGetHandle()); + #pragma warning restore S3869 // "SafeHandle.DangerousGetHandle" should not be called // pcap_dispatch() returns the number of packets read or, a status value if the value // is negative @@ -192,7 +194,9 @@ protected virtual void CaptureThread(CancellationToken cancellationToken) // from causing premature exiting from the capture loop we only consider // exhausted events to cause an escape from the loop when they are from // offline devices, ie. files read from disk + #pragma warning disable S3060 if (this is CaptureReaderDevice) + #pragma warning restore S3060 { SendCaptureStoppedEvent(CaptureStoppedEventStatus.CompletedWithoutError); return;