Ercument Eskar Ercument Eskar - 10 days ago 6
C# Question

NetFilter dll can not load

I download netfilter sdk demo and fallow the install instructions. NetFilter2.sys copied to system32\driver folder and register with nfregdrv.exe netfilter2 command. I did these steps with install.bat with run as admin rights.

When i compile and run Delphi sample everythings fine. But CSharp example doesn't build.


"System.DllNotFoundException: Unable to load DLL 'nfapi': The
specified module could not be found. (Exception from HRESULT:
0x80070007E)


in NFAPI.nf_init("netfilter2", m_eh) > nf_adjustProcessPriviledges();

nfapinet.dll added in project references. I didn't change filename netfilter2.sys. Delphi project can find in nf_init(PAnsiChar('netfilter2'), eh); line and working properly.

What i miss?

Answer

i ask to netfilter.com and Vitaly answer me. It's about debug mode. i select release and run succesfully. If you want to debug, you have to copy manually all required C++ dlls from the appropriate release_c_api folder.