From 6dfed99c2882c81478b43b657ad6ee00763339e8 Mon Sep 17 00:00:00 2001 From: basil00 Date: Mon, 26 Mar 2012 21:55:55 +0800 Subject: [PATCH] Build system revamp: - VS2010 support added via msvc-build.bat and *.vcxproj files - MinGW now also builds example programs - Documentation and examples are now included in the binary packages --- dll/divert.vcxproj | 49 +++++++++++++++++++++ examples/netdump/netdump.vcxproj | 46 +++++++++++++++++++ examples/netfilter/netfilter.vcxproj | 46 +++++++++++++++++++ examples/passthru/passthru.vcxproj | 46 +++++++++++++++++++ examples/webfilter/webfilter.vcxproj | 46 +++++++++++++++++++ msvc-build.bat | 66 ++++++++++++++++++++++++++++ 6 files changed, 299 insertions(+) create mode 100644 dll/divert.vcxproj create mode 100644 examples/netdump/netdump.vcxproj create mode 100644 examples/netfilter/netfilter.vcxproj create mode 100644 examples/passthru/passthru.vcxproj create mode 100644 examples/webfilter/webfilter.vcxproj create mode 100644 msvc-build.bat diff --git a/dll/divert.vcxproj b/dll/divert.vcxproj new file mode 100644 index 0000000..1ad2303 --- /dev/null +++ b/dll/divert.vcxproj @@ -0,0 +1,49 @@ + + + + + Release + x64 + + + Debug + x64 + + + Release + Win32 + + + Debug + Win32 + + + + DynamicLibrary + WinDivert + Release + + + + ..\include;%(AdditionalIncludeDirectories) + + + divert.def + + + + + True + + + False + + + + + + + + + + diff --git a/examples/netdump/netdump.vcxproj b/examples/netdump/netdump.vcxproj new file mode 100644 index 0000000..21768b4 --- /dev/null +++ b/examples/netdump/netdump.vcxproj @@ -0,0 +1,46 @@ + + + + + Release + x64 + + + Debug + x64 + + + Release + Win32 + + + Debug + Win32 + + + + Application + netdump + Release + + + + ..\..\include;%(AdditionalIncludeDirectories) + + + ws2_32.lib;..\..\dll\Release\WinDivert.lib + + + + + True + + + False + + + + + + + diff --git a/examples/netfilter/netfilter.vcxproj b/examples/netfilter/netfilter.vcxproj new file mode 100644 index 0000000..5b32844 --- /dev/null +++ b/examples/netfilter/netfilter.vcxproj @@ -0,0 +1,46 @@ + + + + + Release + x64 + + + Debug + x64 + + + Release + Win32 + + + Debug + Win32 + + + + Application + netfilter + Release + + + + ..\..\include;%(AdditionalIncludeDirectories) + + + ws2_32.lib;..\..\dll\Release\WinDivert.lib + + + + + True + + + False + + + + + + + diff --git a/examples/passthru/passthru.vcxproj b/examples/passthru/passthru.vcxproj new file mode 100644 index 0000000..5c1d9b2 --- /dev/null +++ b/examples/passthru/passthru.vcxproj @@ -0,0 +1,46 @@ + + + + + Release + x64 + + + Debug + x64 + + + Release + Win32 + + + Debug + Win32 + + + + Application + passthru + Release + + + + ..\..\include;%(AdditionalIncludeDirectories) + + + ws2_32.lib;..\..\dll\Release\WinDivert.lib + + + + + True + + + False + + + + + + + diff --git a/examples/webfilter/webfilter.vcxproj b/examples/webfilter/webfilter.vcxproj new file mode 100644 index 0000000..53732ca --- /dev/null +++ b/examples/webfilter/webfilter.vcxproj @@ -0,0 +1,46 @@ + + + + + Release + x64 + + + Debug + x64 + + + Release + Win32 + + + Debug + Win32 + + + + Application + webfilter + Release + + + + ..\..\include;%(AdditionalIncludeDirectories) + + + ws2_32.lib;..\..\dll\Release\WinDivert.lib + + + + + True + + + False + + + + + + + diff --git a/msvc-build.bat b/msvc-build.bat new file mode 100644 index 0000000..1879865 --- /dev/null +++ b/msvc-build.bat @@ -0,0 +1,66 @@ +:: msvc-build.bat +:: (C) 2012, all rights reserved, +:: +:: This program is free software: you can redistribute it and/or modify +:: it under the terms of the GNU Lesser General Public License as published by +:: the Free Software Foundation, either version 3 of the License, or +:: (at your option) any later version. +:: +:: This program is distributed in the hope that it will be useful, +:: but WITHOUT ANY WARRANTY; without even the implied warranty of +:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +:: GNU Lesser General Public License for more details. +:: +:: You should have received a copy of the GNU Lesser General Public License +:: along with this program. If not, see . +:: +:: Script for MSVC (Microsoft Visual Studio 2010) compilation. +:: NOTE: run wddk-build.bat before this script. + +@echo off + +set WDDK_INSTALL=install\WDDK\i386\ +set MSVC_INSTALL=install\MSVC\i386\ + +if not exist %WDDK_INSTALL% ( + echo ERROR: Missing WDDK build; run wddk-build.bat first + exit /B +) +mkdir %MSVC_INSTALL% + +:: Build WinDivert.dll +cd dll +msbuild +copy /Y Release\WinDivert.dll ..\%MSVC_INSTALL% +copy /Y Release\WinDivert.lib ..\%MSVC_INSTALL% +cd .. + +:: Build netdump +cd examples\netdump +msbuild +copy /Y Release\netdump.exe ..\..\%MSVC_INSTALL% +cd ..\.. + +:: Build netfilter +cd examples\netfilter +msbuild +copy /Y Release\netfilter.exe ..\..\%MSVC_INSTALL% +cd ..\.. + +:: Build passthru +cd examples\passthru +msbuild +copy /Y Release\passthru.exe ..\..\%MSVC_INSTALL% +cd ..\.. + +:: Build webfilter +cd examples\webfilter +msbuild +copy /Y Release\webfilter.exe ..\..\%MSVC_INSTALL% +cd ..\.. + +:: Copy files +copy /Y %WDDK_INSTALL%\WinDivert.sys %MSVC_INSTALL% +copy /Y %WDDK_INSTALL%\WinDivert.inf %MSVC_INSTALL% +copy /Y %WDDK_INSTALL%\WdfCoInstaller*.dll %MSVC_INSTALL% +