summaryrefslogtreecommitdiffstats
path: root/tap-win32
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2007-04-19 10:20:57 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2007-04-19 10:20:57 +0000
commit35a3c167a12dfacc434a197497627114a904dae1 (patch)
tree57ee3b9f469a02a31f10a1293d3f217972eddcd8 /tap-win32
parentd710d36ddebfaea14ee59ea751b3948282c68a91 (diff)
downloadopenvpn-35a3c167a12dfacc434a197497627114a904dae1.tar.gz
openvpn-35a3c167a12dfacc434a197497627114a904dae1.tar.xz
openvpn-35a3c167a12dfacc434a197497627114a904dae1.zip
Updated build system and tap driver to work with
version 5600 of the Windows DDK. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1851 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'tap-win32')
-rwxr-xr-xtap-win32/SOURCES.in11
-rwxr-xr-xtap-win32/prototypes.h3
-rwxr-xr-xtap-win32/tapdrvr.c15
3 files changed, 19 insertions, 10 deletions
diff --git a/tap-win32/SOURCES.in b/tap-win32/SOURCES.in
index 63479a0..d64829d 100755
--- a/tap-win32/SOURCES.in
+++ b/tap-win32/SOURCES.in
@@ -17,13 +17,6 @@ C_DEFINES=
C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MAJOR_VERSION=@@PRODUCT_TAP_MAJOR_VER@@
C_DEFINES=$(C_DEFINES) -DTAP_DRIVER_MINOR_VERSION=@@PRODUCT_TAP_MINOR_VER@@
-# Use 00:FF:XX:XX:XX:XX format MAC addresses where
-# the Xs are random (like Linux tap driver).
-#
-# Don't allow TAP device to be opened by more than one process
-# at a time.
-C_DEFINES=$(C_DEFINES)
-
# Produce the same symbolic information for both free & checked builds.
# This will allow us to perform full source-level debugging on both
# builds without affecting the free build's performance.
@@ -63,8 +56,8 @@ MSC_OPTIMIZATION=/Od /Oi /Fc
LINKER_FLAGS=$(LINKER_FLAGS) /MAP /MAPINFO:EXPORTS /MAPINFO:LINES
# Generate a browser information file for use in IDE development
-BROWSER_INFO=1
-BROWSERFILE=$(TARGETNAME).BSC -n
+#BROWSER_INFO=1
+#BROWSERFILE=$(TARGETNAME).BSC -n
# Abort compilation on warnings.
MSC_WARNING_LEVEL=/W3 /WX
diff --git a/tap-win32/prototypes.h b/tap-win32/prototypes.h
index 2bd9961..788670c 100755
--- a/tap-win32/prototypes.h
+++ b/tap-win32/prototypes.h
@@ -187,6 +187,7 @@ VOID HookDispatchFunctions();
#if ENABLE_NONADMIN
+#if DDKVER < 5600
/*
* Better solution for use on Vista DDK, but possibly not compatible with
* earlier DDKs:
@@ -216,6 +217,8 @@ ZwSetSecurityObject (
IN SECURITY_INFORMATION SecurityInformation,
IN PSECURITY_DESCRIPTOR SecurityDescriptor);
+#endif
+
VOID AllowNonAdmin (TapExtensionPointer p_Extension);
#endif
diff --git a/tap-win32/tapdrvr.c b/tap-win32/tapdrvr.c
index 3d3c224..7e8d2d6 100755
--- a/tap-win32/tapdrvr.c
+++ b/tap-win32/tapdrvr.c
@@ -39,6 +39,11 @@
// TAP_IOCTL_CONFIG_TUN ioctl.
//======================================================
+#include "../../autodefs/nsidefs.h"
+#ifndef DDKVER
+#error DDKVER must be defined to the DDK Version as in c:\WinDDK\[DDKVER]\...
+#endif
+
#define NDIS_MINIPORT_DRIVER
#define BINARY_COMPATIBLE 0
#define NDIS50_MINIPORT 1
@@ -65,9 +70,15 @@
//========================================================
#define ENABLE_NONADMIN 1 // JYFIXME
+#if DDKVER < 5600
#include <ndis.h>
#include <ntstrsafe.h>
#include <ntddk.h>
+#else
+#include <ntifs.h>
+#include <ndis.h>
+#include <ntstrsafe.h>
+#endif
#include "lock.h"
#include "constants.h"
@@ -408,6 +419,7 @@ NDIS_STATUS AdapterCreate
}
}
} else {
+#if DDKVER < 5600
/* "MiniportName" is available only XP and above. Not on Windows 2000. */
NDIS_STRING key = NDIS_STRING_CONST("NdisVersion");
NdisReadConfiguration (&status, &parm, configHandle, &key, NdisParameterInteger);
@@ -428,7 +440,8 @@ NDIS_STATUS AdapterCreate
}
}
}
- }
+#endif
+ }
}
/* Can't continue without name (see macro 'NAME') */