Packet.dll routines should report errors if the service can't be started or the helper process can't be run
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.6k
- Forks
- 592
- PR merge metrics
- No merged PRs in 30d
Description
I was trying to debug a problem where libpcap's findalldevstest program wasn't returning any interfaces; the problem is that I needed to copy the helper executable into the run/Debug subdirectory of my libpcap build directory.
If:
NpcapStartHelper()were to return FALSE if the helper needed to be started but couldn't be started, and TRUE otherwise;PacketOpenAdapterNPF()were to return NULL if NpcapStartHelper()` returned FALSE;PacketAddAdapterIPH()andPacketAddAdapterNPF()were to return FALSE forPacketOpenAdapterNPF()returning NULL and the error being any of theShellExecuteExA()errors that mean "the helper couldn't be started" rather than meaning "there is no such adapter";PacketGetAdaptersIPH(),PacketGetAdaptersNPF(), andPacketUpdateAdInfo()were to return FALSE if the correspondingPacketAddAdapterXXX()routine failed with one of those errors;PacketPopulateAdaptersInfoList()were to do the same, and return a success/failure Boolean;
that would, I think, allow this.
This would also allow pcap_activate_npf() to return PCAP_ERROR_PERM_DENIED if a program tries to open an adapter, Npcap is in admin-only mode, and the user says "No" to the UAC prompt - and would also allow any future device-enumerating APIs to do so as well.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with findalldevstest and trace NpcapStartHelper(), PacketOpenAdapterNPF(), the PacketAddAdapterXXX(), PacketGetAdaptersXXX(), PacketUpdateAdInfo(), and PacketPopulateAdaptersInfoList() routines. Review how ShellExecuteExA() failures are currently handled. Done means helper-start failures propagate through adapter enumeration and pcap_activate_npf() can report permission denial when the UAC prompt is declined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100