PCAPDLL constructor has alternative path for Npcap libraries when libicneo is build with LIBICSNEO_NPCAP_INCLUDE_DIR. There are two bugs in this path:
dllPath variable used for AddDllDirectory() is of type TCHAR [] but AddDllDirectory() expects LPWSTR so the string needs to be converted to wide string first.
LoadLibraryEx() uses LOAD_LIBRARY_SEARCH_USER_DIRS so it is unable to load other dependent modules. Proper flag should be LOAD_LIBRARY_SEARCH_DEFAULT_DIRS which includes both user and system paths to search.
PCAPDLL constructor has alternative path for Npcap libraries when libicneo is build with LIBICSNEO_NPCAP_INCLUDE_DIR. There are two bugs in this path: