Tap driver project config, inf file.

This commit is contained in:
Adam Ierymenko 2013-08-24 12:11:42 -04:00
parent e2effbd1ce
commit 62dd433756
7 changed files with 140 additions and 286 deletions

2
.gitignore vendored
View File

@ -18,3 +18,5 @@ mac-tap/tuntap/tap.kext
*.user
/Win8Release
/vsprojects/TapDriver/Win8Release
*.cache

View File

@ -1,91 +0,0 @@
;
; TapDriver.inf
;
[Version]
Signature="$WINDOWS NT$"
Class=Sample ; TODO: edit Class
ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171} ; TODO: edit ClassGuid
Provider=%ManufacturerName%
CatalogFile=TapDriver.cat
DriverVer= ; TODO: set DriverVer in stampinf property pages
[DestinationDirs]
DefaultDestDir = 12
; ================= Class section =====================
[ClassInstall32]
Addreg=SampleClassReg
[SampleClassReg]
HKR,,,0,%ClassName%
HKR,,Icon,,-5
[SourceDisksNames]
1 = %DiskName%,,,""
[SourceDisksFiles]
TapDriver.sys = 1,,
;*****************************************
; Install Section
;*****************************************
[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$
[Standard.NT$ARCH$]
%TapDriver.DeviceDesc%=TapDriver_Device, Root\TapDriver ; TODO: edit hw-id
[TapDriver_Device.NT]
CopyFiles=Drivers_Dir
[Drivers_Dir]
TapDriver.sys
;-------------- Service installation
[TapDriver_Device.NT.Services]
AddService = TapDriver,%SPSVCINST_ASSOCSERVICE%, TapDriver_Service_Inst
; -------------- TapDriver driver install sections
[TapDriver_Service_Inst]
DisplayName = %TapDriver.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\TapDriver.sys
LoadOrderGroup = Extended Base
;
;--- TapDriver_Device Coinstaller installation ------
;
[DestinationDirs]
TapDriver_Device_CoInstaller_CopyFiles = 11
[TapDriver_Device.NT.CoInstallers]
AddReg=TapDriver_Device_CoInstaller_AddReg
CopyFiles=TapDriver_Device_CoInstaller_CopyFiles
[TapDriver_Device_CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller"
[TapDriver_Device_CoInstaller_CopyFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
[SourceDisksFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll=1 ; make sure the number matches with SourceDisksNames
[TapDriver_Device.NT.Wdf]
KmdfService = TapDriver, TapDriver_wdfsect
[TapDriver_wdfsect]
KmdfLibraryVersion = $KMDFVERSION$
[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ManufacturerName="" ; TODO: add ManufacturerName
ClassName="Samples" ; TODO: edit ClassName
DiskName = "TapDriver Installation Disk"
TapDriver.DeviceDesc = "TapDriver Device"
TapDriver.SVCDESC = "TapDriver Service"

View File

@ -123,10 +123,27 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|Win32'">
<TargetName>ztTap100</TargetName>
</PropertyGroup>
<PropertyGroup>
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">
<TargetName>ztTap100</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|Win32'">
<TargetName>ztTap100</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">
<TargetName>ztTap100</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">
<TargetName>ztTap100</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
<TargetName>ztTap100</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WppEnabled>false</WppEnabled>
@ -138,9 +155,42 @@
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">C:\WinDDK\7600.16385.1\lib\wnet\i386\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\i386\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Vista Debug|Win32'">C:\WinDDK\7600.16385.1\lib\wnet\i386\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\i386\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">C:\WinDDK\7600.16385.1\lib\wnet\i386\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\i386\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Vista Release|Win32'">C:\WinDDK\7600.16385.1\lib\wnet\i386\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\i386\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">C:\WinDDK\7600.16385.1\lib\wnet\i386\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\i386\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">C:\WinDDK\7600.16385.1\lib\wnet\i386\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\i386\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Vista Debug|x64'">C:\WinDDK\7600.16385.1\lib\wnet\amd64\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\amd64\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">C:\WinDDK\7600.16385.1\lib\wnet\amd64\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\amd64\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Vista Release|x64'">C:\WinDDK\7600.16385.1\lib\wnet\amd64\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\amd64\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'">C:\WinDDK\7600.16385.1\lib\wnet\amd64\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\amd64\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'">C:\WinDDK\7600.16385.1\lib\wnet\amd64\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\amd64\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">C:\WinDDK\7600.16385.1\lib\wnet\amd64\ndis.lib;C:\WinDDK\7600.16385.1\lib\wnet\amd64\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Inf Include="TapDriver.inf" />
<Inf Include="ztTap100.inf" />
</ItemGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />

View File

@ -18,11 +18,6 @@
<Extensions>inf;inv;inx;mof;mc;</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<Inf Include="TapDriver.inf">
<Filter>Driver Files</Filter>
</Inf>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dhcp.c">
<Filter>Source Files</Filter>
@ -78,4 +73,9 @@
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Inf Include="ztTap100.inf">
<Filter>Driver Files</Filter>
</Inf>
</ItemGroup>
</Project>

View File

@ -6,7 +6,7 @@
#define PRODUCT_TAP_WIN_MINOR 0
#define PRODUCT_TAP_WIN_PROVIDER "ZeroTier Networks"
#define PRODUCT_TAP_WIN_DEVICE_DESCRIPTION PRODUCT_NAME
#define PRODUCT_TAP_WIN_RELDATE "8/1/2013"
#define PRODUCT_TAP_WIN_RELDATE "08/01/2013"
#define TAP_DRIVER_MAJOR_VERSION PRODUCT_TAP_WIN_MAJOR
#define TAP_DRIVER_MINOR_VERSION PRODUCT_TAP_WIN_MINOR

View File

@ -1,187 +0,0 @@
; ****************************************************************************
; * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. *
; * 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. *
; ****************************************************************************
; SYNTAX CHECKER
; cd \WINDDK\3790\tools\chkinf
; chkinf c:\src\openvpn\tap-win32\i386\oemwin2k.inf
; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm
; INSTALL/REMOVE DRIVER
; tapinstall install OemWin2k.inf TAP0901
; tapinstall update OemWin2k.inf TAP0901
; tapinstall remove TAP0901
;*********************************************************
; Note to Developers:
;
; If you are bundling the TAP-Windows driver with your app,
; you should try to rename it in such a way that it will
; not collide with other instances of TAP-Windows defined
; by other apps. Multiple versions of the TAP-Windows
; driver, each installed by different apps, can coexist
; on the same machine if you follow these guidelines.
; NOTE: these instructions assume you are editing the
; generated OemWin2k.inf file, not the source
; OemWin2k.inf.in file which is preprocessed by winconfig
; and uses macro definitions from settings.in.
;
; (1) Rename all tapXXXX instances in this file to
; something different (use at least 5 characters
; for this name!)
; (2) Change the "!define TAP" definition in openvpn.nsi
; to match what you changed tapXXXX to.
; (3) Change TARGETNAME in SOURCES to match what you
; changed tapXXXX to.
; (4) Change TAP_COMPONENT_ID in common.h to match what
; you changed tapXXXX to.
; (5) Change SZDEPENDENCIES in service.h to match what
; you changed tapXXXX to.
; (6) Change DeviceDescription and Provider strings.
; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you
; set DeviceDescription to.
;
;*********************************************************
[Version]
Signature = "$Windows NT$"
CatalogFile = @PRODUCT_TAP_WIN_COMPONENT_ID@.cat
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %Provider%
Class = Net
; This version number should match the version
; number given in SOURCES.
DriverVer=@PRODUCT_TAP_WIN_RELDATE@,@PRODUCT_TAP_WIN_MAJOR@.00.00.@PRODUCT_TAP_WIN_MINOR@
[Strings]
DeviceDescription = "@PRODUCT_TAP_WIN_DEVICE_DESCRIPTION@"
Provider = "@PRODUCT_TAP_WIN_PROVIDER@"
;----------------------------------------------------------------
; Manufacturer + Product Section (Done)
;----------------------------------------------------------------
[Manufacturer]
%Provider% = @PRODUCT_TAP_WIN_COMPONENT_ID@@INF_PROVIDER_SUFFIX@
[@PRODUCT_TAP_WIN_COMPONENT_ID@@INF_SECTION_SUFFIX@]
%DeviceDescription% = @PRODUCT_TAP_WIN_COMPONENT_ID@.ndi, @PRODUCT_TAP_WIN_COMPONENT_ID@
;---------------------------------------------------------------
; Driver Section (Done)
;---------------------------------------------------------------
;----------------- Characteristics ------------
; NCF_PHYSICAL = 0x04
; NCF_VIRTUAL = 0x01
; NCF_SOFTWARE_ENUMERATED = 0x02
; NCF_HIDDEN = 0x08
; NCF_NO_SERVICE = 0x10
; NCF_HAS_UI = 0x80
;----------------- Characteristics ------------
[@PRODUCT_TAP_WIN_COMPONENT_ID@.ndi]
CopyFiles = @PRODUCT_TAP_WIN_COMPONENT_ID@.driver, @PRODUCT_TAP_WIN_COMPONENT_ID@.files
AddReg = @PRODUCT_TAP_WIN_COMPONENT_ID@.reg
AddReg = @PRODUCT_TAP_WIN_COMPONENT_ID@.params.reg
Characteristics = @PRODUCT_TAP_WIN_CHARACTERISTICS@
[@PRODUCT_TAP_WIN_COMPONENT_ID@.ndi.Services]
AddService = @PRODUCT_TAP_WIN_COMPONENT_ID@, 2, @PRODUCT_TAP_WIN_COMPONENT_ID@.service
[@PRODUCT_TAP_WIN_COMPONENT_ID@.reg]
HKR, Ndi, Service, 0, "@PRODUCT_TAP_WIN_COMPONENT_ID@"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, , Manufacturer, 0, "%Provider%"
HKR, , ProductName, 0, "%DeviceDescription%"
[@PRODUCT_TAP_WIN_COMPONENT_ID@.params.reg]
HKR, Ndi\params\MTU, ParamDesc, 0, "MTU"
HKR, Ndi\params\MTU, Type, 0, "int"
HKR, Ndi\params\MTU, Default, 0, "1500"
HKR, Ndi\params\MTU, Optional, 0, "0"
HKR, Ndi\params\MTU, Min, 0, "100"
HKR, Ndi\params\MTU, Max, 0, "1500"
HKR, Ndi\params\MTU, Step, 0, "1"
HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status"
HKR, Ndi\params\MediaStatus, Type, 0, "enum"
HKR, Ndi\params\MediaStatus, Default, 0, "0"
HKR, Ndi\params\MediaStatus, Optional, 0, "0"
HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled"
HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected"
HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address"
HKR, Ndi\params\MAC, Type, 0, "edit"
HKR, Ndi\params\MAC, Optional, 0, "1"
HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access"
HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum"
HKR, Ndi\params\AllowNonAdmin, Default, 0, "1"
HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0"
HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed"
HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed"
;----------------------------------------------------------------
; Service Section
;----------------------------------------------------------------
;---------- Service Type -------------
; SERVICE_KERNEL_DRIVER = 0x01
; SERVICE_WIN32_OWN_PROCESS = 0x10
;---------- Service Type -------------
;---------- Start Mode ---------------
; SERVICE_BOOT_START = 0x0
; SERVICE_SYSTEM_START = 0x1
; SERVICE_AUTO_START = 0x2
; SERVICE_DEMAND_START = 0x3
; SERVICE_DISABLED = 0x4
;---------- Start Mode ---------------
[@PRODUCT_TAP_WIN_COMPONENT_ID@.service]
DisplayName = %DeviceDescription%
ServiceType = 1
StartType = 3
ErrorControl = 1
LoadOrderGroup = NDIS
ServiceBinary = %12%\@PRODUCT_TAP_WIN_COMPONENT_ID@.sys
;-----------------------------------------------------------------
; File Installation
;-----------------------------------------------------------------
;----------------- Copy Flags ------------
; COPYFLG_NOSKIP = 0x02
; COPYFLG_NOVERSIONCHECK = 0x04
;----------------- Copy Flags ------------
; SourceDisksNames
; diskid = description[, [tagfile] [, <unused>, subdir]]
; 1 = "Intel Driver Disk 1",e100bex.sys,,
[SourceDisksNames]
1 = %DeviceDescription%, @PRODUCT_TAP_WIN_COMPONENT_ID@.sys
; SourceDisksFiles
; filename_on_source = diskID[, [subdir][, size]]
; e100bex.sys = 1,, ; on distribution disk 1
[SourceDisksFiles]
@PRODUCT_TAP_WIN_COMPONENT_ID@.sys = 1
[DestinationDirs]
@PRODUCT_TAP_WIN_COMPONENT_ID@.files = 11
@PRODUCT_TAP_WIN_COMPONENT_ID@.driver = 12
[@PRODUCT_TAP_WIN_COMPONENT_ID@.files]
; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
[@PRODUCT_TAP_WIN_COMPONENT_ID@.driver]
@PRODUCT_TAP_WIN_COMPONENT_ID@.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
;---------------------------------------------------------------
; End
;---------------------------------------------------------------

View File

@ -0,0 +1,80 @@
[Version]
Signature="$WINDOWS NT$"
Class=Net
ClassGuid={4d36e972-e325-11ce-bfc1-08002be10318}
Provider=%Provider%
CatalogFile=ztTap100.cat
[Strings]
DeviceDescription = "ZeroTier One Ethernet Tap"
Provider = "ZeroTier Networks"
[Manufacturer]
%Provider%=ztTap100
[ztTap100]
%DeviceDescription%=ztTap100.ndi,ztTap100
[ztTap100.ndi]
CopyFiles = ztTap100.driver,ztTap100.files
AddReg = ztTap100.reg
AddReg = ztTap100.params.reg
Characteristics = 0x81
[ztTap100.ndi.Services]
AddService = ztTap100, 2, ztTap100.service
[ztTap100.reg]
HKR, Ndi, Service, 0, "ztTap100"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, , Manufacturer, 0, "%Provider%"
HKR, , ProductName, 0, "%DeviceDescription%"
[ztTap100.params.reg]
HKR, Ndi\params\MTU, ParamDesc, 0, "MTU"
HKR, Ndi\params\MTU, Type, 0, "int"
HKR, Ndi\params\MTU, Default, 0, "2800"
HKR, Ndi\params\MTU, Optional, 0, "0"
HKR, Ndi\params\MTU, Min, 0, "100"
HKR, Ndi\params\MTU, Max, 0, "2800"
HKR, Ndi\params\MTU, Step, 0, "1"
HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status"
HKR, Ndi\params\MediaStatus, Type, 0, "enum"
HKR, Ndi\params\MediaStatus, Default, 0, "0"
HKR, Ndi\params\MediaStatus, Optional, 0, "0"
HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled"
HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected"
HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address"
HKR, Ndi\params\MAC, Type, 0, "edit"
HKR, Ndi\params\MAC, Optional, 0, "1"
HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access"
HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum"
HKR, Ndi\params\AllowNonAdmin, Default, 0, "0"
HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0"
HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed"
HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed"
[tap0901.service]
DisplayName = %DeviceDescription%
ServiceType = 1
StartType = 3
ErrorControl = 1
LoadOrderGroup = NDIS
ServiceBinary = %12%\ztTap100.sys
[SourceDisksNames]
1 = %DeviceDescription%, ztTap100.sys
[SourceDisksFiles]
ztTap100.sys = 1
[DestinationDirs]
ztTap100.files = 11
ztTap100.driver = 12
[ztTap100.files]
;
[ztTap100.driver]
ztTap100.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK