From patchwork Fri Sep 28 03:26:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 472 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director12.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id APsaDfQsrlsTagAAIUCqbw for ; Fri, 28 Sep 2018 09:30:28 -0400 Received: from proxy4.mail.ord1d.rsapps.net ([172.30.191.6]) by director12.mail.ord1d.rsapps.net with LMTP id UE6HDPQsrlvQBwAAIasKDg ; Fri, 28 Sep 2018 09:30:28 -0400 Received: from smtp37.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy4.mail.ord1d.rsapps.net with LMTP id IA4WDPQsrltsdwAAiYrejw ; Fri, 28 Sep 2018 09:30:28 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp37.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: a921f7cc-c322-11e8-a5f2-525400a11cf3-1-1 Received: from [216.105.38.7] ([216.105.38.7:8303] helo=lists.sourceforge.net) by smtp37.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 20/CB-26729-3FC2EAB5; Fri, 28 Sep 2018 09:30:27 -0400 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1g5spS-0008ST-Ef; Fri, 28 Sep 2018 13:29:10 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1g5spQ-0008SN-UA for openvpn-devel@lists.sourceforge.net; Fri, 28 Sep 2018 13:29:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KvQLzIshmowNaeqT0vfVp9JQ5AF66NMThMGhRJjm78A=; b=BS5Rw6x9AyN3F10i/iRBYvxHm8 nPnTVRCh2+sRUrc6ZshZbCk+izySZDms5rpLRcVOvttIHTT8gKKADoWZb3ysCD/6W5AKXbbhgBsl2 hDS2dPiJBs53mazxyTeARunJ2k/vWfIh+gsTfFutofm+SgnUXMIz4Gqc1OR8Hng0OpcM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date: Subject:To:From:Sender:Reply-To:Cc:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=KvQLzIshmowNaeqT0vfVp9JQ5AF66NMThMGhRJjm78A=; b=i l+8+UwxjbpfH1qUjp9gbYvSHhNb6rYMQ7Wee2Wilb56SZozjuiim86lzdD+QoGHs50DY9HS8whC6d f8vDKpRmPqXmUU21JEkeNPea5l9jyv+c1BYt2nYxanRIu7ivezUCgr4IgjTOcjpqBxuoDsL8ulC5E 0Jn28TISyVWsfKx0=; Received: from mail-ed1-f54.google.com ([209.85.208.54]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) id 1g5spN-008THV-LW for openvpn-devel@lists.sourceforge.net; Fri, 28 Sep 2018 13:29:08 +0000 Received: by mail-ed1-f54.google.com with SMTP id b20-v6so8171459edr.9 for ; Fri, 28 Sep 2018 06:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=KvQLzIshmowNaeqT0vfVp9JQ5AF66NMThMGhRJjm78A=; b=B/dxTiepixmSCh4X3YXyL7CmyP/gpSIDOkNYEuKQyxSI80xf/2ptd9odx0JBd6t4/r C/r68PFamldBDraKfZKIOafeSYnsXo82MrfQeiNhRzQg3VIAVwaLHEoLyALRpX0FDo+j KGUHFOY0upcyjLqU43BLMrGqR7BsFx8Q8NYHLF59/3Mh2hVx6p7GEqiU3GAZ8tfap1Jr vo+jv7ufCpB0eMzoNnbbVdn5g0uMPJTT2/NHPkhLkrNqRhvYzBNwzR5l72X4JcbYSArZ 5FdGRwFnmgJ3zLC80Jm6sQKfpvLYFlLFA3970LXmtwSVad8XqqkD6k8AOLcsqGgnUiEB 3shw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=KvQLzIshmowNaeqT0vfVp9JQ5AF66NMThMGhRJjm78A=; b=cV76meKC2ro1UPrxNlXiebqkMl0aOf+YARByTCJLAzOxemsaGsoALAAaJNB+uUkG9K opFClupMQwS66ukKxcy8HAQ2i+x732yWvIScie6k9j+Pc6MpZEuvhZkbmdRk0qH19PEP uL0XYKkXIGxRc5HvCBEFiXCSeuBA/+BA7FFALNLZJdvnQBHlAE5uCJ51q3A00Koc7fLL +X1QlvDJ5IwhfqjARER2tWlLYj1/3ymHFS3h4nWVIkNzpA1AuQU1y5PjH/tpi+YzlmDQ MSxnsMGBlQRbRK8vPOKVB0mi/4wtA5zi0PSRB7r8zwmdSgpowFxB/VgHNG4c/+HPMyyr YsoA== X-Gm-Message-State: ABuFfojPVIWH+pfGF+GL2+uGLBGhA8yWTVIczPeqj8NZpYJSnTAglxvz axhVF0cxzjyA5NftJ8rfiTPH39pnQ3s= X-Google-Smtp-Source: ACcGV61jeuku3qGYQ3iS4qBkOChmN/vLRVVKNuL7prq26AH/c7yAEKG2npv6H4ESNVF5crG0FFA7Ww== X-Received: by 2002:a17:906:3915:: with SMTP id f21-v6mr2410165eje.159.1538141337924; Fri, 28 Sep 2018 06:28:57 -0700 (PDT) Received: from stipakov.fi (stipakov.fi. [128.199.52.117]) by smtp.gmail.com with ESMTPSA id z13-v6sm1981269edq.91.2018.09.28.06.28.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Sep 2018 06:28:56 -0700 (PDT) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Fri, 28 Sep 2018 16:26:49 +0300 Message-Id: <1538141209-32330-1-git-send-email-lstipakov@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lstipakov[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.54 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.208.54 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-Headers-End: 1g5spN-008THV-LW Subject: [Openvpn-devel] [PATCH] win: support for Visual Studio 2017 X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Lev Stipakov This patch enables building openvpn with Visual Studio 2017. It is advised to use openvpn-build/msvs/build.bat which also downloads and build required dependencies. Changes made: - updated path to Visual Studio toolchain - updated platform toolset - added missing libraries - added x64 configurations - enabled AEAD ciphers to make NCP work - enabled unicode support - updated source files in project settings - fix includes - restored variable which was erroneously removed - added properties file which sets required env variables (required to build with IDE) - etc Signed-off-by: Lev Stipakov Acked-by: Simon Rozman --- AppVeyor build with cygwin and VS2017: https://ci.appveyor.com/project/lstipakov/openvpn-build/build/openvpn-build-19 build/msvc/msvc-generate/msvc-generate.vcxproj | 51 +++++++++++++- config-msvc.h | 1 + msvc-build.bat | 6 +- msvc-dev.bat | 2 + msvc-env.bat | 6 +- openvpn.sln | 27 ++++++- src/compat/PropertySheet.props | 40 +++++++++++ src/compat/compat.vcxproj | 65 ++++++++++++++++- src/openvpn/openvpn.vcxproj | 97 +++++++++++++++++++++++-- src/openvpn/syshead.h | 1 + src/openvpnserv/interactive.c | 1 - src/openvpnserv/openvpnserv.vcxproj | 98 ++++++++++++++++++++++++-- src/openvpnserv/service.h | 1 + src/openvpnserv/validate.c | 3 + 14 files changed, 375 insertions(+), 24 deletions(-) create mode 100644 src/compat/PropertySheet.props diff --git a/build/msvc/msvc-generate/msvc-generate.vcxproj b/build/msvc/msvc-generate/msvc-generate.vcxproj index 8b7ec22..72d310a 100644 --- a/build/msvc/msvc-generate/msvc-generate.vcxproj +++ b/build/msvc/msvc-generate/msvc-generate.vcxproj @@ -1,35 +1,64 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {8598C2C8-34C4-47A1-99B0-7C295A890615} msvc-generate MakeFileProj + 10.0.17134.0 Makefile + v141 + + + Makefile + v141 Makefile + v141 + + + Makefile + v141 + + + + + + + + + + @@ -37,25 +66,43 @@ $(Configuration)\ $(Configuration)\ nmake -f Makefile.mak all + nmake -f Makefile.mak all nmake -f Makefile.mak clean all + nmake -f Makefile.mak clean all nmake -f Makefile.mak clean + nmake -f Makefile.mak clean config-msvc-version.h + config-msvc-version.h WIN32;_DEBUG;$(NMakePreprocessorDefinitions) + WIN32;_DEBUG;$(NMakePreprocessorDefinitions) $(NMakeIncludeSearchPath) + $(NMakeIncludeSearchPath) $(NMakeForcedIncludes) + $(NMakeForcedIncludes) $(NMakeAssemblySearchPath) + $(NMakeAssemblySearchPath) $(NMakeForcedUsingAssemblies) + $(NMakeForcedUsingAssemblies) $(Configuration)\ $(Configuration)\ nmake -f Makefile.mak all + nmake -f Makefile.mak all nmake -f Makefile.mak clean all + nmake -f Makefile.mak clean all nmake -f Makefile.mak clean + nmake -f Makefile.mak clean config-msvc-version.h + config-msvc-version.h WIN32;NDEBUG;$(NMakePreprocessorDefinitions) + WIN32;NDEBUG;$(NMakePreprocessorDefinitions) $(NMakeIncludeSearchPath) + $(NMakeIncludeSearchPath) $(NMakeForcedIncludes) + $(NMakeForcedIncludes) $(NMakeAssemblySearchPath) + $(NMakeAssemblySearchPath) $(NMakeForcedUsingAssemblies) + $(NMakeForcedUsingAssemblies) @@ -66,4 +113,4 @@ - \ No newline at end of file + diff --git a/config-msvc.h b/config-msvc.h index 8be9195..45fae8b 100644 --- a/config-msvc.h +++ b/config-msvc.h @@ -5,6 +5,7 @@ #define ENABLE_DEF_AUTH 1 #define ENABLE_PF 1 #define ENABLE_CRYPTO_OPENSSL 1 +#define HAVE_AEAD_CIPHER_MODES 1 #define ENABLE_DEBUG 1 #define ENABLE_EUREPHIA 1 #define ENABLE_FRAGMENT 1 diff --git a/msvc-build.bat b/msvc-build.bat index fd6d558..8256c62 100644 --- a/msvc-build.bat +++ b/msvc-build.bat @@ -7,13 +7,15 @@ setlocal ENABLEDELAYEDEXPANSION cd /d %0\.. call msvc-env.bat -set PLATFORMS=Win32 -set CONFIGURATIONS=Release +set PLATFORMS=x64 +set CONFIGURATIONS=Debug Release if exist "%VCHOME%\vcvarsall.bat" ( call "%VCHOME%\vcvarsall.bat" ) else if exist "%VCHOME%\bin\vcvars32.bat" ( call "%VCHOME%\bin\vcvars32.bat" +) else if exist "%VCHOME%\Auxiliary\Build\vcvars32.bat" ( + call "%VCHOME%\Auxiliary\Build\vcvars32.bat" ) else ( echo Cannot detect visual studio goto error diff --git a/msvc-dev.bat b/msvc-dev.bat index dbd7be0..74aee0b 100644 --- a/msvc-dev.bat +++ b/msvc-dev.bat @@ -8,6 +8,8 @@ if exist "%VSHOME%\Common7\IDE\VCExpress.exe" ( set IDE=%VSHOME%\Common7\IDE\VCExpress.exe ) else if exist "%VSHOME%\Common7\IDE\devenv.exe" ( set IDE=%VSHOME%\Common7\IDE\devenv.exe +) else if exist "%VCHOME%\Auxiliary\Build\vcvars64.bat" ( + call "%VCHOME%\Auxiliary\Build\vcvars64.bat" ) else ( echo "Cannot detect visual studio environment" goto error diff --git a/msvc-env.bat b/msvc-env.bat index aabed75..cc9663d 100644 --- a/msvc-env.bat +++ b/msvc-env.bat @@ -4,8 +4,8 @@ rem Put your own settings at msvc-env-local.bat if exist msvc-env-local.bat call msvc-env-local.bat if "%ProgramFiles(x86)%"=="" set ProgramFiles(x86)=%ProgramFiles% -if "%VSCOMNTOOLS%"=="" SET VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\Common7\Tools -if "%VSCOMNTOOLS%"=="" SET VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\Tools +if "%VSCOMNTOOLS%"=="" set VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\Common7\Tools +if not exist "%VSCOMNTOOLS%" set VSCOMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools if "%VSHOME%"=="" SET VSHOME=%VSCOMNTOOLS%\..\.. if "%VCHOME%"=="" SET VCHOME=%VSHOME%\VC @@ -13,7 +13,7 @@ set SOURCEBASE=%cd% set SOLUTION=openvpn.sln set CPPFLAGS=%CPPFLAGS%;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS set CPPFLAGS=%CPPFLAGS%;NTDDI_VERSION=NTDDI_VISTA;_WIN32_WINNT=_WIN32_WINNT_VISTA -set CPPFLAGS=%CPPFLAGS%;_USE_32BIT_TIME_T +set CPPFLAGS=%CPPFLAGS%; set CPPFLAGS=%CPPFLAGS%;%EXTRA_CPPFLAGS% if exist config-msvc-local.h set CPPFLAGS="%CPPFLAGS%;HAVE_CONFIG_MSVC_LOCAL_H" diff --git a/openvpn.sln b/openvpn.sln index 90c01b8..51fdaf0 100644 --- a/openvpn.sln +++ b/openvpn.sln @@ -1,6 +1,8 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2026 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpnserv", "src\openvpnserv\openvpnserv.vcxproj", "{9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvpn", "src\openvpn\openvpn.vcxproj", "{29DF226E-4D4E-440F-ADAF-5829CFD4CA94}" @@ -12,27 +14,48 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.ActiveCfg = Debug|Win32 {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|Win32.Build.0 = Debug|Win32 + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|x64.ActiveCfg = Debug|x64 + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Debug|x64.Build.0 = Debug|x64 {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.ActiveCfg = Release|Win32 {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|Win32.Build.0 = Release|Win32 + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|x64.ActiveCfg = Release|x64 + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD}.Release|x64.Build.0 = Release|x64 {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.ActiveCfg = Debug|Win32 {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|Win32.Build.0 = Debug|Win32 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|x64.ActiveCfg = Debug|x64 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Debug|x64.Build.0 = Debug|x64 {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.ActiveCfg = Release|Win32 {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|Win32.Build.0 = Release|Win32 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|x64.ActiveCfg = Release|x64 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94}.Release|x64.Build.0 = Release|x64 {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.ActiveCfg = Debug|Win32 {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|Win32.Build.0 = Debug|Win32 + {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|x64.ActiveCfg = Debug|x64 + {8598C2C8-34C4-47A1-99B0-7C295A890615}.Debug|x64.Build.0 = Debug|x64 {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.ActiveCfg = Release|Win32 {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|Win32.Build.0 = Release|Win32 + {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|x64.ActiveCfg = Release|x64 + {8598C2C8-34C4-47A1-99B0-7C295A890615}.Release|x64.Build.0 = Release|x64 {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.ActiveCfg = Debug|Win32 {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|Win32.Build.0 = Debug|Win32 + {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|x64.ActiveCfg = Debug|x64 + {4B2E2719-E661-45D7-9203-F6F456B22F19}.Debug|x64.Build.0 = Debug|x64 {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.ActiveCfg = Release|Win32 {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|Win32.Build.0 = Release|Win32 + {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|x64.ActiveCfg = Release|x64 + {4B2E2719-E661-45D7-9203-F6F456B22F19}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {EB3CE5D3-415C-46F0-96AB-E1CDA287AB6D} + EndGlobalSection EndGlobal diff --git a/src/compat/PropertySheet.props b/src/compat/PropertySheet.props new file mode 100644 index 0000000..97d3a3b --- /dev/null +++ b/src/compat/PropertySheet.props @@ -0,0 +1,40 @@ + + + + + $(SolutionDir) + $(SOURCEBASE)\..\..\image + $(OPENVPN_DEPROOT) + $(OPENVPN_DEPROOT) + $(OPENVPN_DEPROOT) + $(OPENVPN_DEPROOT) + + + + + + $(SOURCEBASE) + true + + + $(OPENVPN_DEPROOT) + true + + + $(OPENSSL_HOME) + true + + + $(TAP_WINDOWS_HOME) + true + + + $(LZO_HOME) + true + + + $(PKCS11H_HOME) + true + + + \ No newline at end of file diff --git a/src/compat/compat.vcxproj b/src/compat/compat.vcxproj index d2695e6..07d6baf 100644 --- a/src/compat/compat.vcxproj +++ b/src/compat/compat.vcxproj @@ -1,47 +1,79 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {4B2E2719-E661-45D7-9203-F6F456B22F19} compat Win32Proj + 10.0.17134.0 StaticLibrary MultiByte true - v120 + v141 + + + StaticLibrary + MultiByte + true + v141 StaticLibrary MultiByte - v120 + v141 + + + StaticLibrary + MultiByte + v141 + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(SolutionDir)$(Platform)-Output\$(Configuration)\ $(Configuration)\ $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(SolutionDir)$(Platform)-Output\$(Configuration)\ $(Configuration)\ @@ -58,6 +90,19 @@ EditAndContinue + + + Disabled + $(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + MaxSpeed @@ -72,6 +117,20 @@ ProgramDatabase + + + MaxSpeed + true + $(SOURCEBASE);$(SOURCEBASE)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_LIB;$(CPPFLAGS);%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + diff --git a/src/openvpn/openvpn.vcxproj b/src/openvpn/openvpn.vcxproj index d1c0fde..e0da69f 100644 --- a/src/openvpn/openvpn.vcxproj +++ b/src/openvpn/openvpn.vcxproj @@ -1,50 +1,84 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {29DF226E-4D4E-440F-ADAF-5829CFD4CA94} openvpn Win32Proj + 10.0.17134.0 Application true Unicode - v120 + v141 + + + Application + true + Unicode + v141 Application Unicode - v120 + v141 + + + Application + Unicode + v141 + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(SolutionDir)$(Platform)-Output\$(Configuration)\ $(Configuration)\ true + true $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(SolutionDir)$(Platform)-Output\$(Configuration)\ $(Configuration)\ false + false @@ -64,13 +98,36 @@ $(SOURCEBASE);%(AdditionalIncludeDirectories) - libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;Fwpuclnt.lib;Rpcrt4.lib;%(AdditionalDependencies) + legacy_stdio_definitions.lib;Ncrypt.lib;libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;Fwpuclnt.lib;Rpcrt4.lib;%(AdditionalDependencies) $(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories) true Console MachineX86 + + + Disabled + $(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + UNICODE + + + $(SOURCEBASE);%(AdditionalIncludeDirectories) + + + legacy_stdio_definitions.lib;Ncrypt.lib;libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;Fwpuclnt.lib;Rpcrt4.lib;%(AdditionalDependencies) + $(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories) + true + Console + + MaxSpeed @@ -89,7 +146,7 @@ $(SOURCEBASE);%(AdditionalIncludeDirectories) - libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;Fwpuclnt.lib;Rpcrt4.lib;%(AdditionalDependencies) + legacy_stdio_definitions.lib;Ncrypt.lib;libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;Fwpuclnt.lib;Rpcrt4.lib;%(AdditionalDependencies) $(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories) true Console @@ -98,6 +155,32 @@ MachineX86 + + + MaxSpeed + true + $(SOURCEBASE);$(SOURCEBASE)/src/compat;$(SOURCEBASE)/include;$(TAP_WINDOWS_HOME)/include;$(OPENSSL_HOME)/include;$(LZO_HOME)/include;$(PKCS11H_HOME)/include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + UNICODE + + + $(SOURCEBASE);%(AdditionalIncludeDirectories) + + + legacy_stdio_definitions.lib;Ncrypt.lib;libeay32.lib;ssleay32.lib;lzo2.lib;pkcs11-helper.dll.lib;gdi32.lib;ws2_32.lib;wininet.lib;crypt32.lib;iphlpapi.lib;winmm.lib;Fwpuclnt.lib;Rpcrt4.lib;%(AdditionalDependencies) + $(OPENSSL_HOME)/lib;$(LZO_HOME)/lib;$(PKCS11H_HOME)/lib;%(AdditionalLibraryDirectories) + true + Console + true + true + + @@ -112,6 +195,7 @@ + @@ -156,6 +240,7 @@ + @@ -189,6 +274,7 @@ + @@ -240,6 +326,7 @@ + diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index e83f9a3..ced7fdc 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -47,6 +47,7 @@ #ifdef _MSC_VER /* Visual Studio */ #define __func__ __FUNCTION__ #define __attribute__(x) +#include #endif #if defined(__APPLE__) diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index 861f5e7..9d459a6 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -24,7 +24,6 @@ #include "service.h" -#include #include #include #include diff --git a/src/openvpnserv/openvpnserv.vcxproj b/src/openvpnserv/openvpnserv.vcxproj index c6760da..9098920 100644 --- a/src/openvpnserv/openvpnserv.vcxproj +++ b/src/openvpnserv/openvpnserv.vcxproj @@ -1,55 +1,89 @@  - + Debug Win32 + + Debug + x64 + Release Win32 + + Release + x64 + {9C91EE0B-817D-420A-A1E6-15A5A9D98BAD} openvpnserv Win32Proj + 10.0.17134.0 Application MultiByte true - v120 + v141 + + + Application + MultiByte + true + v141 Application MultiByte - v120 + v141 + + + Application + Unicode + v141 + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(SolutionDir)$(Platform)-Output\$(Configuration)\ $(Configuration)\ true + true $(SolutionDir)$(Platform)-Output\$(Configuration)\ + $(SolutionDir)$(Platform)-Output\$(Configuration)\ $(Configuration)\ false + false Disabled - $(SOURCEBASE);%(AdditionalIncludeDirectories) + $(SOURCEBASE);..\..\include;..\openvpn;..\compat;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) true EnableFastChecks @@ -63,16 +97,38 @@ $(SOURCEBASE);%(AdditionalIncludeDirectories) + Userenv.lib;Iphlpapi.lib;ntdll.lib;Fwpuclnt.lib;Netapi32.lib;Shlwapi.lib;%(AdditionalDependencies) true Console MachineX86 + + + Disabled + $(SOURCEBASE);..\..\include;..\openvpn;..\compat;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + ProgramDatabase + + + $(SOURCEBASE);%(AdditionalIncludeDirectories) + + + legacy_stdio_definitions.lib;Userenv.lib;Iphlpapi.lib;ntdll.lib;Fwpuclnt.lib;Netapi32.lib;Shlwapi.lib;%(AdditionalDependencies) + true + Console + + MaxSpeed true - $(SOURCEBASE);%(AdditionalIncludeDirectories) + $(SOURCEBASE);..\..\include;..\openvpn;..\compat;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;$(CPPFLAGS);%(PreprocessorDefinitions) MultiThreadedDLL true @@ -85,6 +141,7 @@ $(SOURCEBASE);%(AdditionalIncludeDirectories) + Userenv.lib;Iphlpapi.lib;ntdll.lib;Fwpuclnt.lib;Netapi32.lib;Shlwapi.lib;%(AdditionalDependencies) true Console true @@ -92,12 +149,41 @@ MachineX86 + + + MaxSpeed + true + $(SOURCEBASE);..\..\include;..\openvpn;..\compat;%(AdditionalIncludeDirectories) + MultiThreadedDLL + true + + + Level3 + ProgramDatabase + + + $(SOURCEBASE);%(AdditionalIncludeDirectories) + + + legacy_stdio_definitions.lib;Userenv.lib;Iphlpapi.lib;ntdll.lib;Fwpuclnt.lib;Netapi32.lib;Shlwapi.lib;%(AdditionalDependencies) + true + Console + true + true + + - + + + + + + + diff --git a/src/openvpnserv/service.h b/src/openvpnserv/service.h index af8f37f..4d03b88 100644 --- a/src/openvpnserv/service.h +++ b/src/openvpnserv/service.h @@ -30,6 +30,7 @@ #include "config-msvc.h" #endif +#include #include #include #include diff --git a/src/openvpnserv/validate.c b/src/openvpnserv/validate.c index 653bd12..91c6a2b 100644 --- a/src/openvpnserv/validate.c +++ b/src/openvpnserv/validate.c @@ -61,6 +61,9 @@ CheckConfigPath(const WCHAR *workdir, const WCHAR *fname, const settings_t *s) WCHAR tmp[MAX_PATH]; const WCHAR *config_file = NULL; const WCHAR *config_dir = NULL; +#ifndef UNICODE + WCHAR widepath[MAX_PATH]; +#endif /* convert fname to full path */ if (PathIsRelativeW(fname) )