1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-09-19 17:59:19 +03:00

v4.03-9408-rtm

This commit is contained in:
dnobori
2014-01-04 22:00:08 +09:00
parent d433e567a5
commit 749497dde0
986 changed files with 487216 additions and 339 deletions

1704
src/Neo/NDIS5.c Normal file

File diff suppressed because it is too large Load Diff

269
src/Neo/NDIS5.h Normal file
View File

@ -0,0 +1,269 @@
// SoftEther VPN Source Code
// Kernel Device Driver
//
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
//
// Copyright (c) 2012-2014 Daiyuu Nobori.
// Copyright (c) 2012-2014 SoftEther VPN Project, University of Tsukuba, Japan.
// Copyright (c) 2012-2014 SoftEther Corporation.
//
// All Rights Reserved.
//
// http://www.softether.org/
//
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
//
// 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.
//
// 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License version 2
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
//
//
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
//
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
// COUNTRIES MIGHT BE RESTRICTED.
//
//
// DEAR SECURITY EXPERTS
// ---------------------
//
// If you find a bug or a security vulnerability please kindly inform us
// about the problem immediately so that we can fix the security problem
// to protect a lot of users around the world as soon as possible.
//
// Our e-mail address for security reports is:
// softether-vpn-security [at] softether.org
//
// Please note that the above e-mail address is not a technical support
// inquiry address. If you need technical assistance, please visit
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
// NDIS5.h
// Header of NDIS5.c
#ifndef NDIS5_H
#define NDIS5_H
// Win32 DDK related
#ifndef CPU_64
#define _X86_
#else // CPU_64
#ifndef NEO_IA64
#define _AMD64_
#define AMD64
#else // NEO_IA64
#define _IA64_
#define IA64
#endif // NEO_IA64
#endif // CPU_64
#define NDIS_MINIPORT_DRIVER
#ifndef WIN9X
// Windows 2000 or later: NDIS 5.0
#define NDIS50_MINIPORT
#define NEO_NDIS_MAJOR_VERSION 5
#define NEO_NDIS_MINOR_VERSION 0
#else // WIN9X
// Windows 9x: NDIS 4.0
#define NDIS40_MINIPORT
#define NEO_NDIS_MAJOR_VERSION 4
#define NEO_NDIS_MINOR_VERSION 0
#define BINARY_COMPATIBLE 1
#endif // WIN9X
#define NDIS_WDM 1
#ifndef WIN9X
#include <wdm.h>
#include <ndis.h>
#include <stdio.h>
#include <string.h>
#else // WIN9X
#include <basedef.h>
#define _LARGE_INTEGER DUMMY__LARGE_INTEGER
#define LARGE_INTEGER DUMMY_LARGE_INTEGER
#define PLARGE_INTEGER DUMMY_PLARGE_INTEGER
#define _ULARGE_INTEGER DUMMY__ULARGE_INTEGER
#define ULARGE_INTEGER DUMMY_ULARGE_INTEGER
#define PULARGE_INTEGER DUMMY_PULARGE_INTEGER
#define PSZ DUMMY_PSZ
#include <ndis.h>
#include <vmm.h>
#include <vwin32.h>
#include <stdio.h>
#include <string.h>
#undef _LARGE_INTEGER
#undef LARGE_INTEGER
#undef PLARGE_INTEGER
#undef _ULARGE_INTEGER
#undef ULARGE_INTEGER
#undef PULARGE_INTEGER
#undef PSZ
#endif // WIN9X
// Error checking macro
#define OK(val) (val == STATUS_SUCCESS)
#define NG(val) (!OK(val))
// Constant
static UINT SupportedOids[] =
{
OID_GEN_SUPPORTED_LIST,
OID_GEN_HARDWARE_STATUS,
OID_GEN_MEDIA_SUPPORTED,
OID_GEN_MEDIA_IN_USE,
OID_GEN_MAXIMUM_FRAME_SIZE,
OID_GEN_MAXIMUM_TOTAL_SIZE,
OID_GEN_MAC_OPTIONS,
OID_GEN_MAXIMUM_LOOKAHEAD,
OID_GEN_CURRENT_LOOKAHEAD,
OID_GEN_LINK_SPEED,
OID_GEN_MEDIA_CONNECT_STATUS,
OID_GEN_TRANSMIT_BUFFER_SPACE,
OID_GEN_RECEIVE_BUFFER_SPACE,
OID_GEN_TRANSMIT_BLOCK_SIZE,
OID_GEN_RECEIVE_BLOCK_SIZE,
OID_GEN_VENDOR_DESCRIPTION,
OID_GEN_VENDOR_ID,
OID_GEN_DRIVER_VERSION,
OID_GEN_VENDOR_DRIVER_VERSION,
OID_GEN_XMIT_OK,
OID_GEN_RCV_OK,
OID_GEN_XMIT_ERROR,
OID_GEN_RCV_ERROR,
OID_GEN_RCV_NO_BUFFER,
OID_GEN_CURRENT_PACKET_FILTER,
OID_802_3_PERMANENT_ADDRESS,
OID_802_3_CURRENT_ADDRESS,
OID_802_3_MAXIMUM_LIST_SIZE,
OID_802_3_RCV_ERROR_ALIGNMENT,
OID_802_3_XMIT_ONE_COLLISION,
OID_802_3_XMIT_MORE_COLLISIONS,
OID_802_3_MULTICAST_LIST,
//OID_GEN_PROTOCOL_OPTIONS,
OID_GEN_MAXIMUM_SEND_PACKETS
};
#define NEO_MEDIA NdisMedium802_3
#define MAX_MULTICAST 32
#define MAX_PATH 260
#define MAX_SIZE 512
#define STD_SIZE 512
// Macro
#define _NdisInitializeString(Destination,Source) \
{\
PNDIS_STRING _D = (Destination);\
UCHAR *_S = (Source);\
WCHAR *_P;\
_D->Length = (USHORT)((strlen(_S)) * sizeof(WCHAR));\
_D->MaximumLength = _D->Length + sizeof(WCHAR);\
NdisAllocateMemoryWithTag((PVOID *)&(_D->Buffer), _D->MaximumLength, 0);\
_P = _D->Buffer;\
while(*_S != '\0'){\
*_P = (WCHAR)(*_S);\
_S++;\
_P++;\
}\
*_P = UNICODE_NULL;\
}
// Unicode string
typedef struct _UNICODE
{
UNICODE_STRING String;
} UNICODE;
typedef struct _PACKET_BUFFER PACKET_BUFFER;
// Function prototype
UNICODE *NewUnicode(char *str);
void FreeUnicode(UNICODE *u);
NDIS_STRING *GetUnicode(UNICODE *u);
PACKET_BUFFER *NeoNewPacketBuffer();
void NeoFreePacketBuffer(PACKET_BUFFER *p);
void NeoInitPacketArray();
void NeoFreePacketArray();
NDIS_STATUS DriverEntry(DRIVER_OBJECT *DriverObject, UNICODE_STRING *RegistryPath);
NDIS_STATUS NeoNdisInit(NDIS_STATUS *OpenErrorStatus,
UINT *SelectedMediumIndex,
NDIS_MEDIUM *MediumArray,
UINT MediumArraySize,
NDIS_HANDLE MiniportAdapterHandle,
NDIS_HANDLE WrapperConfigurationContext);
NDIS_STATUS NeoNdisHalt(NDIS_HANDLE MiniportAdapterContext);
NDIS_STATUS NeoNdisReset(BOOLEAN *AddressingReset, NDIS_HANDLE MiniportAdapterContext);
NDIS_STATUS NeoNdisQuery(NDIS_HANDLE MiniportAdapterContext,
NDIS_OID Oid,
void *InformationBuffer,
ULONG InformationBufferLength,
ULONG *BytesWritten,
ULONG *BytesNeeded);
NDIS_STATUS NeoNdisSet(
NDIS_HANDLE MiniportAdapterContext,
NDIS_OID Oid,
void *InformationBuffer,
ULONG InformationBufferLength,
ULONG *BytesRead,
ULONG *BytesNeeded);
void NeoNdisSendPackets(NDIS_HANDLE MiniportAdapterContext,
NDIS_PACKET **PacketArray,
UINT NumberOfPackets);
NDIS_STATUS NeoNdisSend(NDIS_HANDLE MiniportAdapterContext,
NDIS_PACKET *Packet, UINT Flags);
BOOL NeoNdisSendPacketsHaltCheck(NDIS_PACKET **PacketArray, UINT NumberOfPackets);
BOOL NeoLoadRegistory();
void NeoInitControlDevice();
void NeoFreeControlDevice();
NTSTATUS NeoNdisDispatch(DEVICE_OBJECT *DeviceObject, IRP *Irp);
void NeoCheckConnectState();
void NeoSetConnectState(BOOL connected);
BOOL NeoNdisOnOpen(IRP *irp, IO_STACK_LOCATION *stack);
BOOL NeoNdisOnClose(IRP *irp, IO_STACK_LOCATION *stack);
#endif // NDIS5_H
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
// Department of Computer Science has dozens of overly-enthusiastic geeks.
// Join us: http://www.tsukuba.ac.jp/english/admission/

442
src/Neo/Neo.c Normal file
View File

@ -0,0 +1,442 @@
// SoftEther VPN Source Code
// Kernel Device Driver
//
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
//
// Copyright (c) 2012-2014 Daiyuu Nobori.
// Copyright (c) 2012-2014 SoftEther VPN Project, University of Tsukuba, Japan.
// Copyright (c) 2012-2014 SoftEther Corporation.
//
// All Rights Reserved.
//
// http://www.softether.org/
//
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
//
// 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.
//
// 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License version 2
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
//
//
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
//
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
// COUNTRIES MIGHT BE RESTRICTED.
//
//
// DEAR SECURITY EXPERTS
// ---------------------
//
// If you find a bug or a security vulnerability please kindly inform us
// about the problem immediately so that we can fix the security problem
// to protect a lot of users around the world as soon as possible.
//
// Our e-mail address for security reports is:
// softether-vpn-security [at] softether.org
//
// Please note that the above e-mail address is not a technical support
// inquiry address. If you need technical assistance, please visit
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
// Neo.c
// Driver main program
#include <GlobalConst.h>
#define NEO_DEVICE_DRIVER
#include "Neo.h"
// Whether Win8
extern bool g_is_win8;
// Neo driver context
static NEO_CTX static_ctx;
NEO_CTX *ctx = &static_ctx;
// Read the packet data from the transmit packet queue
void NeoRead(void *buf)
{
NEO_QUEUE *q;
UINT num;
BOOL left;
// Validate arguments
if (buf == NULL)
{
return;
}
// Copy the packets one by one from the queue
num = 0;
left = TRUE;
NeoLockPacketQueue();
{
while (TRUE)
{
if (num >= NEO_MAX_PACKET_EXCHANGE)
{
if (ctx->PacketQueue == NULL)
{
left = FALSE;
}
break;
}
q = NeoGetNextQueue();
if (q == NULL)
{
left = FALSE;
break;
}
NEO_SIZE_OF_PACKET(buf, num) = q->Size;
NeoCopy(NEO_ADDR_OF_PACKET(buf, num), q->Buf, q->Size);
num++;
NeoFreeQueue(q);
}
}
NeoUnlockPacketQueue();
NEO_NUM_PACKET(buf) = num;
NEO_LEFT_FLAG(buf) = left;
if (left == FALSE)
{
NeoReset(ctx->Event);
}
else
{
NeoSet(ctx->Event);
}
return;
}
// Process the received packet
void NeoWrite(void *buf)
{
UINT num, i, size;
void *packet_buf;
// Validate arguments
if (buf == NULL)
{
return;
}
// Number of packets
num = NEO_NUM_PACKET(buf);
if (num > NEO_MAX_PACKET_EXCHANGE)
{
// Number of packets is too many
return;
}
if (num == 0)
{
// No packet
return;
}
if (ctx->Halting != FALSE)
{
// Halting
return;
}
if (ctx->Opened == FALSE)
{
// Not connected
return;
}
for (i = 0;i < num;i++)
{
PACKET_BUFFER *p = ctx->PacketBuffer[i];
size = NEO_SIZE_OF_PACKET(buf, i);
if (size > NEO_MAX_PACKET_SIZE)
{
size = NEO_MAX_PACKET_SIZE;
}
if (size < NEO_PACKET_HEADER_SIZE)
{
size = NEO_PACKET_HEADER_SIZE;
}
packet_buf = NEO_ADDR_OF_PACKET(buf, i);
// Buffer copy
NeoCopy(p->Buf, packet_buf, size);
if (g_is_win8 == false)
{
// Adjust the buffer size
NdisAdjustBufferLength(p->NdisBuffer, size);
// Set the packet information
NDIS_SET_PACKET_STATUS(p->NdisPacket, NDIS_STATUS_RESOURCES);
NDIS_SET_PACKET_HEADER_SIZE(p->NdisPacket, NEO_PACKET_HEADER_SIZE);
}
else
{
NdisMEthIndicateReceive(ctx->NdisMiniport, ctx,
p->Buf, NEO_PACKET_HEADER_SIZE,
((UCHAR *)p->Buf) + NEO_PACKET_HEADER_SIZE, size - NEO_PACKET_HEADER_SIZE,
size - NEO_PACKET_HEADER_SIZE);
NdisMEthIndicateReceiveComplete(ctx->NdisMiniport);
}
}
// Notify that packets have received
ctx->Status.NumPacketRecv += num;
if (g_is_win8 == false)
{
NdisMIndicateReceivePacket(ctx->NdisMiniport, ctx->PacketBufferArray, num);
}
}
// Get the number of queue items
UINT NeoGetNumQueue()
{
return ctx->NumPacketQueue;
}
// Insert the queue
void NeoInsertQueue(void *buf, UINT size)
{
NEO_QUEUE *p;
// Validate arguments
if (buf == NULL || size == 0)
{
return;
}
// Prevent the packet accumulation in large quantities in the queue
if (ctx->NumPacketQueue > NEO_MAX_PACKET_QUEUED)
{
NeoFree(buf);
return;
}
// Create a queue
p = NeoMalloc(sizeof(NEO_QUEUE));
p->Next = NULL;
p->Size = size;
p->Buf = buf;
// Append to the queue
if (ctx->PacketQueue == NULL)
{
ctx->PacketQueue = p;
}
else
{
NEO_QUEUE *q = ctx->Tail;
q->Next = p;
}
ctx->Tail = p;
ctx->NumPacketQueue++;
}
// Get the next queued item
NEO_QUEUE *NeoGetNextQueue()
{
NEO_QUEUE *q;
if (ctx->PacketQueue == NULL)
{
// No item queued
return NULL;
}
// Get the next queued item
q = ctx->PacketQueue;
ctx->PacketQueue = ctx->PacketQueue->Next;
q->Next = NULL;
ctx->NumPacketQueue--;
if (ctx->PacketQueue == NULL)
{
ctx->Tail = NULL;
}
return q;
}
// Release the buffer queue
void NeoFreeQueue(NEO_QUEUE *q)
{
// Validate arguments
if (q == NULL)
{
return;
}
NeoFree(q->Buf);
NeoFree(q);
}
// Lock the packet queue
void NeoLockPacketQueue()
{
NeoLock(ctx->PacketQueueLock);
}
// Unlock the packet queue
void NeoUnlockPacketQueue()
{
NeoUnlock(ctx->PacketQueueLock);
}
// Initialize the packet queue
void NeoInitPacketQueue()
{
// Create a lock
ctx->PacketQueueLock = NeoNewLock();
// Initialize the packet queue
ctx->PacketQueue = NULL;
ctx->NumPacketQueue = 0;
ctx->Tail = NULL;
}
// Delete all the packets from the packet queue
void NeoClearPacketQueue()
{
// Release the memory of the packet queue
NeoLock(ctx->PacketQueueLock);
{
NEO_QUEUE *q = ctx->PacketQueue;
NEO_QUEUE *qn;
while (q != NULL)
{
qn = q->Next;
NeoFree(q->Buf);
NeoFree(q);
q = qn;
}
ctx->PacketQueue = NULL;
ctx->Tail = NULL;
ctx->NumPacketQueue = 0;
}
NeoUnlock(ctx->PacketQueueLock);
}
// Release the packet queue
void NeoFreePacketQueue()
{
// Delete all packets
NeoClearPacketQueue();
// Delete the lock
NeoFreeLock(ctx->PacketQueueLock);
ctx->PacketQueueLock = NULL;
}
// Start the adapter
void NeoStartAdapter()
{
// Initialize the packet queue
NeoInitPacketQueue();
}
// Stop the adapter
void NeoStopAdapter()
{
// Delete the packet queue
NeoFreePacketQueue();
}
// Initialization
BOOL NeoInit()
{
// Initialize the context
NeoZero(ctx, sizeof(NEO_CTX));
// Initialize the status information
NeoNewStatus(&ctx->Status);
return TRUE;
}
// Shutdown
void NeoShutdown()
{
if (ctx == NULL)
{
// Uninitialized
return;
}
// Relaese the status information
NeoFreeStatus(&ctx->Status);
NeoZero(ctx, sizeof(NEO_CTX));
}
// Create a status information
void NeoNewStatus(NEO_STATUS *s)
{
// Validate arguments
if (s == NULL)
{
return;
}
// Memory initialization
NeoZero(s, sizeof(NEO_STATUS));
}
// Release the status information
void NeoFreeStatus(NEO_STATUS *s)
{
// Validate arguments
if (s == NULL)
{
return;
}
// Memory initialization
NeoZero(s, sizeof(NEO_STATUS));
}
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
// Department of Computer Science has dozens of overly-enthusiastic geeks.
// Join us: http://www.tsukuba.ac.jp/english/admission/

313
src/Neo/Neo.h Normal file
View File

@ -0,0 +1,313 @@
// SoftEther VPN Source Code
// Kernel Device Driver
//
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
//
// Copyright (c) 2012-2014 Daiyuu Nobori.
// Copyright (c) 2012-2014 SoftEther VPN Project, University of Tsukuba, Japan.
// Copyright (c) 2012-2014 SoftEther Corporation.
//
// All Rights Reserved.
//
// http://www.softether.org/
//
// Author: Daiyuu Nobori
// Comments: Tetsuo Sugiyama, Ph.D.
//
//
// 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.
//
// 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License version 2
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
//
//
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
//
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
// COUNTRIES MIGHT BE RESTRICTED.
//
//
// DEAR SECURITY EXPERTS
// ---------------------
//
// If you find a bug or a security vulnerability please kindly inform us
// about the problem immediately so that we can fix the security problem
// to protect a lot of users around the world as soon as possible.
//
// Our e-mail address for security reports is:
// softether-vpn-security [at] softether.org
//
// Please note that the above e-mail address is not a technical support
// inquiry address. If you need technical assistance, please visit
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
// Neo.h
// Header of Neo.c
#ifndef NEO_H
#define NEO_H
// Identification string (NDIS)
#define NDIS_NEO_HARDWARE_ID "VPN Client Adapter - %s"
#define NDIS_NEO_DEVICE_NAME "\\Device\\NEO_%s_DEVICE"
#define NDIS_NEO_DEVICE_NAME_WIN32 "\\DosDevices\\NEO_%s_DEVICE"
#define NDIS_NEO_DEVICE_FILE_NAME "\\\\.\\NEO_NEOADAPTER_%s_DEVICE"
#define NDIS_NEO_EVENT_NAME "\\BaseNamedObjects\\NEO_EVENT_%s"
#define NDIS_NEO_EVENT_NAME_WIN32 "Global\\NEO_EVENT_NEOADAPTER_%s"
// Constant
#define NEO_MAX_PACKET_SIZE 1560
#define NEO_MAX_PACKET_SIZE_ANNOUNCE 1514
#define NEO_MIN_PACKET_SIZE 14
#define NEO_PACKET_HEADER_SIZE 14
#define NEO_MAX_FRAME_SIZE (NEO_MAX_PACKET_SIZE - NEO_MIN_PACKET_SIZE)
#define NEO_MAX_SPEED_DEFAULT 1000000
#define NEO_MAC_ADDRESS_SIZE 6
#define NEO_MAX_MULTICASE 32
// IOCTL constant
#define NEO_IOCTL_SET_EVENT CTL_CODE(0x8000, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define NEO_IOCTL_PUT_PACKET CTL_CODE(0x8000, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define NEO_IOCTL_GET_PACKET CTL_CODE(0x8000, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
// Packet data exchange related
#define NEO_MAX_PACKET_EXCHANGE 256 // Number of packets that can be exchanged at a time
#define NEO_MAX_PACKET_QUEUED 4096 // Maximum number of packets that can be queued
#define NEO_EX_SIZEOF_NUM_PACKET 4 // Packet count data (UINT)
#define NEO_EX_SIZEOF_LENGTH_PACKET 4 // Length data of the packet data (UINT)
#define NEO_EX_SIZEOF_LEFT_FLAG 4 // Flag to indicate that the packet is still
#define NEO_EX_SIZEOF_ONE_PACKET 1600 // Data area occupied by a packet data
#define NEO_EXCHANGE_BUFFER_SIZE (NEO_EX_SIZEOF_NUM_PACKET + NEO_EX_SIZEOF_LEFT_FLAG + \
(NEO_EX_SIZEOF_LENGTH_PACKET + NEO_EX_SIZEOF_ONE_PACKET) * (NEO_MAX_PACKET_EXCHANGE + 1))
#define NEO_NUM_PACKET(buf) (*((UINT *)((UCHAR *)buf + 0)))
#define NEO_SIZE_OF_PACKET(buf, i) (*((UINT *)((UCHAR *)buf + NEO_EX_SIZEOF_NUM_PACKET + \
(i * (NEO_EX_SIZEOF_LENGTH_PACKET + NEO_EX_SIZEOF_ONE_PACKET)))))
#define NEO_ADDR_OF_PACKET(buf, i) (((UINT *)((UCHAR *)buf + NEO_EX_SIZEOF_NUM_PACKET + \
NEO_EX_SIZEOF_LENGTH_PACKET + \
(i * (NEO_EX_SIZEOF_LENGTH_PACKET + NEO_EX_SIZEOF_ONE_PACKET)))))
#define NEO_LEFT_FLAG(buf) NEO_SIZE_OF_PACKET(buf, NEO_MAX_PACKET_EXCHANGE)
// Definitions needed to compile as a device driver
#ifdef NEO_DEVICE_DRIVER
// OS determination
#ifdef WIN32
#define OS_WIN32 // Microsoft Windows
#else
#define OS_UNIX // UNIX / Linux
#endif
// Type declaration
#ifndef WINDOWS_H_INCLUDED
#ifndef WIN9X
typedef unsigned long BOOL;
#endif // WIN9X
#define TRUE 1
#define FALSE 0
#endif
typedef unsigned long bool;
#define true 1
#define false 0
typedef unsigned long long UINT64;
typedef signed long long INT64;
typedef unsigned short WORD;
typedef unsigned short USHORT;
typedef signed short SHORT;
typedef unsigned char BYTE;
typedef unsigned char UCHAR;
typedef signed char CHAR;
typedef unsigned long DWORD;
#define INFINITE 0xFFFFFFFF
#define LESS(a, max_value) ((a) < (max_value) ? (a) : (max_value))
#define MORE(a, min_value) ((a) > (min_value) ? (a) : (min_value))
#define INNER(a, b, c) (((b) <= (c) && (a) >= (b) && (a) <= (c)) || ((b) >= (c) && (a) >= (c) && (a) <= (b)))
#define OUTER(a, b, c) (!INNER((a), (b), (c)))
#define MAKESURE(a, b, c) (((b) <= (c)) ? (MORE(LESS((a), (c)), (b))) : (MORE(LESS((a), (b)), (c))))
#define MIN(a, b) ((a) >= (b) ? (b) : (a))
#define MAX(a, b) ((a) >= (b) ? (a) : (b))
#define EQUAL_BOOL(a, b) (((a) && (b)) || ((!(a)) && (!(b))))
#ifdef OS_WIN32
// NDIS 5.0 related
#include "NDIS5.h"
#endif // OS_WIN32
// Lock
typedef struct _NEO_LOCK
{
#ifdef OS_WIN32
NDIS_SPIN_LOCK spin_lock;
#endif
} NEO_LOCK;
// Event
typedef struct _NEO_EVENT
{
#ifdef OS_WIN32
#ifndef WIN9X
KEVENT *event;
HANDLE event_handle;
#else // WIN9X
DWORD win32_event;
#endif // WIN9X
#endif
} NEO_EVENT;
// Packet queue
typedef struct _NEO_QUEUE
{
struct _NEO_QUEUE *Next;
UINT Size;
void *Buf;
} NEO_QUEUE;
// Status
typedef struct _NEO_STATUS
{
UINT NumPacketSend;
UINT NumPacketRecv;
UINT NumPacketSendError;
UINT NumPacketRecvError;
UINT NumPacketRecvNoBuffer;
} NEO_STATUS;
// NDIS packet buffer
typedef struct _PACKET_BUFFER
{
void *Buf; // Buffer
NDIS_PACKET *NdisPacket; // NDIS packet
NDIS_BUFFER *NdisBuffer; // NDIS packet buffer
NDIS_HANDLE PacketPool; // Packet pool
NDIS_HANDLE BufferPool; // Buffer pool
} PACKET_BUFFER;
// Context
typedef struct _NEO_CTX
{
NEO_EVENT *Event; // Packet reception notification event
BOOL Opened; // Flag of whether opened
BOOL Inited; // Initialization flag
BOOL Initing; // Starting-up flag
volatile BOOL Halting; // Halting flag
BYTE MacAddress[6]; // MAC address
BYTE padding[2]; // padding
NEO_QUEUE *PacketQueue; // Transmission packet queue
NEO_QUEUE *Tail; // Tail of the transmission packet queue
UINT NumPacketQueue; // Number of queued packet
NEO_LOCK *PacketQueueLock; // Transmission packet queue lock
NEO_STATUS Status; // Status
UINT CurrentPacketFilter; // Current packet filter value
UINT CurrentProtocolOptions; // Current protocol option value
BOOL Connected, ConnectedOld; // Cable connection state
BOOL ConnectedForce; // Connection state forcibly notification
#ifdef OS_WIN32
NDIS_HANDLE NdisWrapper; // NDIS wrapper handle
NDIS_HANDLE NdisControl; // NDIS control handle
NDIS_HANDLE NdisMiniport; // NDIS miniport handle
NDIS_HANDLE NdisContext; // NDIS context handle
NDIS_HANDLE NdisConfig; // NDIS Config handle
DEVICE_OBJECT *NdisControlDevice; // NDIS control device
PDRIVER_DISPATCH DispatchTable[IRP_MJ_MAXIMUM_FUNCTION];
PACKET_BUFFER *PacketBuffer[NEO_MAX_PACKET_EXCHANGE]; // NDIS packet buffer
NDIS_PACKET *PacketBufferArray[NEO_MAX_PACKET_EXCHANGE]; // NDIS packet buffer array
NDIS_HARDWARE_STATUS HardwareStatus; // Hardware state
char HardwareID[MAX_SIZE]; // Hardware ID
char HardwareID_Raw[MAX_SIZE]; // Original hardware ID
char HardwarePrintableID[MAX_SIZE]; // Hardware ID (for display)
#endif
} NEO_CTX;
extern NEO_CTX *ctx;
// Neo.c routine
void NeoNewStatus(NEO_STATUS *s);
void NeoFreeStatus(NEO_STATUS *s);
BOOL NeoInit();
void NeoShutdown();
void NeoInitPacketQueue();
void NeoFreePacketQueue();
void NeoClearPacketQueue();
void NeoLockPacketQueue();
void NeoUnlockPacketQueue();
NEO_QUEUE *NeoGetNextQueue();
void NeoFreeQueue(NEO_QUEUE *q);
void NeoInsertQueue(void *buf, UINT size);
UINT NeoGetNumQueue();
void NeoStartAdapter();
void NeoStopAdapter();
void NeoRead(void *buf);
void NeoWrite(void *buf);
// Common routine (platform dependent)
void *NeoMalloc(UINT size);
void *NeoZeroMalloc(UINT size);
void NeoFree(void *p);
void NeoCopy(void *dst, void *src, UINT size);
void NeoZero(void *dst, UINT size);
NEO_LOCK *NeoNewLock();
void NeoLock(NEO_LOCK *lock);
void NeoUnlock(NEO_LOCK *lock);
void NeoFreeLock(NEO_LOCK *lock);
NEO_EVENT *NeoNewEvent(char *name);
NEO_EVENT *NeoCreateWin9xEvent(DWORD h);
void NeoFreeEvent(NEO_EVENT *event);
void NeoSet(NEO_EVENT *event);
void NeoReset(NEO_EVENT *event);
BOOL NeoIsKernelAddress(void *addr);
#endif // NEO_DEVICE_DRIVER
#endif // NEO_H
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
// Department of Computer Science has dozens of overly-enthusiastic geeks.
// Join us: http://www.tsukuba.ac.jp/english/admission/

63
src/Neo/Neo.rc Normal file
View File

@ -0,0 +1,63 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// Japanese resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
#ifdef _WIN32
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
#pragma code_page(932)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // Japanese resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

280
src/Neo/Neo.vcproj Normal file
View File

@ -0,0 +1,280 @@
<?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="Neo"
ProjectGUID="{D302D5D9-A3B7-4D2E-98BF-3BB305BAE43F}"
RootNamespace="Neo"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)bin"
IntermediateDirectory="$(PlatformName)_$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="3"
InlineFunctionExpansion="0"
EnableIntrinsicFunctions="false"
FavorSizeOrSpeed="0"
AdditionalIncludeDirectories="$(SolutionDir)Mayaqua\win32_inc;C:\WINDDK\7600.16385.0\inc\ddk;C:\WinDDK\7600.16385.0\inc\api;C:\WinDDK\7600.16385.0\inc\crt;$(SolutionDir)"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NEO_EXPORTS;VPN_SPEED"
StringPooling="false"
ExceptionHandling="0"
RuntimeLibrary="0"
StructMemberAlignment="4"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CallingConvention="2"
CompileAs="1"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="$(SolutionDir)bin\BuildUtil.exe /CMD:GenerateVersionResource &quot;$(TargetPath)&quot; /OUT:&quot;$(SolutionDir)tmp\VersionResources\$(ProjectName)_$(PlatformName).res&quot;"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalOptions="/driver /subsystem:native,5.00 /FULLBUILD /align:0x80 /osversion:5.00 /STACK:0x40000,0x1000 /MERGE:_PAGE=PAGE /MERGE:_TEXT=.text /NODEFAULTLIB /stub:C:\WINDDK\7600.16385.0\lib\wnet\stub512.com"
AdditionalDependencies="wdm.lib ndis.lib wdmsec.lib &quot;$(SolutionDir)tmp\VersionResources\$(ProjectName)_$(PlatformName).res&quot;"
OutputFile="$(OutDir)\hamcore\not_signed\vpn_driver.sys"
LinkIncremental="1"
AdditionalLibraryDirectories="C:\WINDDK\7600.16385.0\lib\wnet\i386"
GenerateManifest="false"
IgnoreAllDefaultLibraries="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(SolutionDir)DebugFiles\pdb\$(PlatformName)_$(ConfigurationName)\$(ProjectName).pdb"
GenerateMapFile="true"
MapFileName="$(SolutionDir)DebugFiles\map\$(PlatformName)_$(ConfigurationName)\$(ProjectName).map"
SubSystem="0"
OptimizeReferences="1"
EnableCOMDATFolding="1"
EntryPointSymbol="DriverEntry"
BaseAddress="0x10000"
RandomizedBaseAddress="0"
FixedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(SolutionDir)tmp\lib\$(PlatformName)_$(ConfigurationName)\$(ProjectName).lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
EmbedManifest="false"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="$(SolutionDir)bin\BuildUtil.exe /CMD:SignCode &quot;$(TargetPath)&quot; /COMMENT:&quot;VPN Software&quot; /KERNEL:yes&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)bin"
IntermediateDirectory="$(PlatformName)_$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="0"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="0"
EnableIntrinsicFunctions="false"
FavorSizeOrSpeed="0"
AdditionalIncludeDirectories="$(SolutionDir)Mayaqua\win32_inc;C:\WINDDK\7600.16385.0\inc\ddk;C:\WinDDK\7600.16385.0\inc\api;C:\WinDDK\7600.16385.0\inc\crt;$(SolutionDir)"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NEO_EXPORTS;VPN_SPEED;CPU_64"
StringPooling="false"
ExceptionHandling="0"
RuntimeLibrary="0"
StructMemberAlignment="4"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="false"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CallingConvention="2"
CompileAs="1"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
CommandLine="$(SolutionDir)bin\BuildUtil.exe /CMD:GenerateVersionResource &quot;$(TargetPath)&quot; /OUT:&quot;$(SolutionDir)tmp\VersionResources\$(ProjectName)_$(PlatformName).res&quot;"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalOptions="/driver /subsystem:native /FULLBUILD /align:0x80 /osversion:5.00 /STACK:0x40000,0x1000 /MERGE:_PAGE=PAGE /MERGE:_TEXT=.text /NODEFAULTLIB /stub:C:\WINDDK\7600.16385.0\lib\wnet\stub512.com"
AdditionalDependencies="wdm.lib ndis.lib wdmsec.lib &quot;$(SolutionDir)tmp\VersionResources\$(ProjectName)_$(PlatformName).res&quot;"
OutputFile="$(OutDir)\hamcore\not_signed\vpn_driver_x64.sys"
LinkIncremental="1"
AdditionalLibraryDirectories="C:\WINDDK\7600.16385.0\lib\wnet\amd64"
GenerateManifest="false"
IgnoreAllDefaultLibraries="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(SolutionDir)DebugFiles\pdb\$(PlatformName)_$(ConfigurationName)\$(ProjectName).pdb"
GenerateMapFile="true"
MapFileName="$(SolutionDir)DebugFiles\map\$(PlatformName)_$(ConfigurationName)\$(ProjectName).map"
SubSystem="0"
OptimizeReferences="1"
EnableCOMDATFolding="1"
EntryPointSymbol="DriverEntry"
BaseAddress="0x10000"
RandomizedBaseAddress="0"
FixedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary="$(SolutionDir)tmp\lib\$(PlatformName)_$(ConfigurationName)\$(ProjectName).lib"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
EmbedManifest="false"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="$(SolutionDir)bin\BuildUtil.exe /CMD:SignCode &quot;$(TargetPath)&quot; /COMMENT:&quot;VPN Software&quot; /KERNEL:yes&#x0D;&#x0A;&#x0D;&#x0A;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\NDIS5.c"
>
</File>
<File
RelativePath=".\Neo.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\NDIS5.h"
>
</File>
<File
RelativePath=".\Neo.h"
>
</File>
<File
RelativePath=".\resource.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\Neo.rc"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

84
src/Neo/resource.h Normal file
View File

@ -0,0 +1,84 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Neo.rc
//
// Comments: Tetsuo Sugiyama, Ph.D.
//
//
// 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.
//
// 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License version 2
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// THE LICENSE AGREEMENT IS ATTACHED ON THE SOURCE-CODE PACKAGE
// AS "LICENSE.TXT" FILE. READ THE TEXT FILE IN ADVANCE TO USE THE SOFTWARE.
//
//
// THIS SOFTWARE IS DEVELOPED IN JAPAN, AND DISTRIBUTED FROM JAPAN,
// UNDER JAPANESE LAWS. YOU MUST AGREE IN ADVANCE TO USE, COPY, MODIFY,
// MERGE, PUBLISH, DISTRIBUTE, SUBLICENSE, AND/OR SELL COPIES OF THIS
// SOFTWARE, THAT ANY JURIDICAL DISPUTES WHICH ARE CONCERNED TO THIS
// SOFTWARE OR ITS CONTENTS, AGAINST US (SOFTETHER PROJECT, SOFTETHER
// CORPORATION, DAIYUU NOBORI OR OTHER SUPPLIERS), OR ANY JURIDICAL
// DISPUTES AGAINST US WHICH ARE CAUSED BY ANY KIND OF USING, COPYING,
// MODIFYING, MERGING, PUBLISHING, DISTRIBUTING, SUBLICENSING, AND/OR
// SELLING COPIES OF THIS SOFTWARE SHALL BE REGARDED AS BE CONSTRUED AND
// CONTROLLED BY JAPANESE LAWS, AND YOU MUST FURTHER CONSENT TO
// EXCLUSIVE JURISDICTION AND VENUE IN THE COURTS SITTING IN TOKYO,
// JAPAN. YOU MUST WAIVE ALL DEFENSES OF LACK OF PERSONAL JURISDICTION
// AND FORUM NON CONVENIENS. PROCESS MAY BE SERVED ON EITHER PARTY IN
// THE MANNER AUTHORIZED BY APPLICABLE LAW OR COURT RULE.
//
// USE ONLY IN JAPAN. DO NOT USE IT IN OTHER COUNTRIES. IMPORTING THIS
// SOFTWARE INTO OTHER COUNTRIES IS AT YOUR OWN RISK. SOME COUNTRIES
// PROHIBIT ENCRYPTED COMMUNICATIONS. USING THIS SOFTWARE IN OTHER
// COUNTRIES MIGHT BE RESTRICTED.
//
//
// DEAR SECURITY EXPERTS
// ---------------------
//
// If you find a bug or a security vulnerability please kindly inform us
// about the problem immediately so that we can fix the security problem
// to protect a lot of users around the world as soon as possible.
//
// Our e-mail address for security reports is:
// softether-vpn-security [at] softether.org
//
// Please note that the above e-mail address is not a technical support
// inquiry address. If you need technical assistance, please visit
// http://www.softether.org/ and ask your question on the users forum.
//
// Thank you for your cooperation.
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
// Department of Computer Science has dozens of overly-enthusiastic geeks.
// Join us: http://www.tsukuba.ac.jp/english/admission/