I'm trying to write simple firewall that can drop packet by filter. For this purpose i'm use WinDivert. I'm load WinDivert.dll and add WinDivert.lib and WinDivert32.sys to project folder. Then i try use WinDivertOpen() to install WinDivertDriver. The result is always negative. What do I do wrong and how can I successfully install the driver? Code example.
I solved this problem in the following way. 1) In Project->Properties->Linker->Input->Additional Dependencies set path to WinDivert.lib . 2) Moved to root folder files WinDivert.dll and WinDivert32.sys. 3) Include windivert.h to my project. 4) Set my PC in TESTSIGNING Boot Configuration (Use for this Windows Driver Kit 7.1.0.). 5) Restart PC. If these steps did not help you should build WinDivert from sources with Windows Driver Kit 7.1.0. and Visual Studio 12 or higher as it is described here