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

Packet.dll routines should report errors if the helper process can't be run #1652

Open
guyharris opened this issue Jul 4, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@guyharris
Copy link

commented Jul 4, 2019

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() and PacketAddAdapterNPF() were to return FALSE for PacketOpenAdapterNPF() returning NULL and the error being any of the ShellExecuteExA() errors that mean "the helper couldn't be started" rather than meaning "there is no such adapter";
  • PacketGetAdaptersIPH(), PacketGetAdaptersNPF(), and PacketUpdateAdInfo() were to return FALSE if the corresponding PacketAddAdapterXXX() 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.

@guyharris guyharris changed the title What error is reported by Packet.dll if it can't run the helper process? Packet.dll routines should report errors if the helper process can't be run Jul 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.