-
Notifications
You must be signed in to change notification settings - Fork 14
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
Not loading npcap
when WinPcap
and npcap
coexist.
#6
Comments
@spacemeowx2 Thank you for your report. I have done some debugging and research to better understand the problem. You are basically right - npcap when installed together with wpcap is installed in such a way that you cannot just open it using LoadLibrary(). This is unexpected. However my understanding is that it works OK when installed as the main library. We have two choices here. The first one is to assume that rawsock supports only "full" installation of npcap. The second one is to modify the code so that it loads npcap even when installed together with wpcap. My prefference is the second option but at the same time I can see it as a kind of costly change with relatively small value. Not many users will be using npcap together with wpcap and still strictly prefer the first one. Additionally I would like to first implement in dlopen a feature that would allow you to set dll search path from within the process in a portable way. I am not even sure if this is possible (maybe the setenv() function on POSIX will allow you to modify LD_LIBRARY_PATH variable, maybe not). So I will keep this issue as an low-priority enhancement and try to extend dlopen first. |
Blocked by: dlopen issue |
Is any workaround now? |
It seems that we prefer
npcap
. But whenWinPcap
andnpcap
coexist,rawsock
actually loadsWinPcap
.rust-rawsock/src/wpcap/paths.rs
Lines 3 to 8 in 53408bd
Since
Npcap\wpcap.dll
searchsPacket.dll
instead ofNpcap\Packet.dll
(could be seen using procmon), andNpcap\wpcap.dll
wouldn't load correctly with wrongPacket.dll
.And because what we need is
wpcap.dll
, I think allPacket.dll
could be removed from default paths.Solution:
I think it should be an issue about dlopen.
According to the document (
npcap-sdk-1.03/docs/npcap-devguide.html#npcap-feature-native
in npcap-sdk-1.03.zip), we need to callSetDllDirectory
to makewpcap.dll
loading rightdll
.The text was updated successfully, but these errors were encountered: