win32: pcapif: ensure we can run with npcap as well

By default, npcap keeps its DLLs not in system32 but in system32/npcap.
To load DLLs from there, mark them as "delay load DLLs" and adjust the
DLL search path before using/loading them.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Simon Goldschmidt
2023-06-29 22:11:55 +02:00
parent bfcbf80221
commit 1a5dffb931
4 changed files with 38 additions and 0 deletions

View File

@@ -85,6 +85,7 @@
<TargetMachine>MachineX86</TargetMachine>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>$(TargetDir)$(TargetName).map</MapFileName>
<DelayLoadDLLs>Packet.dll;wpcap.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -125,6 +126,7 @@
<TargetMachine>MachineX86</TargetMachine>
<GenerateMapFile>false</GenerateMapFile>
<MapFileName>$(TargetDir)$(TargetName).map</MapFileName>
<DelayLoadDLLs>Packet.dll;wpcap.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
</ItemDefinitionGroup>
<ItemGroup>