Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test programs fail to run on Windows as "C:\WINDOWS\system32\Npcap\Packet.dll" is not in path #1368

Open
AndersBroman opened this issue Oct 12, 2024 · 5 comments
Labels

Comments

@AndersBroman
Copy link
Contributor

Built on windows with Visual Studio 2022, NPCAP SDK 1.13 and NPCAP 1.79 installed. Build works fine but when trying to run testprogram run\RelWithDebInfo\findalldevstest.exe it complains the packet.dll is missing.

Either packet-dll should be copied to run dir from "C:\WINDOWS\system32\Npcap\Packet.dll" or maybe mention to add to PATH or
copy manually in doc
/README.windows.md

@guyharris
Copy link
Member

Is there a packet.dll in C;\Windows\System32 (i.e., in the top-level system DLL directory, as well as in C:\Windows\System32\Npcap)?

If not, you probably installed Npcap with "WinPcap API-compatible Mode" disabled. (It's enabled by default; as I understand it, it only needs to be enabled if you have a program on your system that's built with WinPcap and aren't certain that it will work with Npcap, and have WinPcap installed for it, so you want to ensure that that program will run with WinPcap rather than with Npcap, so you don't install Npcap's DLLs into the system DLL directory, just into its Npcap subdirectory. @bonsaiviking , is that what disabling "WinPcap API-compatible Mode" is for?)

If so, that means this is probably the same problem as in the-tcpdump-group/tcpdump#1226, and requires that the same change be made to the test programs and their build procedure as in the-tcpdump-group/tcpdump#1227.

See https://npcap.com/guide/npcap-devguide.html#npcap-feature-native-dll-implicitly for details.

@AndersBroman
Copy link
Contributor Author

AndersBroman commented Oct 12, 2024

No packet.dll in C;\Windows\System32.
I actually "used" the default instalation of NPCAP by Wireshark.

@infrastation infrastation changed the title Test proghrams fail to run on Windows as "C:\WINDOWS\system32\Npcap\Packet.dll" is not in path Test programs fail to run on Windows as "C:\WINDOWS\system32\Npcap\Packet.dll" is not in path Oct 12, 2024
@guyharris
Copy link
Member

I actually "used" the default instalation of NPCAP by Wireshark.

...which shows the installation options dialog with all three items unchecked ("require Administrator access", "support monitor mode on 802.11 adapters", and "install in WinPcap API-compatible Mode"), so it defaults to not installing the DLLs in C:\Windows\System32.

@AndersBroman
Copy link
Contributor Author

Is it time to ditch winpcap and airpcap? Not sure how useful airpcap is these days with new wifi standards.

@guyharris
Copy link
Member

Is it time to ditch winpcap and airpcap?

Ditching WinPcap support from tcpdump won't help this issue; ditching from Npcap support for applications that might require WinPcap, by always installing the DLLs in C:\Windows\system32, would.

Ditching it from libpcap, in the sense of no longer supporting building libpcap with the WinPcap version of packet.dll, also wouldn't help this issue; it'd be more of "removing tired old code", similar to dropping support for the old Linux PF_INET/SOCK_PACKET sockets and for non-memory-mapped capture on Linux PF_PACKET sockets.

I'll address airpcap in the libpcap issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants