aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL25
-rw-r--r--configure.ac2
-rwxr-xr-xinstall-win32/openvpn.nsi.in29
-rwxr-xr-xinstall-win32/prebuild17
-rwxr-xr-xtap-win32/SOURCES4
-rwxr-xr-xtap-win32/amd64/OemWin2k.inf183
-rwxr-xr-xtap-win32/amd64/tap.cat6
-rwxr-xr-xtap-win32/i386/OemWin2k.inf4
-rwxr-xr-xtap-win32/resource.rc2
-rwxr-xr-xtap-win32/tapdrvr.c76
-rw-r--r--tun.c3
11 files changed, 320 insertions, 31 deletions
diff --git a/INSTALL b/INSTALL
index c95640a..dd0783d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -302,3 +302,28 @@ CAVEATS & BUGS:
IV for OFB and CFB modes. This is not an issue if you are
using CBC cipher mode (the default), or if you are using OFB or CFB
cipher mode with SSL/TLS authentication.
+
+******************************************************************************
+
+Subject: [Openvpn-users] Re: Windows XP 64 bit
+From: Hypherion
+Date: Thu, 14 Apr 2005 07:01:17 +0000 (UTC)
+
+Well I managed to build a Windows XP 64 bit driver myself and it's working
+great, I can connect to my server again :)
+
+I had to use the WinDDK for Windows 2003 Service Pack 1 and just built the
+driver in the Windows 2003 AMD64 environment. I had to comment out the
+MAPINFO:FIXUPS directive in the SOURCES file.
+
+Then I copied and renamed (devcon.exe/tapinstall.exe) from
+C:\WINDDK\3790.1830\tools\devcon\amd64.
+
+I had to edit the file OemWin2k.inf and change the Manufactured + Product
+Section to:
+
+[Manufacturer]
+ %Provider% = tap0801, NTamd64
+
+[tap0801.NTamd64]
+ %DeviceDescription% = tap0801.ndi, tap0801
diff --git a/configure.ac b/configure.ac
index fcd0ea2..9fc01b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
-AC_INIT([OpenVPN], [2.1_beta15], [openvpn-users@lists.sourceforge.net], [openvpn])
+AC_INIT([OpenVPN], [2.1_beta15a], [openvpn-users@lists.sourceforge.net], [openvpn])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR(syshead.h)
diff --git a/install-win32/openvpn.nsi.in b/install-win32/openvpn.nsi.in
index 5813420..9a5b47a 100755
--- a/install-win32/openvpn.nsi.in
+++ b/install-win32/openvpn.nsi.in
@@ -266,8 +266,6 @@ SectionEnd
Section "TAP-Win32 Virtual Ethernet Adapter" SecTAP
SetOverwrite on
- SetOutPath "$INSTDIR\bin"
- File "${BIN}\ti3790\tapinstall.exe"
FileOpen $R0 "$INSTDIR\bin\addtap.bat" w
FileWrite $R0 "rem Add a new TAP-Win32 virtual ethernet adapter$\r$\n"
@@ -282,10 +280,37 @@ Section "TAP-Win32 Virtual Ethernet Adapter" SecTAP
FileWrite $R0 "pause$\r$\n"
FileClose $R0
+ ; Check if we are running on a 64 bit system.
+ System::Call "kernel32::GetCurrentProcess() i .s"
+ System::Call "kernel32::IsWow64Process(i s, *i .r0)"
+ IntCmp $0 0 tap-32bit
+
+; tap-64bit:
+
+ DetailPrint "We are running on a 64-bit system."
+
+ SetOutPath "$INSTDIR\bin"
+ File "${BIN}\ti3790-amd64\tapinstall.exe"
+
+ SetOutPath "$INSTDIR\driver"
+ File "${HOME}\tap-win32\amd64\OemWin2k.inf"
+ File "${HOME}\tap-win32\amd64\${TAPDRV}"
+
+ goto tapend
+
+tap-32bit:
+
+ DetailPrint "We are running on a 32-bit system."
+
+ SetOutPath "$INSTDIR\bin"
+ File "${BIN}\ti3790-i386\tapinstall.exe"
+
SetOutPath "$INSTDIR\driver"
File "${HOME}\tap-win32\i386\OemWin2k.inf"
File "${HOME}\tap-win32\i386\${TAPDRV}"
+ tapend:
+
SectionEnd
Section "Add OpenVPN to PATH" SecAddPath
diff --git a/install-win32/prebuild b/install-win32/prebuild
index 2c0c172..6ee2c8a 100755
--- a/install-win32/prebuild
+++ b/install-win32/prebuild
@@ -30,7 +30,8 @@ DMALLOC=$H/dmalloc-5.4.2
# TAP binaries should be here: tap0801.sys and tapinstall.exe
# These must be built with MS DDK.
-TAPBIN=$H/tapbin-21
+TAPBIN=$H/tapbin-0804
+TAPBIN64=$H/tapbin64-0804
# u2d.c should exist here.
SCRIPTS=$IN/install-win32
@@ -94,7 +95,7 @@ $U2D <$IN/sample-config-files/server.conf >$OUT/install-win32/server.ovpn
cp $IN/install-win32/sample.ovpn $OUT/install-win32
$U2D <$IN/easy-rsa/1.0/openssl.cnf >$OUT/install-win32/openssl.cnf.sample
-echo BUILD tap-win32
+echo BUILD tap-win32 for x86 and amd64
mkdir $OUT/tap-win32
cp $IN/tap-win32/*.[ch] $OUT/tap-win32
@@ -105,11 +106,17 @@ cp $IN/tap-win32/SOURCES $OUT/tap-win32
mkdir $OUT/tap-win32/i386
cp $IN/tap-win32/i386/OemWin2k.inf $OUT/tap-win32/i386
cp $IN/tap-win32/i386/tap.cat $OUT/tap-win32/i386
-
cp $TAPBIN/tap0801.sys $OUT/tap-win32/i386
-mkdir $OUT/bin/ti3790
-cp $TAPBIN/tapinstall.exe $OUT/bin/ti3790
+mkdir $OUT/tap-win32/amd64
+cp $IN/tap-win32/amd64/OemWin2k.inf $OUT/tap-win32/amd64
+cp $IN/tap-win32/amd64/tap.cat $OUT/tap-win32/amd64
+cp $TAPBIN64/tap0801.sys $OUT/tap-win32/amd64
+
+mkdir $OUT/bin/ti3790-i386
+cp $TAPBIN/tapinstall.exe $OUT/bin/ti3790-i386
+mkdir $OUT/bin/ti3790-amd64
+cp $TAPBIN64/tapinstall.exe $OUT/bin/ti3790-amd64
echo BUILD service-win32
diff --git a/tap-win32/SOURCES b/tap-win32/SOURCES
index f03b7f6..4d6cdee 100755
--- a/tap-win32/SOURCES
+++ b/tap-win32/SOURCES
@@ -15,7 +15,7 @@ INCLUDES=$(DDK_INCLUDE_PATH)
# config-win32.h
C_DEFINES=
C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MAJOR_VERSION=8
-C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MINOR_VERSION=3
+C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MINOR_VERSION=4
# Use 00:FF:XX:XX:XX:XX format MAC addresses where
# the Xs are random (like Linux tap driver).
@@ -60,7 +60,7 @@ MSC_OPTIMIZATION=/Od /Oi /Fc
!ENDIF
# Generate a linker map file just in case we need one for debugging
-LINKER_FLAGS=$(LINKER_FLAGS) /MAP /MAPINFO:EXPORTS /MAPINFO:LINES /MAPINFO:FIXUPS
+LINKER_FLAGS=$(LINKER_FLAGS) /MAP /MAPINFO:EXPORTS /MAPINFO:LINES
# Generate a browser information file for use in IDE development
BROWSER_INFO=1
diff --git a/tap-win32/amd64/OemWin2k.inf b/tap-win32/amd64/OemWin2k.inf
new file mode 100755
index 0000000..68879bd
--- /dev/null
+++ b/tap-win32/amd64/OemWin2k.inf
@@ -0,0 +1,183 @@
+; ****************************************************************************
+; * Copyright (C) 2002-2006 OpenVPN Solutions LLC *
+; * This program is free software; you can redistribute it and/or modify *
+; * it under the terms of the GNU General Public License version 2 *
+; * as published by the Free Software Foundation. *
+; ****************************************************************************
+
+; SYNTAX CHECKER
+; cd \WINDDK\3790\tools\chkinf
+; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf
+; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm
+
+; INSTALL/REMOVE DRIVER
+; tapinstall install OemWin2k.inf TAP0801
+; tapinstall update OemWin2k.inf TAP0801
+; tapinstall remove TAP0801
+
+;*********************************************************
+; Note to Developers:
+;
+; If you are bundling the TAP-Win32 driver with your app,
+; you should try to rename it in such a way that it will
+; not collide with other instances of TAP-Win32 defined
+; by other apps. Multiple versions of the TAP-Win32
+; driver, each installed by different apps, can coexist
+; on the same machine if you follow these guidelines:
+;
+; (1) Rename all tapXXXX instances in this file to
+; something different (use at least 5 characters
+; for this name!)
+; (2) Change the "!define TAP" definition in openvpn.nsi
+; to match what you changed tapXXXX to.
+; (3) Change TARGETNAME in SOURCES to match what you
+; changed tapXXXX to.
+; (4) Change TAP_COMPONENT_ID in common.h to match what
+; you changed tapXXXX to.
+; (5) Change SZDEPENDENCIES in service.h to match what
+; you changed tapXXXX to.
+; (6) Change DeviceDescription and Provider strings.
+; (7) Change PRODUCT_STRING in constants.h to what you
+; set DeviceDescription to.
+;
+;*********************************************************
+
+[Version]
+ Signature = "$Windows NT$"
+ CatalogFile = tap.cat
+ ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
+ Provider = %Provider%
+ Class = Net
+
+; This version number should match the version
+; number given in SOURCES.
+ DriverVer=09/13/2006,8.00.00.0004
+
+[Strings]
+ DeviceDescription = "TAP-Win32 Adapter V8"
+ Provider = "TAP-Win32 Provider"
+
+;----------------------------------------------------------------
+; Manufacturer + Product Section (Done)
+;----------------------------------------------------------------
+[Manufacturer]
+ %Provider% = tap0801, NTamd64
+
+[tap0801.NTamd64]
+ %DeviceDescription% = tap0801.ndi, tap0801
+
+;---------------------------------------------------------------
+; Driver Section (Done)
+;---------------------------------------------------------------
+
+;----------------- Characteristics ------------
+; NCF_PHYSICAL = 0x04
+; NCF_VIRTUAL = 0x01
+; NCF_SOFTWARE_ENUMERATED = 0x02
+; NCF_HIDDEN = 0x08
+; NCF_NO_SERVICE = 0x10
+; NCF_HAS_UI = 0x80
+;----------------- Characteristics ------------
+
+[tap0801.ndi]
+ CopyFiles = tap0801.driver, tap0801.files
+ AddReg = tap0801.reg
+ AddReg = tap0801.params.reg
+ Characteristics = 0x81
+
+[tap0801.ndi.Services]
+ AddService = tap0801, 2, tap0801.service
+
+[tap0801.reg]
+ HKR, Ndi, Service, 0, "tap0801"
+ HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
+ HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
+ HKR, , Manufacturer, 0, "%Provider%"
+ HKR, , ProductName, 0, "%DeviceDescription%"
+
+[tap0801.params.reg]
+ HKR, Ndi\params\MTU, ParamDesc, 0, "MTU"
+ HKR, Ndi\params\MTU, Type, 0, "int"
+ HKR, Ndi\params\MTU, Default, 0, "1500"
+ HKR, Ndi\params\MTU, Optional, 0, "0"
+ HKR, Ndi\params\MTU, Min, 0, "100"
+ HKR, Ndi\params\MTU, Max, 0, "1500"
+ HKR, Ndi\params\MTU, Step, 0, "1"
+ HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status"
+ HKR, Ndi\params\MediaStatus, Type, 0, "enum"
+ HKR, Ndi\params\MediaStatus, Default, 0, "0"
+ HKR, Ndi\params\MediaStatus, Optional, 0, "0"
+ HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled"
+ HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected"
+ HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address"
+ HKR, Ndi\params\MAC, Type, 0, "edit"
+ HKR, Ndi\params\MAC, Optional, 0, "1"
+ HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access"
+ HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum"
+ HKR, Ndi\params\AllowNonAdmin, Default, 0, "1"
+ HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0"
+ HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed"
+ HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed"
+
+;----------------------------------------------------------------
+; Service Section
+;----------------------------------------------------------------
+
+;---------- Service Type -------------
+; SERVICE_KERNEL_DRIVER = 0x01
+; SERVICE_WIN32_OWN_PROCESS = 0x10
+;---------- Service Type -------------
+
+;---------- Start Mode ---------------
+; SERVICE_BOOT_START = 0x0
+; SERVICE_SYSTEM_START = 0x1
+; SERVICE_AUTO_START = 0x2
+; SERVICE_DEMAND_START = 0x3
+; SERVICE_DISABLED = 0x4
+;---------- Start Mode ---------------
+
+[tap0801.service]
+ DisplayName = %DeviceDescription%
+ ServiceType = 1
+ StartType = 3
+ ErrorControl = 1
+ LoadOrderGroup = NDIS
+ ServiceBinary = %12%\tap0801.sys
+
+;-----------------------------------------------------------------
+; File Installation
+;-----------------------------------------------------------------
+
+;----------------- Copy Flags ------------
+; COPYFLG_NOSKIP = 0x02
+; COPYFLG_NOVERSIONCHECK = 0x04
+;----------------- Copy Flags ------------
+
+; SourceDisksNames
+; diskid = description[, [tagfile] [, <unused>, subdir]]
+; 1 = "Intel Driver Disk 1",e100bex.sys,,
+
+[SourceDisksNames]
+ 1 = %DeviceDescription%, tap0801.sys
+
+; SourceDisksFiles
+; filename_on_source = diskID[, [subdir][, size]]
+; e100bex.sys = 1,, ; on distribution disk 1
+
+[SourceDisksFiles]
+tap0801.sys = 1
+
+[DestinationDirs]
+ tap0801.files = 11
+ tap0801.driver = 12
+
+[tap0801.files]
+; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+
+[tap0801.driver]
+ tap0801.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
+
+;---------------------------------------------------------------
+; End
+;---------------------------------------------------------------
diff --git a/tap-win32/amd64/tap.cat b/tap-win32/amd64/tap.cat
new file mode 100755
index 0000000..4492fa2
--- /dev/null
+++ b/tap-win32/amd64/tap.cat
@@ -0,0 +1,6 @@
+; ****************************************************************************
+; * Copyright (C) 2002-2005 OpenVPN Solutions LLC *
+; * This program is free software; you can redistribute it and/or modify *
+; * it under the terms of the GNU General Public License version 2 *
+; * as published by the Free Software Foundation. *
+; ****************************************************************************
diff --git a/tap-win32/i386/OemWin2k.inf b/tap-win32/i386/OemWin2k.inf
index 681c4b7..219b4ca 100755
--- a/tap-win32/i386/OemWin2k.inf
+++ b/tap-win32/i386/OemWin2k.inf
@@ -1,5 +1,5 @@
; ****************************************************************************
-; * Copyright (C) 2002-2005 OpenVPN Solutions LLC *
+; * Copyright (C) 2002-2006 OpenVPN Solutions LLC *
; * This program is free software; you can redistribute it and/or modify *
; * it under the terms of the GNU General Public License version 2 *
; * as published by the Free Software Foundation. *
@@ -51,7 +51,7 @@
; This version number should match the version
; number given in SOURCES.
- DriverVer=05/15/2004,8.00.00.0001
+ DriverVer=09/13/2006,8.00.00.0004
[Strings]
DeviceDescription = "TAP-Win32 Adapter V8"
diff --git a/tap-win32/resource.rc b/tap-win32/resource.rc
index 726e287..8c9cb7b 100755
--- a/tap-win32/resource.rc
+++ b/tap-win32/resource.rc
@@ -36,7 +36,7 @@
#define VER_COMPANYNAME_STR "The OpenVPN Project"
#define VER_FILEDESCRIPTION_STR "TAP-Win32 Virtual Network Driver"
#define VER_ORIGINALFILENAME_STR TAP_COMPONENT_ID ".sys"
-#define VER_LEGALCOPYRIGHT_YEARS "2003-2004"
+#define VER_LEGALCOPYRIGHT_YEARS "2003-2006"
#define VER_LEGALCOPYRIGHT_STR "OpenVPN Solutions LLC and Damion K. Wilson"
diff --git a/tap-win32/tapdrvr.c b/tap-win32/tapdrvr.c
index 0997bd5..9c6304b 100755
--- a/tap-win32/tapdrvr.c
+++ b/tap-win32/tapdrvr.c
@@ -8,7 +8,7 @@
* Copyright (C) Damion K. Wilson, 2003, and is released under the
* GPL version 2 (see below).
*
- * All other source code is Copyright (C) 2002-2005 OpenVPN Solutions LLC,
+ * All other source code is Copyright (C) 2002-2006 OpenVPN Solutions LLC,
* and is released under the GPL version 2 (see below).
*
* This program is free software; you can redistribute it and/or modify
@@ -364,19 +364,6 @@ NDIS_STATUS AdapterCreate
AdapterHalt);
l_Adapter->m_RegisteredAdapterShutdownHandler = TRUE;
- //====================================
- // Allocate and construct adapter name
- //====================================
-
- if (RtlUnicodeStringToAnsiString (
- &l_Adapter->m_NameAnsi,
- &((PNDIS_MINIPORT_BLOCK) p_AdapterHandle)->MiniportName,
- TRUE) != STATUS_SUCCESS)
- {
- AdapterFreeResources (l_Adapter);
- return NDIS_STATUS_RESOURCES;
- }
-
//============================================
// Get parameters from registry which were set
// in the adapter advanced properties dialog.
@@ -392,8 +379,66 @@ NDIS_STATUS AdapterCreate
l_Adapter->m_MediaState = FALSE;
NdisOpenConfiguration (&status, &configHandle, p_ConfigurationHandle);
- if (status == NDIS_STATUS_SUCCESS)
+ if (status != NDIS_STATUS_SUCCESS)
{
+ DEBUGP (("[TAP] Couldn't open adapter registry\n"));
+ AdapterFreeResources (l_Adapter);
+ return status;
+ }
+
+ //====================================
+ // Allocate and construct adapter name
+ //====================================
+ {
+ NDIS_STRING key = NDIS_STRING_CONST("MiniportName");
+ NdisReadConfiguration (&status, &parm, configHandle, &key, NdisParameterString);
+ if (status == NDIS_STATUS_SUCCESS)
+ {
+ if (parm->ParameterType == NdisParameterString)
+ {
+ DEBUGP (("[TAP] NdisReadConfiguration (MiniportName=%s)\n", parm->ParameterData.StringData.Buffer));
+
+ if (RtlUnicodeStringToAnsiString (
+ &l_Adapter->m_NameAnsi,
+ &parm->ParameterData.StringData,
+ TRUE) != STATUS_SUCCESS)
+ {
+ DEBUGP (("[TAP] RtlUnicodeStringToAnsiString MiniportName failed\n"));
+ status = NDIS_STATUS_RESOURCES;
+ }
+ }
+ } else {
+ /* "MiniportName" is available only XP and above. Not on Windows 2000. */
+ NDIS_STRING key = NDIS_STRING_CONST("NdisVersion");
+ NdisReadConfiguration (&status, &parm, configHandle, &key, NdisParameterInteger);
+ if (status == NDIS_STATUS_SUCCESS)
+ {
+ if (parm->ParameterData.IntegerData == 0x50000)
+ {
+ /* Fallback for Windows 2000 with NDIS version 5.00.00
+ Don't use this on Vista, 'NDIS_MINIPORT_BLOCK' was changed! */
+ DEBUGP (("[TAP] NdisReadConfiguration NdisVersion (Int=%X)\n", parm->ParameterData.IntegerData));
+ if (RtlUnicodeStringToAnsiString (
+ &l_Adapter->m_NameAnsi,
+ &((PNDIS_MINIPORT_BLOCK) p_AdapterHandle)->MiniportName,
+ TRUE) != STATUS_SUCCESS)
+ {
+ DEBUGP (("[TAP] RtlUnicodeStringToAnsiString MiniportName (W2K) failed\n"));
+ status = NDIS_STATUS_RESOURCES;
+ }
+ }
+ }
+ }
+ }
+
+ /* Can't continue without name (see macro 'NAME') */
+ if (status != NDIS_STATUS_SUCCESS || !l_Adapter->m_NameAnsi.Buffer)
+ {
+ NdisCloseConfiguration (configHandle);
+ AdapterFreeResources (l_Adapter);
+ return NDIS_STATUS_RESOURCES;
+ }
+
/* Read MTU setting from registry */
{
NDIS_STRING key = NDIS_STRING_CONST("MTU");
@@ -470,7 +515,6 @@ NDIS_STATUS AdapterCreate
}
NdisCloseConfiguration (configHandle);
- }
DEBUGP (("[%s] MTU=%d\n", NAME (l_Adapter), l_Adapter->m_MTU));
}
diff --git a/tun.c b/tun.c
index 9c911ef..7fd876e 100644
--- a/tun.c
+++ b/tun.c
@@ -3659,8 +3659,7 @@ open_tun (const char *dev, const char *dev_type, const char *dev_node, bool ipv6
(info[2] ? "(DEBUG)" : ""));
}
- if ( !(info[0] > TAP_WIN32_MIN_MAJOR
- || (info[0] == TAP_WIN32_MIN_MAJOR && info[1] >= TAP_WIN32_MIN_MINOR)) )
+ if (!(info[0] == TAP_WIN32_MIN_MAJOR && info[1] >= TAP_WIN32_MIN_MINOR))
msg (M_FATAL, "ERROR: This version of " PACKAGE_NAME " requires a TAP-Win32 driver that is at least version %d.%d -- If you recently upgraded your " PACKAGE_NAME " distribution, a reboot is probably required at this point to get Windows to see the new driver.",
TAP_WIN32_MIN_MAJOR,
TAP_WIN32_MIN_MINOR);