diff options
author | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2009-06-22 20:48:35 +0000 |
---|---|---|
committer | james <james@e7ae566f-a301-0410-adde-c780ea21d3b5> | 2009-06-22 20:48:35 +0000 |
commit | 7ea8261049d8897b46e26f62dec3f6768e0b3f9a (patch) | |
tree | 763d0b19f9a1f695b5591b6b4633121a0d30457c /tap-win32/types.h | |
parent | Rename generated tapdrvr.cod to a unique name to avoid the issue where (diff) | |
download | openvpn-7ea8261049d8897b46e26f62dec3f6768e0b3f9a.tar.xz |
In Windows TAP driver, refactor DHCP/ARP packet injection code to
use a DPC (deferred procedure call) to defer packet injection until
IRQL < DISPATCH_LEVEL, rather than calling NdisMEthIndicateReceive
in the context of AdapterTransmit. This is an attempt to reduce kernel
stack usage, and prevent EXCEPTION_DOUBLE_FAULT BSODs that have been
observed on Vista. Updated TAP driver version number to 9.6.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@4606 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'tap-win32/types.h')
-rwxr-xr-x | tap-win32/types.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tap-win32/types.h b/tap-win32/types.h index d424521..4adee6a 100755 --- a/tap-win32/types.h +++ b/tap-win32/types.h @@ -86,6 +86,12 @@ typedef struct _TapExtension // Flags BOOLEAN m_TapIsRunning; BOOLEAN m_CalledTapDeviceFreeResources; + + // DPC queue for deferred packet injection + BOOLEAN m_InjectDpcInitialized; + KDPC m_InjectDpc; + NDIS_SPIN_LOCK m_InjectLock; + Queue *m_InjectQueue; } TapExtension, *TapExtensionPointer; @@ -99,6 +105,15 @@ typedef struct _TapPacket } TapPacket, *TapPacketPointer; +typedef struct _InjectPacket + { +# define INJECT_PACKET_SIZE(data_size) (sizeof (InjectPacket) + (data_size)) +# define INJECT_PACKET_FREE(ib) NdisFreeMemory ((ib), INJECT_PACKET_SIZE ((ib)->m_Size), 0) + ULONG m_Size; + UCHAR m_Data []; // m_Data must be the last struct member + } +InjectPacket, *InjectPacketPointer; + typedef struct _TapAdapter { # define NAME(a) ((a)->m_NameAnsi.Buffer) |