mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
add option to build with Npcap on Windows
This commit is contained in:
@@ -27,6 +27,21 @@ bool PCAPDLL::ok() const
|
||||
|
||||
PCAPDLL::PCAPDLL()
|
||||
{
|
||||
#ifdef NPCAP
|
||||
BOOL(WINAPI * SetDllDirectory)(LPCTSTR);
|
||||
char sysdir_name[512];
|
||||
int len;
|
||||
SetDllDirectory = (BOOL(WINAPI*)(LPCTSTR)) GetProcAddress(GetModuleHandle("kernel32.dll"), "SetDllDirectoryA");
|
||||
if (SetDllDirectory != NULL)
|
||||
{
|
||||
len = GetSystemDirectory(sysdir_name, 480); // be safe
|
||||
if (len)
|
||||
{
|
||||
strcat(sysdir_name, "\\Npcap");
|
||||
SetDllDirectory(sysdir_name);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
dll = LoadLibrary("wpcap.dll");
|
||||
|
||||
if(dll == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user