Open cizekmilan opened 3 years ago
What is the code in your program that opens a device for capturing, and what is the code that compiles the filter?
Here is my pseudocode...
`public SnifferBW(ICaptureDevice device, string Filter, delegProcessPacket processPacket, frmPacketDisplay packetDisplay, frmSettings fSettings) { ... try { device.Open(DeviceMode.Promiscuous, 1000); device.Filter = Filter; } catch (Exception e) {
}
... }
ICaptureDevice d;
for (int i = 0; i < checkedIndices.Length; i++) // iteration over network adapters { d = allDevices[checkedIndices[i]]; // d is device/adapter // every network card has own thread bws[i] = new SnifferBW(d, "ether multicast and ether dst 01:00:0c:cc:cc:cc", ProcessPacket, this, fSettings); ... }`
So if device.Open()
fails, that will throw an exception before device.Filter = Filter;
, and will not try to set the filter?
Hi, i tested my sw based on Npcap and SharpPcap (C#) on some systems. Windows 10, Windows 8.1, all is OK. On Windows 7 32bit and Windows 7 64bit, I receive error Can't compile filter (https://snipboard.io/GjAdCh.jpg). When I unsintall npcap and install Winpcap instead, my program is working without errors.