Skip to content

Commit

Permalink
Merge pull request microsoft#237 from DmitryMalloy/master
Browse files Browse the repository at this point in the history
RSSv2 library and sample OID handlers
  • Loading branch information
NeoAdonis authored Apr 23, 2018
2 parents 6e0319c + 9764486 commit d996ca1
Show file tree
Hide file tree
Showing 16 changed files with 2,863 additions and 1 deletion.
Binary file added network/ndis/netvmini/6x/680/netvmini680.inf
Binary file not shown.
50 changes: 50 additions & 0 deletions network/ndis/netvmini/6x/680/netvmini680.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*++

Copyright (c) Microsoft Corporation. All rights reserved.

THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
PURPOSE.

Module Name:

netvmini680.rc

Abstract:

Internal resource file for driver.

--*/

#include <windows.h>
#include <ntverp.h>

#define VER_FILETYPE VFT_DRV
#define VER_FILESUBTYPE VFT2_DRV_SYSTEM
#define VER_FILEDESCRIPTION_STR "Microsoft Virtual Miniport Driver"
#define VER_INTERNALNAME_STR "netvmini680.sys"
#define VER_ORIGINALFILENAME_STR "netvmini680.sys"


#define VER_FILEVERSION 4,30,00,0000
#define VER_FILEVERSION_STR "4.30.00.0000"

#undef VER_PRODUCTVERSION
#define VER_PRODUCTVERSION VER_FILEVERSION

#undef VER_PRODUCTVERSION_STR
#define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR

#define VER_LEGALCOPYRIGHT_STR "Copyright (C) 2009 Microsoft Corporation"
#ifdef VER_COMPANYNAME_STR
#undef VER_COMPANYNAME_STR
#define VER_COMPANYNAME_STR "Microsoft Corporation"
#endif

#undef VER_PRODUCTNAME_STR
#define VER_PRODUCTNAME_STR "Microsoft Virtual Network Adapter (NDIS 6.80 Miniport)"
#define VER_LANGNEUTRAL

#include "common.ver"

217 changes: 217 additions & 0 deletions network/ndis/netvmini/6x/680/netvmini680.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
<?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|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<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>{7B9C33BA-F817-42B9-A355-9E54854CE9D6}</ProjectGuid>
<RootNamespace>$(MSBuildProjectName)</RootNamespace>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<SampleGuid>{173BE266-31F2-4D74-A9C1-35B20D4DD5EA}</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>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<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|Win32'">
<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>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" />
</ImportGroup>
<ItemGroup Label="WrappedTaskItems">
<ClCompile Include="..\miniport.c; ..\adapter.c; ..\ctrlpath.c; ..\datapath.c; ..\tcbrcb.c; ..\mphal.c; ..\vmq.c; ..\qos.c; ..\rssv2.c; ..\rssv2lib.c">
<WppEnabled>true</WppEnabled>
<WppKernelMode>true</WppKernelMode>
<WppTraceFunction>DEBUGP(LEVEL,MSG,...)</WppTraceFunction>
</ClCompile>
<OtherWpp Include="netvmini680.rc">
<WppEnabled>true</WppEnabled>
<WppKernelMode>true</WppKernelMode>
<WppTraceFunction>DEBUGP(LEVEL,MSG,...)</WppTraceFunction>
</OtherWpp>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>netvmini680</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>netvmini680</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>netvmini680</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>netvmini680</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
<DisableSpecificWarnings>%(DisableSpecificWarnings);4201;4214;4127</DisableSpecificWarnings>
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
<Midl>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
<DisableSpecificWarnings>%(DisableSpecificWarnings);4201;4214;4127</DisableSpecificWarnings>
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
<Midl>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
<DisableSpecificWarnings>%(DisableSpecificWarnings);4201;4214;4127</DisableSpecificWarnings>
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
<Midl>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level4</WarningLevel>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
<DisableSpecificWarnings>%(DisableSpecificWarnings);4201;4214;4127</DisableSpecificWarnings>
<ExceptionHandling>
</ExceptionHandling>
</ClCompile>
<Midl>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS680_MINIPORT=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_MINIPORT_DRIVER=1</PreprocessorDefinitions>
<PreprocessorDefinitions>%(PreprocessorDefinitions);NDIS_WDM=1</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>%(AdditionalDependencies);$(DDK_LIB_PATH)\ndis.lib</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="netvmini680.rc" />
</ItemGroup>
<ItemGroup>
<Inf Exclude="@(Inf)" Include="*.inf" />
<FilesToPackage Include="$(TargetPath)" Condition="'$(ConfigurationType)'=='Driver' or '$(ConfigurationType)'=='DynamicLibrary'" />
</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>
58 changes: 58 additions & 0 deletions network/ndis/netvmini/6x/680/netvmini680.vcxproj.Filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?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>{1FEAFB34-8DD3-4B56-A9A1-F6572B7E94F0}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files">
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
<UniqueIdentifier>{4E98F484-F310-4E1A-A097-D7ADBAE1351F}</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>{D8093E47-6AB1-4358-AC7C-7ACE55606993}</UniqueIdentifier>
</Filter>
<Filter Include="Driver Files">
<Extensions>inf;inv;inx;mof;mc;</Extensions>
<UniqueIdentifier>{7E4706EB-3B87-4AB9-BA5C-93CC3E3B78CA}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\adapter.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\ctrlpath.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\datapath.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\miniport.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\mphal.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\qos.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\tcbrcb.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\vmq.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\rssv2.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\rssv2lib.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="netvmini680.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
11 changes: 11 additions & 0 deletions network/ndis/netvmini/6x/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,17 @@ Routine Description:
break;
}

#if (NDIS_SUPPORT_NDIS680)
//
// Set miniport attributes for supported and enabled NDIS RSS features.
//
Status = InitializeRSSConfig(Adapter);
if (NDIS_STATUS_SUCCESS != Status)
{
DEBUGP(MP_ERROR, "[%p] InitializeRSSConfig Status 0x%08x\n", Adapter, Status);
break;
}
#endif
//
// For hardware devices, you should register your interrupt handlers
// here, using NdisMRegisterInterruptEx.
Expand Down
9 changes: 9 additions & 0 deletions network/ndis/netvmini/6x/adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,15 @@ typedef struct _MP_ADAPTER

#endif

#if (NDIS_SUPPORT_NDIS680)

//
// NDIS RSSv2-related data
//
MP_ADAPTER_RSS_DATA RSSData;

#endif

} MP_ADAPTER, *PMP_ADAPTER;

#define MP_ADAPTER_FROM_CONTEXT(_ctx_) ((PMP_ADAPTER)(_ctx_))
Expand Down
Loading

0 comments on commit d996ca1

Please sign in to comment.