From 324c9a191f8bcc0874c35749b763c472a5ee65d3 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 30 Dec 2018 15:49:29 -0500 Subject: [PATCH] win32 - support for npcap which is a successor to winpcap. winpcap is still supported. --- src/rawnet/rawnetarch_win32.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/rawnet/rawnetarch_win32.c b/src/rawnet/rawnetarch_win32.c index 3a2655c..81d5b4b 100644 --- a/src/rawnet/rawnetarch_win32.c +++ b/src/rawnet/rawnetarch_win32.c @@ -138,7 +138,21 @@ static void EthernetPcapFreeLibrary(void) static BOOL EthernetPcapLoadLibrary(void) { + /* + * npcap is c:\System32\Npcap\wpcap.dll + * winpcap is c:\System32\wpcap.dll + * + */ if (!pcap_library) { + /* This inserts c:\System32\Npcap\ into the search path. */ + char buffer[512]; + unsigned length; + length = GetSystemDirectory(buffer, sizeof(buffer) - sizeof("\\Npcap")); + if (length) { + strcat(buffer + length, "\\Npcap"); + SetDllDirectory(buffer); + } + pcap_library = LoadLibrary(TEXT("wpcap.dll")); if (!pcap_library) {