Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
For which Packet.dll calls can GetLastError() be used if the call fails? #1542
Somebody reported a "failed to set hardware filter to promiscuous mode)" error; that comes from a
libpcap currently doesn't call
This is a good question. We didn't try to convert the original Packet.dll documentation from Doxygen like we did for the rest of the guide, mostly because the original WinPcap developers avoided generating HTML docs from it and specifically noted that the Packet API is not intended to be used directly. Their reasoning was that end users should be using the libpcap API, and since they were essentially maintaining their own fork of libpcap 1.0.0, they could make any changes to Packet API that they saw fit because they'd just patch libpcap in the same release. Now that we're aiming for a pure upstream libpcap, it makes more sense to make the Packet API more understandable.
Initial quick scan shows the following:
In the specific case of
This is pretty typical from what I can see. There are a few places where an effort has been made to ensure the error is propagated, but mostly the only reliable source of info is the return value. I'd like to make this better, but I'm not sure how high a priority it is at the moment.
In the short term, do you know what might be causing
In the slightly longer term, we might want to have
In the longer term, yes, we should try to make it possible to get a Windows error, so that for some failures we can report more diagnostic information.