On Windows, build.rs emits cargo:rustc-link-lib=wpcap, producing a non-delay-loaded PE import for wpcap.dll.
Any binary depending on pcap therefore fails to load on Windows machines without Npcap — the OS rejects the process before main() runs (The code execution cannot proceed because wpcap.dll was not found).
This blocks several real deployment paths, most concretely winget: the validation infra runs the installed .exe in a clean Windows Sandbox without Npcap, so submissions get rejected with Validation-Executable-Error (see microsoft/winget-pkgs#369720 for Sniffnet).
It also prevents apps from showing a "please install Npcap" dialog at first launch, since they never reach main().
Repro: build any pcap-dependent binary for x86_64-pc-windows-msvc, run on a clean Windows box → loader error.
Proposed direction: switch from a static link to runtime dynamic loading of the capture library, with a structured error returned when the library isn't available.
All public APIs already return Result, so existing consumer code (Device::list()?,.unwrap_or_default(), etc.) would degrade gracefully without changes — and binaries would launch on any Windows machine regardless of whether Npcap is installed.
On Windows,
build.rsemitscargo:rustc-link-lib=wpcap, producing a non-delay-loaded PE import forwpcap.dll.Any binary depending on
pcaptherefore fails to load on Windows machines withoutNpcap— the OS rejects the process beforemain()runs (The code execution cannot proceed because wpcap.dll was not found).This blocks several real deployment paths, most concretely
winget: the validation infra runs the installed.exein a clean Windows Sandbox withoutNpcap, so submissions get rejected withValidation-Executable-Error(see microsoft/winget-pkgs#369720 for Sniffnet).It also prevents apps from showing a "please install
Npcap" dialog at first launch, since they never reachmain().Repro: build any
pcap-dependent binary forx86_64-pc-windows-msvc, run on a clean Windows box → loader error.Proposed direction: switch from a static link to runtime dynamic loading of the capture library, with a structured error returned when the library isn't available.
All public APIs already return
Result, so existing consumer code (Device::list()?,.unwrap_or_default(), etc.) would degrade gracefully without changes — and binaries would launch on any Windows machine regardless of whetherNpcapis installed.