summaryrefslogtreecommitdiff
path: root/network/ndis/extension/samples/passthrough
diff options
context:
space:
mode:
authorDave Wilson <[email protected]>2015-03-17 19:50:07 -0700
committerDave Wilson <[email protected]>2015-03-17 19:50:07 -0700
commit97cf5197cf5b882b2c689d8dc2b555f2edf8f418 (patch)
tree46f3701832d70b420eb0fc0eb93261f9da45db3f /network/ndis/extension/samples/passthrough
parentef1905bf1e8825bb31120dfb27e0daf3154d859a (diff)
Initial publish
Diffstat (limited to 'network/ndis/extension/samples/passthrough')
-rw-r--r--network/ndis/extension/samples/passthrough/MsPassthroughExt.c597
-rw-r--r--network/ndis/extension/samples/passthrough/MsPassthroughExt.rc24
-rw-r--r--network/ndis/extension/samples/passthrough/install.cmd1
-rw-r--r--network/ndis/extension/samples/passthrough/mspassthroughext.inf89
-rw-r--r--network/ndis/extension/samples/passthrough/mspassthroughext.vcxproj127
-rw-r--r--network/ndis/extension/samples/passthrough/mspassthroughext.vcxproj.Filters34
-rw-r--r--network/ndis/extension/samples/passthrough/precomp.h11
-rw-r--r--network/ndis/extension/samples/passthrough/precompsrc.c1
-rw-r--r--network/ndis/extension/samples/passthrough/uninstall.cmd1
9 files changed, 885 insertions, 0 deletions
diff --git a/network/ndis/extension/samples/passthrough/MsPassthroughExt.c b/network/ndis/extension/samples/passthrough/MsPassthroughExt.c
new file mode 100644
index 00000000..e99eeac5
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/MsPassthroughExt.c
@@ -0,0 +1,597 @@
+/*++
+
+Copyright (c) Microsoft Corporation. All Rights Reserved.
+
+Module Name:
+
+ MsPassthroughExt.c
+
+Abstract:
+
+ This file contains the implementation of a passthrough filter
+ utilizing SxBase.lib.
+
+
+--*/
+
+#include "precomp.h"
+
+UCHAR SxExtMajorNdisVersion = NDIS_FILTER_MAJOR_VERSION;
+UCHAR SxExtMinorNdisVersion = NDIS_FILTER_MINOR_VERSION;
+PWCHAR SxExtFriendlyName = L"Microsoft Sample Passthrough Extension";
+PWCHAR SxExtUniqueName = L"{2A06F1CB-1B9B-43A8-ADF7-B7D44A9EE71C}";
+PWCHAR SxExtServiceName = L"MsPassthroughExt";
+ULONG SxExtAllocationTag = 'tPsM';
+ULONG SxExtOidRequestId = 'tPsM';
+
+
+NDIS_STATUS
+SxExtInitialize()
+{
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+VOID
+SxExtUninitialize()
+{
+ return;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtCreateSwitch(
+ PSX_SWITCH_OBJECT Switch,
+ PNDIS_HANDLE *ExtensionContext
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+
+ *ExtensionContext = NULL;
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtDeleteSwitch(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtActivateSwitch(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtRestartSwitch(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtPauseSwitch(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtCreatePort(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PORT_PARAMETERS Port
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Port);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtUpdatePort(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PORT_PARAMETERS Port
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Port);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtCreateNic(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_PARAMETERS Nic
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Nic);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtConnectNic(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_PARAMETERS Nic
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Nic);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtUpdateNic(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_PARAMETERS Nic
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Nic);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtDisconnectNic(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_PARAMETERS Nic
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Nic);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtDeleteNic(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_PARAMETERS Nic
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Nic);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtTeardownPort(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PORT_PARAMETERS Port
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Port);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtDeletePort(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PORT_PARAMETERS Port
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(Port);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtSaveNic(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_SAVE_STATE SaveState,
+ PULONG BytesWritten,
+ PULONG BytesNeeded
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(SaveState);
+
+ *BytesWritten = 0;
+ *BytesNeeded = 0;
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtSaveNicComplete(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_SAVE_STATE SaveState
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(SaveState);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtNicRestore(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_SAVE_STATE SaveState,
+ PULONG BytesRestored
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(SaveState);
+
+ *BytesRestored = 0;
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtNicRestoreComplete(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_NIC_SAVE_STATE SaveState
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(SaveState);
+
+ return;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtAddSwitchProperty(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PROPERTY_PARAMETERS SwitchProperty
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(SwitchProperty);
+
+ return NDIS_STATUS_NOT_SUPPORTED;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtUpdateSwitchProperty(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PROPERTY_PARAMETERS SwitchProperty
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(SwitchProperty);
+
+ return NDIS_STATUS_NOT_SUPPORTED;
+}
+
+
+_Use_decl_annotations_
+BOOLEAN
+SxExtDeleteSwitchProperty(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PROPERTY_DELETE_PARAMETERS SwitchProperty
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(SwitchProperty);
+
+ return FALSE;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtAddPortProperty(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PORT_PROPERTY_PARAMETERS PortProperty
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(PortProperty);
+
+ return NDIS_STATUS_NOT_SUPPORTED;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtUpdatePortProperty(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PORT_PROPERTY_PARAMETERS PortProperty
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(PortProperty);
+
+ return NDIS_STATUS_NOT_SUPPORTED;
+}
+
+
+_Use_decl_annotations_
+BOOLEAN
+SxExtDeletePortProperty(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PORT_PROPERTY_DELETE_PARAMETERS PortProperty
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(PortProperty);
+
+ return FALSE;
+}
+
+
+_Use_decl_annotations_
+BOOLEAN
+SxExtQuerySwitchFeatureStatus(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_FEATURE_STATUS_PARAMETERS SwitchFeatureStatus,
+ PULONG BytesNeeded
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(SwitchFeatureStatus);
+ UNREFERENCED_PARAMETER(BytesNeeded);
+
+ return FALSE;
+}
+
+
+_Use_decl_annotations_
+BOOLEAN
+SxExtQueryPortFeatureStatus(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_SWITCH_PORT_FEATURE_STATUS_PARAMETERS PortFeatureStatus,
+ PULONG BytesNeeded
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(PortFeatureStatus);
+ UNREFERENCED_PARAMETER(BytesNeeded);
+
+ return FALSE;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtProcessNicRequest(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_OID_REQUEST OidRequest,
+ PNDIS_SWITCH_PORT_ID SourcePortId,
+ PNDIS_SWITCH_NIC_INDEX SourceNicIndex,
+ PNDIS_SWITCH_PORT_ID DestinationPortId,
+ PNDIS_SWITCH_NIC_INDEX DestinationNicIndex
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(OidRequest);
+ UNREFERENCED_PARAMETER(SourcePortId);
+ UNREFERENCED_PARAMETER(SourceNicIndex);
+ UNREFERENCED_PARAMETER(DestinationPortId);
+ UNREFERENCED_PARAMETER(DestinationNicIndex);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtProcessNicRequestComplete(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_OID_REQUEST OidRequest,
+ NDIS_SWITCH_PORT_ID SourcePortId,
+ NDIS_SWITCH_NIC_INDEX SourceNicIndex,
+ NDIS_SWITCH_PORT_ID DestinationPortId,
+ NDIS_SWITCH_NIC_INDEX DestinationNicIndex,
+ NDIS_STATUS Status
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(OidRequest);
+ UNREFERENCED_PARAMETER(SourcePortId);
+ UNREFERENCED_PARAMETER(SourceNicIndex);
+ UNREFERENCED_PARAMETER(DestinationPortId);
+ UNREFERENCED_PARAMETER(DestinationNicIndex);
+ UNREFERENCED_PARAMETER(Status);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+NDIS_STATUS
+SxExtProcessNicStatus(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNDIS_STATUS_INDICATION StatusIndication,
+ NDIS_SWITCH_PORT_ID SourcePortId,
+ NDIS_SWITCH_NIC_INDEX SourceNicIndex
+ )
+{
+ UNREFERENCED_PARAMETER(Switch);
+ UNREFERENCED_PARAMETER(ExtensionContext);
+ UNREFERENCED_PARAMETER(StatusIndication);
+ UNREFERENCED_PARAMETER(SourcePortId);
+ UNREFERENCED_PARAMETER(SourceNicIndex);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtStartNetBufferListsIngress(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNET_BUFFER_LIST NetBufferLists,
+ ULONG SendFlags
+ )
+{
+ UNREFERENCED_PARAMETER(ExtensionContext);
+
+ SxLibSendNetBufferListsIngress(Switch,
+ NetBufferLists,
+ SendFlags,
+ 0);
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtStartNetBufferListsEgress(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNET_BUFFER_LIST NetBufferLists,
+ ULONG NumberOfNetBufferLists,
+ ULONG ReceiveFlags
+ )
+{
+ UNREFERENCED_PARAMETER(ExtensionContext);
+
+ SxLibSendNetBufferListsEgress(Switch,
+ NetBufferLists,
+ NumberOfNetBufferLists,
+ ReceiveFlags);
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtStartCompleteNetBufferListsEgress(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNET_BUFFER_LIST NetBufferLists,
+ ULONG ReturnFlags
+ )
+{
+ UNREFERENCED_PARAMETER(ExtensionContext);
+
+ SxLibCompleteNetBufferListsEgress(Switch,
+ NetBufferLists,
+ ReturnFlags);
+}
+
+
+_Use_decl_annotations_
+VOID
+SxExtStartCompleteNetBufferListsIngress(
+ PSX_SWITCH_OBJECT Switch,
+ NDIS_HANDLE ExtensionContext,
+ PNET_BUFFER_LIST NetBufferLists,
+ ULONG SendCompleteFlags
+ )
+{
+ UNREFERENCED_PARAMETER(ExtensionContext);
+
+ SxLibCompleteNetBufferListsIngress(Switch,
+ NetBufferLists,
+ SendCompleteFlags);
+}
+
diff --git a/network/ndis/extension/samples/passthrough/MsPassthroughExt.rc b/network/ndis/extension/samples/passthrough/MsPassthroughExt.rc
new file mode 100644
index 00000000..c76ed707
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/MsPassthroughExt.rc
@@ -0,0 +1,24 @@
+//
+// Copyright (c) Microsoft Corporation. All Rights Reserved.
+//
+
+#include <windows.h>
+#include <ntverp.h>
+
+/*-----------------------------------------------*/
+/* the following lines are specific to this file */
+/*-----------------------------------------------*/
+
+/* VER_FILETYPE, VER_FILESUBTYPE, VER_FILEDESCRIPTION_STR
+ * and VER_INTERNALNAME_STR must be defined before including COMMON.VER
+ * The strings don't need a '\0', since common.ver has them.
+ */
+#define VER_FILETYPE VFT_DRV
+#define VER_FILESUBTYPE VFT2_DRV_NETWORK
+#define VER_FILEDESCRIPTION_STR "Microsoft Sample Passthrough Extension"
+#define VER_INTERNALNAME_STR "mspassthroughext.SYS"
+#define VER_ORIGINALFILENAME_STR "mspassthroughext.SYS"
+#define VER_LANGNEUTRAL
+
+#include "common.ver"
+
diff --git a/network/ndis/extension/samples/passthrough/install.cmd b/network/ndis/extension/samples/passthrough/install.cmd
new file mode 100644
index 00000000..0bacc039
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/install.cmd
@@ -0,0 +1 @@
+netcfg -l .\MSPassthroughExt.inf -c s -i ms_passthroughext \ No newline at end of file
diff --git a/network/ndis/extension/samples/passthrough/mspassthroughext.inf b/network/ndis/extension/samples/passthrough/mspassthroughext.inf
new file mode 100644
index 00000000..6a6b941d
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/mspassthroughext.inf
@@ -0,0 +1,89 @@
+;
+; Copyright (c) Microsoft Corporation. All Rights Reserved.
+;
+
+[version]
+Signature = "$Windows NT$"
+Class = NetService
+ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318}
+Provider = %Msft%
+CatalogFile = mspassthroughext.cat
+DriverVer = 08/29/2011,1.0
+
+[Manufacturer]
+%Msft%=MSFT,NTx86,NTia64,NTamd64
+
+[MSFT.NTx86]
+%MSPassthroughExt_Desc%=Install, MS_passthroughext
+
+[MSFT.NTia64]
+%MSPassthroughExt_Desc%=Install, MS_passthroughext
+
+[MSFT.NTamd64]
+%MSPassthroughExt_Desc%=Install, MS_passthroughext
+
+;-------------------------------------------------------------------------
+; Installation Section
+;-------------------------------------------------------------------------
+[Install]
+AddReg=Inst_Ndi
+Characteristics=0x40000
+NetCfgInstanceId="{2A06F1CB-1B9B-43A8-ADF7-B7D44A9EE71C}"
+Copyfiles = MSPassthroughExt.copyfiles.sys
+
+[SourceDisksNames]
+1=%MSPassthroughExt_Desc%,"",,
+
+[SourceDisksFiles]
+MSPassthroughExt.sys=1
+
+[DestinationDirs]
+DefaultDestDir=12
+MSPassthroughExt.copyfiles.sys=12
+
+[MSPassthroughExt.copyfiles.sys]
+MSPassthroughExt.sys,,,2
+
+
+;-------------------------------------------------------------------------
+; Ndi installation support
+;-------------------------------------------------------------------------
+[Inst_Ndi]
+HKR, Ndi,Service,,"MSPassthroughExt"
+HKR, Ndi,CoServices,0x00010000,"MSPassthroughExt"
+HKR, Ndi,HelpText,,%MSPassthroughExt_HelpText%
+HKR, Ndi,FilterClass,,"ms_switch_filter"
+HKR, Ndi,FilterType,0x00010001,0x00000002
+HKR, Ndi\Interfaces,UpperRange,,"noupper"
+HKR, Ndi\Interfaces,LowerRange,,"nolower"
+HKR, Ndi\Interfaces, FilterMediaTypes,,"vmnetextension"
+HKR, Ndi,FilterRunType, 0x00010001, 2 ; optional
+
+;-------------------------------------------------------------------------
+; Service installation support, common.EventLog here is to demonstrate how to
+; write an enent log
+;-------------------------------------------------------------------------
+[Install.Services]
+AddService=MSPassthroughExt,,MSPassthroughExt_Service_Inst;, common.EventLog
+
+[MSPassthroughExt_Service_Inst]
+DisplayName = %MSPassthroughExt_Desc%
+ServiceType = 1 ;SERVICE_KERNEL_DRIVER
+StartType = 1 ;SERVICE_SYSTEM_START
+ErrorControl = 1 ;SERVICE_ERROR_NORMAL
+ServiceBinary = %12%\MSPassthroughExt.sys
+LoadOrderGroup = NDIS
+Description = %MSPassthroughExt_Desc%
+AddReg = Common.Params.reg
+
+[Install.Remove.Services]
+DelService=MSPassthroughExt,0x200
+
+[Strings]
+Msft = "Microsoft"
+MSPassthroughExt_Desc = "Microsoft Sample Passthrough Extension"
+MSPassthroughExt_HelpText = "Sample for filtering extension using SxBase"
+
+
+
+
diff --git a/network/ndis/extension/samples/passthrough/mspassthroughext.vcxproj b/network/ndis/extension/samples/passthrough/mspassthroughext.vcxproj
new file mode 100644
index 00000000..cda7cbbf
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/mspassthroughext.vcxproj
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{2339B4A8-60AF-4172-AC68-3159E6D001EC}</ProjectGuid>
+ <RootNamespace>$(MSBuildProjectName)</RootNamespace>
+ <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
+ <Platform Condition="'$(Platform)' == ''">x64</Platform>
+ <SampleGuid>{DA3F14BC-0746-46C8-99E7-339173543E27}</SampleGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>False</UseDebugLibraries>
+ <DriverTargetPlatform>Desktop</DriverTargetPlatform>
+ <DriverType>WDM</DriverType>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetVersion>Windows10</TargetVersion>
+ <UseDebugLibraries>True</UseDebugLibraries>
+ <DriverTargetPlatform>Desktop</DriverTargetPlatform>
+ <DriverType>WDM</DriverType>
+ <PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
+ <ConfigurationType>Driver</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <PropertyGroup>
+ <OutDir>$(IntDir)</OutDir>
+ </PropertyGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
+ </ImportGroup>
+ <ItemGroup Label="WrappedTaskItems" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <TargetName>mspassthroughext</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <TargetName>mspassthroughext</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1</PreprocessorDefinitions>
+ </ClCompile>
+ <Midl>
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1</PreprocessorDefinitions>
+ </Midl>
+ <ResourceCompile>
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1</PreprocessorDefinitions>
+ </ResourceCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1</PreprocessorDefinitions>
+ </ClCompile>
+ <Midl>
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1</PreprocessorDefinitions>
+ </Midl>
+ <ResourceCompile>
+ <PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1</PreprocessorDefinitions>
+ </ResourceCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib;.\..\..\base\$(IntDir)\sxbase.lib</AdditionalDependencies>
+ </Link>
+ <ClCompile>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <WarningLevel>Level4</WarningLevel>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Link>
+ <AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib;.\..\..\base\$(IntDir)\sxbase.lib</AdditionalDependencies>
+ </Link>
+ <ClCompile>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <WarningLevel>Level4</WarningLevel>
+ <ExceptionHandling>
+ </ExceptionHandling>
+ </ClCompile>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="MsPassthroughExt.c">
+ <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile>
+ <PreCompiledHeader>Use</PreCompiledHeader>
+ <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile>
+ </ClCompile>
+ <ClCompile Include="precompsrc.c">
+ <AdditionalIncludeDirectories>;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreCompiledHeaderFile>precomp.h</PreCompiledHeaderFile>
+ <PreCompiledHeader>Create</PreCompiledHeader>
+ <PreCompiledHeaderOutputFile>$(IntDir)\precomp.h.pch</PreCompiledHeaderOutputFile>
+ </ClCompile>
+ <ResourceCompile Include="MsPassthroughExt.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <Inf Exclude="@(Inf)" Include="*.inf" />
+ <FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" />
+ <FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Exclude="@(None)" Include="*.txt;*.htm;*.html" />
+ <None Exclude="@(None)" Include="*.ico;*.cur;*.bmp;*.dlg;*.rct;*.gif;*.jpg;*.jpeg;*.wav;*.jpe;*.tiff;*.tif;*.png;*.rc2" />
+ <None Exclude="@(None)" Include="*.def;*.bat;*.hpj;*.asmx" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Exclude="@(ClInclude)" Include="*.h;*.hpp;*.hxx;*.hm;*.inl;*.xsd" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+</Project> \ No newline at end of file
diff --git a/network/ndis/extension/samples/passthrough/mspassthroughext.vcxproj.Filters b/network/ndis/extension/samples/passthrough/mspassthroughext.vcxproj.Filters
new file mode 100644
index 00000000..b43daf1e
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/mspassthroughext.vcxproj.Filters
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;*</Extensions>
+ <UniqueIdentifier>{555B7D63-D8B9-4382-8D6E-A97AC09CE282}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files">
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ <UniqueIdentifier>{797B07B8-0B76-4BA6-BDF4-45786B031900}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files">
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms;man;xml</Extensions>
+ <UniqueIdentifier>{D95F4A4C-E2E8-4108-86FB-C568FA437FA1}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Driver Files">
+ <Extensions>inf;inv;inx;mof;mc;</Extensions>
+ <UniqueIdentifier>{F05BF5D9-0765-4293-B2AB-41B06C544956}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="MsPassthroughExt.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="precompsrc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="MsPassthroughExt.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/network/ndis/extension/samples/passthrough/precomp.h b/network/ndis/extension/samples/passthrough/precomp.h
new file mode 100644
index 00000000..ca260479
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/precomp.h
@@ -0,0 +1,11 @@
+//
+// Copyright (c) Microsoft Corporation. All Rights Reserved.
+//
+
+#include <ndis.h>
+#include <netiodef.h>
+#include <intsafe.h>
+#include <ntintsafe.h>
+#include "..\..\base\SxBase.h"
+#include "..\..\base\SxApi.h"
+#include "..\..\base\SxLibrary.h" \ No newline at end of file
diff --git a/network/ndis/extension/samples/passthrough/precompsrc.c b/network/ndis/extension/samples/passthrough/precompsrc.c
new file mode 100644
index 00000000..5944cf51
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/precompsrc.c
@@ -0,0 +1 @@
+#include "precomp.h" \ No newline at end of file
diff --git a/network/ndis/extension/samples/passthrough/uninstall.cmd b/network/ndis/extension/samples/passthrough/uninstall.cmd
new file mode 100644
index 00000000..369b6665
--- /dev/null
+++ b/network/ndis/extension/samples/passthrough/uninstall.cmd
@@ -0,0 +1 @@
+netcfg -u ms_passthroughext \ No newline at end of file