diff --git a/.gitattributes b/.gitattributes index 67f4365979..84cd981b0b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,8 +7,8 @@ *.nsh eol=crlf # Tap Driver Installation Script -third_party/tap-windows6/bin/*.inf eol=crlf -third_party/tap-windows6/bin/*.h eol=crlf +third_party/tap-windows6/bin/**/*.inf eol=crlf +third_party/tap-windows6/bin/**/*.h eol=crlf # Allow the build folders to be searched by GitHub's T file search build/** linguist-generated=false diff --git a/client/infrastructure/electron/app_paths.ts b/client/infrastructure/electron/app_paths.ts index 68c5651368..b4866ca0ed 100644 --- a/client/infrastructure/electron/app_paths.ts +++ b/client/infrastructure/electron/app_paths.ts @@ -43,10 +43,22 @@ export function getAppPath() { return electronAppPath; } -export function pathToEmbeddedBinary(filename: string) { - let osName = os.platform().toString(); /* should be either 'linux' or 'win32' */ - if (osName === 'win32') { - osName = 'windows'; +export function pathToEmbeddedTun2socksBinary() { + return path.join( + unpackedAppPath(), 'client', 'output', 'build', + (isWindows ? 'windows' : 'linux'), + 'tun2socks' + (isWindows ? '.exe' : '')); +} + +/** + * Get the parent directory path containing the background service binaries. + * On Windows, this folder contains `OutlineService.exe`. + * While on Linux this folder contains `outline_proxy_controller`. + * @returns A string representing the path of the directory that contains service binaries. + */ +export function pathToEmbeddedOutlineService() { + if (isWindows) { + return getAppPath(); } - return path.join(unpackedAppPath(), 'output', 'build', osName, filename + (isWindows ? '.exe' : '')); + return path.join(unpackedAppPath(), 'client', 'tools', 'outline_proxy_controller', 'dist'); } diff --git a/src/electron/custom_install_steps.nsh b/src/electron/custom_install_steps.nsh index 3f106efcd6..4ca378065d 100755 --- a/src/electron/custom_install_steps.nsh +++ b/src/electron/custom_install_steps.nsh @@ -1,170 +1,170 @@ -; Copyright 2018 The Outline Authors -; -; Licensed under the Apache License, Version 2.0 (the "License"); -; you may not use this file except in compliance with the License. -; You may obtain a copy of the License at -; -; http://www.apache.org/licenses/LICENSE-2.0 -; -; Unless required by applicable law or agreed to in writing, software -; distributed under the License is distributed on an "AS IS" BASIS, -; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -; See the License for the specific language governing permissions and -; limitations under the License. - -!include StrFunc.nsh -!include WinVer.nsh -!include x64.nsh - -!include env.nsh - -; StrFunc weirdness; this fix suggested here: -; https://github.com/electron-userland/electron-builder/issues/888 -!ifndef BUILD_UNINSTALLER -${StrLoc} -${StrNSISToIO} -${StrRep} -!endif - -!macro customInstall - ; Normally, because we mark the installer binary as requiring administrator permissions, the - ; installer will be running with administrator permissions at this point. The exception is when - ; the system is running with the *lowest* (least safe) UAC setting in which case the installer - ; can progress to this point without administrator permissions. - ; - ; If that's the case, exit now so we don't waste time to trying to install the TAP device, etc. - ; Additionally, the client can detect their absence and prompt the user to reinstall. - ; - ; The returned value does *not* seem to be based on the user's current diaplay language. - UserInfo::GetAccountType - Pop $0 - StrCmp $0 "Admin" isadmin - MessageBox MB_OK "Sorry, Outline requires administrator permissions." - Quit - - isadmin: - - ; TAP device files. - SetOutPath "$INSTDIR\tap-windows6" - ${If} ${RunningX64} - File /r "${PROJECT_DIR}\third_party\tap-windows6\bin\amd64\*" - ${Else} - File /r "${PROJECT_DIR}\third_party\tap-windows6\bin\i386\*" - ${EndIf} - SetOutPath - - File "${PROJECT_DIR}\src\electron\add_tap_device.bat" - File "${PROJECT_DIR}\src\electron\find_tap_device_name.bat" - - ; OutlineService files, stopping the service first in case it's still running. - nsExec::Exec "$SYSDIR\net stop OutlineService" - File "${PROJECT_DIR}\tools\OutlineService\OutlineService\bin\OutlineService.exe" - File "${PROJECT_DIR}\tools\smartdnsblock\bin\smartdnsblock.exe" - File "${PROJECT_DIR}\third_party\newtonsoft\Newtonsoft.Json.dll" - File "${PROJECT_DIR}\src\electron\install_windows_service.bat" - - ; ExecToStack captures both stdout and stderr from the script, in the order output. - ; Set a (long) timeout in case the device never becomes visible to netsh. - ReadEnvStr $0 COMSPEC - nsExec::ExecToStack /timeout=180000 '$0 /c add_tap_device.bat' - - Pop $0 - Pop $1 - StrCmp $0 0 installservice - - ; The TAP device may have failed to install because the user did not want to - ; install the device driver. If so: - ; - tell the user that they need to install the driver - ; - skip the Sentry report - ; - quit - ; - ; When this happens, tapinstall.exe prints an error message like this: - ; UpdateDriverForPlugAndPlayDevices failed, GetLastError=-536870333 - ; - ; We can use the presence of that magic number to detect this case. - Var /GLOBAL DRIVER_FAILURE_MAGIC_NUMBER_INDEX - ${StrLoc} $DRIVER_FAILURE_MAGIC_NUMBER_INDEX $1 "536870333" ">" - - StrCmp $DRIVER_FAILURE_MAGIC_NUMBER_INDEX "" submitsentryreport - ; The term "device software" is the same as that used by the prompt, at least on Windows 7. - MessageBox MB_OK "Sorry, you must install the device software in order to use Outline. Please try \ - running the installer again." - Quit - - submitsentryreport: - MessageBox MB_OK "Sorry, we could not configure your system to connect to Outline. Please try \ - running the installer again. If you still cannot install Outline, please get in \ - touch with us and let us know that the TAP device failed to install with error code $0." - - ; Submit a Sentry error event. - ; - ; This will get bundled into an issue named "could not install TAP device" with the following - ; attributes: - ; - a single breadcrumb containing the output of add_tap_device.bat - ; - Windows version, as a tag named "os" with a value identical in most cases to what the - ; JavaScript Sentry client produces, e.g. "Windows 10.0.17134" - ; - client version - ; - ; Note: - ; - Sentry won't accept a breadcrumbs without a timestamp; fortunately, it accepts obviously - ; bogus values so we don't have to fetch the real time. - ; - Because nsExec::ExecToStack yields "NSIS strings" strings suitable for inclusion in, for - ; example, a MessageBox, e.g. "device not found$\ncommand failed", we must convert it to a - ; string that Sentry will like *and* can fit on one line, e.g. - ; "device not found\ncommand failed"; fortunately, StrFunc.nsh's StrNSISToIO does precisely - ; this. - ; - RELEASE and SENTRY_URL are defined in env.nsh which is generated at build time by - ; {package,release}_action.sh. - - ; TODO: Remove this once we figure out why/if breadcrumbs are being truncated. - Var /GLOBAL FAILURE_MESSAGE_LENGTH - StrLen $FAILURE_MESSAGE_LENGTH $1 - - ; http://nsis.sourceforge.net/Docs/StrFunc/StrFunc.txt - Var /GLOBAL FAILURE_MESSAGE - ${StrNSISToIO} $FAILURE_MESSAGE $1 - ${StrRep} $FAILURE_MESSAGE $FAILURE_MESSAGE '"' '\"' - - ${WinVerGetMajor} $R0 - ${WinVerGetMinor} $R1 - ${WinVerGetBuild} $R2 - - ; http://nsis.sourceforge.net/Inetc_plug-in#post - inetc::post '{\ - "message":"could not install TAP device ($0)",\ - "release":"${RELEASE}",\ - "tags":[\ - ["os", "Windows $R0.$R1.$R2"],\ - ["error_message_length", "$FAILURE_MESSAGE_LENGTH"]\ - ],\ - "breadcrumbs":[\ - {"timestamp":1, "message":"$FAILURE_MESSAGE"}\ - ]\ - }' /TOSTACK ${SENTRY_URL} /END - - Quit - - installservice: - - nsExec::Exec install_windows_service.bat - - nsExec::Exec "$SYSDIR\sc query OutlineService" - Pop $0 - StrCmp $0 0 success - ; TODO: Trigger a Sentry report for service installation failure, too, and revisit - ; the restart stuff in the TypeScript code. - MessageBox MB_OK "Sorry, we could not configure your system to connect to Outline. Please try \ - running the installer again. If you still cannot install Outline, please get in touch with us \ - and let us know that OutlineService failed to install." - Quit - - success: - -!macroend - -; TODO: Remove the TAP device on uninstall. This is impossible to implement safely -; with the bundled tapinstall.exe because it can only remove *all* devices -; having hwid tap0901 and these may include non-Outline devices. -!macro customUnInstall - nsExec::Exec "$SYSDIR\net stop OutlineService" - nsExec::Exec "$SYSDIR\sc delete OutlineService" -!macroend +; Copyright 2018 The Outline Authors +; +; Licensed under the Apache License, Version 2.0 (the "License"); +; you may not use this file except in compliance with the License. +; You may obtain a copy of the License at +; +; http://www.apache.org/licenses/LICENSE-2.0 +; +; Unless required by applicable law or agreed to in writing, software +; distributed under the License is distributed on an "AS IS" BASIS, +; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +; See the License for the specific language governing permissions and +; limitations under the License. + +!include StrFunc.nsh +!include WinVer.nsh +!include x64.nsh + +!include env.nsh + +; StrFunc weirdness; this fix suggested here: +; https://github.com/electron-userland/electron-builder/issues/888 +!ifndef BUILD_UNINSTALLER +${StrLoc} +${StrNSISToIO} +${StrRep} +!endif + +!macro customInstall + ; Normally, because we mark the installer binary as requiring administrator permissions, the + ; installer will be running with administrator permissions at this point. The exception is when + ; the system is running with the *lowest* (least safe) UAC setting in which case the installer + ; can progress to this point without administrator permissions. + ; + ; If that's the case, exit now so we don't waste time to trying to install the TAP device, etc. + ; Additionally, the client can detect their absence and prompt the user to reinstall. + ; + ; The returned value does *not* seem to be based on the user's current diaplay language. + UserInfo::GetAccountType + Pop $0 + StrCmp $0 "Admin" isadmin + MessageBox MB_OK "Sorry, Outline requires administrator permissions." + Quit + + isadmin: + + ; TAP device files. + SetOutPath "$INSTDIR\tap-windows6" + ${If} ${RunningX64} + File /r "${PROJECT_DIR}\third_party\tap-windows6\bin\amd64\*" + ${Else} + File /r "${PROJECT_DIR}\third_party\tap-windows6\bin\i386\*" + ${EndIf} + SetOutPath - + File "${PROJECT_DIR}\src\electron\add_tap_device.bat" + File "${PROJECT_DIR}\src\electron\find_tap_device_name.bat" + + ; OutlineService files, stopping the service first in case it's still running. + nsExec::Exec "$SYSDIR\net stop OutlineService" + File "${PROJECT_DIR}\tools\OutlineService\OutlineService\bin\OutlineService.exe" + File "${PROJECT_DIR}\tools\smartdnsblock\bin\smartdnsblock.exe" + File "${PROJECT_DIR}\third_party\newtonsoft\Newtonsoft.Json.dll" + File "${PROJECT_DIR}\src\electron\install_windows_service.bat" + + ; ExecToStack captures both stdout and stderr from the script, in the order output. + ; Set a (long) timeout in case the device never becomes visible to netsh. + ReadEnvStr $0 COMSPEC + nsExec::ExecToStack /timeout=180000 '$0 /c add_tap_device.bat' + + Pop $0 + Pop $1 + StrCmp $0 0 installservice + + ; The TAP device may have failed to install because the user did not want to + ; install the device driver. If so: + ; - tell the user that they need to install the driver + ; - skip the Sentry report + ; - quit + ; + ; When this happens, tapinstall.exe prints an error message like this: + ; UpdateDriverForPlugAndPlayDevices failed, GetLastError=-536870333 + ; + ; We can use the presence of that magic number to detect this case. + Var /GLOBAL DRIVER_FAILURE_MAGIC_NUMBER_INDEX + ${StrLoc} $DRIVER_FAILURE_MAGIC_NUMBER_INDEX $1 "536870333" ">" + + StrCmp $DRIVER_FAILURE_MAGIC_NUMBER_INDEX "" submitsentryreport + ; The term "device software" is the same as that used by the prompt, at least on Windows 7. + MessageBox MB_OK "Sorry, you must install the device software in order to use Outline. Please try \ + running the installer again." + Quit + + submitsentryreport: + MessageBox MB_OK "Sorry, we could not configure your system to connect to Outline. Please try \ + running the installer again. If you still cannot install Outline, please get in \ + touch with us and let us know that the TAP device failed to install with error code $0." + + ; Submit a Sentry error event. + ; + ; This will get bundled into an issue named "could not install TAP device" with the following + ; attributes: + ; - a single breadcrumb containing the output of add_tap_device.bat + ; - Windows version, as a tag named "os" with a value identical in most cases to what the + ; JavaScript Sentry client produces, e.g. "Windows 10.0.17134" + ; - client version + ; + ; Note: + ; - Sentry won't accept a breadcrumbs without a timestamp; fortunately, it accepts obviously + ; bogus values so we don't have to fetch the real time. + ; - Because nsExec::ExecToStack yields "NSIS strings" strings suitable for inclusion in, for + ; example, a MessageBox, e.g. "device not found$\ncommand failed", we must convert it to a + ; string that Sentry will like *and* can fit on one line, e.g. + ; "device not found\ncommand failed"; fortunately, StrFunc.nsh's StrNSISToIO does precisely + ; this. + ; - RELEASE and SENTRY_URL are defined in env.nsh which is generated at build time by + ; {package,release}_action.sh. + + ; TODO: Remove this once we figure out why/if breadcrumbs are being truncated. + Var /GLOBAL FAILURE_MESSAGE_LENGTH + StrLen $FAILURE_MESSAGE_LENGTH $1 + + ; http://nsis.sourceforge.net/Docs/StrFunc/StrFunc.txt + Var /GLOBAL FAILURE_MESSAGE + ${StrNSISToIO} $FAILURE_MESSAGE $1 + ${StrRep} $FAILURE_MESSAGE $FAILURE_MESSAGE '"' '\"' + + ${WinVerGetMajor} $R0 + ${WinVerGetMinor} $R1 + ${WinVerGetBuild} $R2 + + ; http://nsis.sourceforge.net/Inetc_plug-in#post + inetc::post '{\ + "message":"could not install TAP device ($0)",\ + "release":"${RELEASE}",\ + "tags":[\ + ["os", "Windows $R0.$R1.$R2"],\ + ["error_message_length", "$FAILURE_MESSAGE_LENGTH"]\ + ],\ + "breadcrumbs":[\ + {"timestamp":1, "message":"$FAILURE_MESSAGE"}\ + ]\ + }' /TOSTACK ${SENTRY_URL} /END + + Quit + + installservice: + + nsExec::Exec install_windows_service.bat + + nsExec::Exec "$SYSDIR\sc query OutlineService" + Pop $0 + StrCmp $0 0 success + ; TODO: Trigger a Sentry report for service installation failure, too, and revisit + ; the restart stuff in the TypeScript code. + MessageBox MB_OK "Sorry, we could not configure your system to connect to Outline. Please try \ + running the installer again. If you still cannot install Outline, please get in touch with us \ + and let us know that OutlineService failed to install." + Quit + + success: + +!macroend + +; TODO: Remove the TAP device on uninstall. This is impossible to implement safely +; with the bundled tapinstall.exe because it can only remove *all* devices +; having hwid tap0901 and these may include non-Outline devices. +!macro customUnInstall + nsExec::Exec "$SYSDIR\net stop OutlineService" + nsExec::Exec "$SYSDIR\sc delete OutlineService" +!macroend diff --git a/src/electron/electron-builder.json b/src/electron/electron-builder.json index 7993f6c215..a547380483 100644 --- a/src/electron/electron-builder.json +++ b/src/electron/electron-builder.json @@ -1,6 +1,6 @@ { "files": ["build/electron", "client/www", "client/resources/tray", "!node_modules/electron"], - "asarUnpack": ["output", "tools"], + "asarUnpack": ["client"], "artifactName": "Outline-Client.${ext}", "directories": { "output": "output/build/dist" @@ -10,7 +10,7 @@ "target": "AppImage", "arch": ["x64"] }, - "files": ["build/icons/png", "output/build/linux", "tools/outline_proxy_controller/dist"], + "files": ["build/icons/png", "client/output/build/linux", "client/tools/outline_proxy_controller/dist"], "icon": "build/icons/png", "category": "Network" }, @@ -21,7 +21,7 @@ "arch": "ia32" } ], - "files": ["output/build/windows"], + "files": ["client/output/build/windows"], "icon": "build/icons/win/icon.ico", "sign": "src/electron/windows/electron_builder_signing_plugin.cjs", "signingHashAlgorithms": ["sha256"] diff --git a/src/electron/go_vpn_tunnel.ts b/src/electron/go_vpn_tunnel.ts index 0ea6ace070..1b9171eac9 100755 --- a/src/electron/go_vpn_tunnel.ts +++ b/src/electron/go_vpn_tunnel.ts @@ -19,7 +19,7 @@ import {powerMonitor} from 'electron'; import {ChildProcessHelper, ProcessTerminatedExitCodeError, ProcessTerminatedSignalError} from './process'; import {RoutingDaemon} from './routing_service'; import {VpnTunnel} from './vpn_tunnel'; -import {pathToEmbeddedBinary} from '../../client/infrastructure/electron/app_paths'; +import {pathToEmbeddedTun2socksBinary} from '../../client/infrastructure/electron/app_paths'; import {ShadowsocksSessionConfig} from '../../client/src/www/app/tunnel'; import {TunnelStatus} from '../../client/src/www/app/tunnel'; import {ErrorCode, fromErrorCode, UnexpectedPluginError} from '../../client/src/www/model/errors'; @@ -222,7 +222,7 @@ class GoTun2socks { private readonly process: ChildProcessHelper; constructor(private readonly config: ShadowsocksSessionConfig) { - this.process = new ChildProcessHelper(pathToEmbeddedBinary('tun2socks')); + this.process = new ChildProcessHelper(pathToEmbeddedTun2socksBinary()); } async start(isUdpEnabled: boolean): Promise { @@ -259,7 +259,7 @@ class GoTun2socks { if (data?.toString().includes('tun2socks running')) { console.debug('tun2socks started'); autoRestart = true; - this.process.onStdErr = null; + this.process.onStdErr = undefined; } }; try { diff --git a/src/electron/routing_service.ts b/src/electron/routing_service.ts index aa118818b1..ed1718f102 100755 --- a/src/electron/routing_service.ts +++ b/src/electron/routing_service.ts @@ -20,7 +20,7 @@ import * as path from 'path'; import * as fsextra from 'fs-extra'; import * as sudo from 'sudo-prompt'; -import {getAppPath} from '../../client/infrastructure/electron/app_paths'; +import {pathToEmbeddedOutlineService} from '../../client/infrastructure/electron/app_paths'; import {TunnelStatus} from '../../client/src/www/app/tunnel'; import {ErrorCode, SystemConfigurationException} from '../../client/src/www/model/errors'; @@ -67,7 +67,7 @@ enum RoutingServiceStatusCode { // - Linux: systemctl start|stop outline_proxy_controller.service // - Windows: net start|stop OutlineService export class RoutingDaemon { - private socket: Socket | undefined; + private socket: Socket | null | undefined; private stopping = false; @@ -182,7 +182,7 @@ export class RoutingDaemon { private async writeReset() { return new Promise((resolve, reject) => { - const written = this.socket.write( + const written = this.socket?.write( JSON.stringify({action: RoutingServiceAction.RESET_ROUTING, parameters: {}} as RoutingServiceRequest), err => { if (err) { @@ -262,12 +262,11 @@ function installWindowsRoutingServices(): Promise { // build/windows // // Surrounding quotes important, consider "c:\program files"! - const script = `"${path.join(getAppPath(), WINDOWS_INSTALLER_FILENAME)}"`; + const script = `"${path.join(pathToEmbeddedOutlineService(), WINDOWS_INSTALLER_FILENAME)}"`; return executeCommandAsRoot(script); } async function installLinuxRoutingServices(): Promise { - const OUTLINE_PROXY_CONTROLLER_PATH = path.join('tools', 'outline_proxy_controller', 'dist'); const LINUX_INSTALLER_FILENAME = 'install_linux_service.sh'; const installationFileDescriptors: Array<{filename: string; executable: boolean; sha256: string}> = [ {filename: LINUX_INSTALLER_FILENAME, executable: true, sha256: ''}, @@ -276,7 +275,7 @@ async function installLinuxRoutingServices(): Promise { ]; // These Linux service files are located in a mounted folder of the AppImage, typically - // located at /tmp/.mount_Outlinxxxxxx/resources/. These files can only be acceeded by + // located at /tmp/.mount_Outlinxxxxxx/resources/. These files can only be accessed by // the user who launched Outline.AppImage, so even root cannot access the files or folders. // Therefore we have to copy these files to a normal temporary folder, and execute them // as root. @@ -290,7 +289,7 @@ async function installLinuxRoutingServices(): Promise { // - https://github.com/AppImage/AppImageKit/issues/146 // - https://xwartz.gitbooks.io/electron-gitbook/content/en/tutorial/application-packaging.html const tmp = await fsextra.mkdtemp('/tmp/'); - const srcFolderPath = path.join(getAppPath(), OUTLINE_PROXY_CONTROLLER_PATH); + const srcFolderPath = pathToEmbeddedOutlineService(); console.log(`copying service installation files to ${tmp}`); for (const descriptor of installationFileDescriptors) { diff --git a/third_party/tap-windows6/bin/amd64/OemVista.inf b/third_party/tap-windows6/bin/amd64/OemVista.inf index d92e2558b3..628a2158be 100644 --- a/third_party/tap-windows6/bin/amd64/OemVista.inf +++ b/third_party/tap-windows6/bin/amd64/OemVista.inf @@ -1,191 +1,191 @@ -; **************************************************************************** -; * Copyright (C) 2002-2014 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\oemvista.inf -; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm - -; INSTALL/REMOVE DRIVER -; tapinstall install OemVista.inf tapoas -; tapinstall update OemVista.inf tapoas -; tapinstall remove tapoas - -;********************************************************* -; 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 = tap0901.cat - ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} - Provider = %Provider% - Class = Net - -; This version number should match the version -; number given in SOURCES. - DriverVer=04/21/2016,9.00.00.21 - -[Strings] - DeviceDescription = "TAP-Windows Adapter V9" - Provider = "TAP-Windows Provider V9" - -;---------------------------------------------------------------- -; Manufacturer + Product Section (Done) -;---------------------------------------------------------------- -[Manufacturer] - %Provider% = tap0901, NTamd64 - -[tap0901.NTamd64] - %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated - %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy - -;--------------------------------------------------------------- -; 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 ------------ - -[tap0901.ndi] - CopyFiles = tap0901.driver, tap0901.files - AddReg = tap0901.reg - AddReg = tap0901.params.reg - Characteristics = - *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD - *MediaType = 0x0 ; NdisMedium802_3 - *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 - -[tap0901.ndi.Services] - AddService = tap0901, 2, tap0901.service - -[tap0901.reg] - HKR, Ndi, Service, 0, "tap0901" - HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" - HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" - HKR, , Manufacturer, 0, "%Provider%" - HKR, , ProductName, 0, "%DeviceDescription%" - -[tap0901.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 --------------- - -[tap0901.service] - DisplayName = %DeviceDescription% - ServiceType = 1 - StartType = 3 - ErrorControl = 1 - LoadOrderGroup = NDIS - ServiceBinary = %12%\tap0901.sys - -;----------------------------------------------------------------- -; File Installation -;----------------------------------------------------------------- - -;----------------- Copy Flags ------------ -; COPYFLG_NOSKIP = 0x02 -; COPYFLG_NOVERSIONCHECK = 0x04 -;----------------- Copy Flags ------------ - -; SourceDisksNames -; diskid = description[, [tagfile] [, , subdir]] -; 1 = "Intel Driver Disk 1",e100bex.sys,, - -[SourceDisksNames] - 1 = %DeviceDescription%, tap0901.sys - -; SourceDisksFiles -; filename_on_source = diskID[, [subdir][, size]] -; e100bex.sys = 1,, ; on distribution disk 1 - -[SourceDisksFiles] -tap0901.sys = 1 - -[DestinationDirs] - tap0901.files = 11 - tap0901.driver = 12 - -[tap0901.files] -; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK -; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK - -[tap0901.driver] - tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK - -;--------------------------------------------------------------- -; End -;--------------------------------------------------------------- +; **************************************************************************** +; * Copyright (C) 2002-2014 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\oemvista.inf +; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm + +; INSTALL/REMOVE DRIVER +; tapinstall install OemVista.inf tapoas +; tapinstall update OemVista.inf tapoas +; tapinstall remove tapoas + +;********************************************************* +; 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 = tap0901.cat + ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} + Provider = %Provider% + Class = Net + +; This version number should match the version +; number given in SOURCES. + DriverVer=04/21/2016,9.00.00.21 + +[Strings] + DeviceDescription = "TAP-Windows Adapter V9" + Provider = "TAP-Windows Provider V9" + +;---------------------------------------------------------------- +; Manufacturer + Product Section (Done) +;---------------------------------------------------------------- +[Manufacturer] + %Provider% = tap0901, NTamd64 + +[tap0901.NTamd64] + %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated + %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy + +;--------------------------------------------------------------- +; 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 ------------ + +[tap0901.ndi] + CopyFiles = tap0901.driver, tap0901.files + AddReg = tap0901.reg + AddReg = tap0901.params.reg + Characteristics = + *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD + *MediaType = 0x0 ; NdisMedium802_3 + *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 + +[tap0901.ndi.Services] + AddService = tap0901, 2, tap0901.service + +[tap0901.reg] + HKR, Ndi, Service, 0, "tap0901" + HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" + HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" + HKR, , Manufacturer, 0, "%Provider%" + HKR, , ProductName, 0, "%DeviceDescription%" + +[tap0901.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 --------------- + +[tap0901.service] + DisplayName = %DeviceDescription% + ServiceType = 1 + StartType = 3 + ErrorControl = 1 + LoadOrderGroup = NDIS + ServiceBinary = %12%\tap0901.sys + +;----------------------------------------------------------------- +; File Installation +;----------------------------------------------------------------- + +;----------------- Copy Flags ------------ +; COPYFLG_NOSKIP = 0x02 +; COPYFLG_NOVERSIONCHECK = 0x04 +;----------------- Copy Flags ------------ + +; SourceDisksNames +; diskid = description[, [tagfile] [, , subdir]] +; 1 = "Intel Driver Disk 1",e100bex.sys,, + +[SourceDisksNames] + 1 = %DeviceDescription%, tap0901.sys + +; SourceDisksFiles +; filename_on_source = diskID[, [subdir][, size]] +; e100bex.sys = 1,, ; on distribution disk 1 + +[SourceDisksFiles] +tap0901.sys = 1 + +[DestinationDirs] + tap0901.files = 11 + tap0901.driver = 12 + +[tap0901.files] +; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK +; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK + +[tap0901.driver] + tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK + +;--------------------------------------------------------------- +; End +;--------------------------------------------------------------- diff --git a/third_party/tap-windows6/bin/i386/OemVista.inf b/third_party/tap-windows6/bin/i386/OemVista.inf index 6cd6791311..f71c2d3e94 100644 --- a/third_party/tap-windows6/bin/i386/OemVista.inf +++ b/third_party/tap-windows6/bin/i386/OemVista.inf @@ -1,191 +1,191 @@ -; **************************************************************************** -; * Copyright (C) 2002-2014 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\oemvista.inf -; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm - -; INSTALL/REMOVE DRIVER -; tapinstall install OemVista.inf tapoas -; tapinstall update OemVista.inf tapoas -; tapinstall remove tapoas - -;********************************************************* -; 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 = tap0901.cat - ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} - Provider = %Provider% - Class = Net - -; This version number should match the version -; number given in SOURCES. - DriverVer=04/21/2016,9.00.00.21 - -[Strings] - DeviceDescription = "TAP-Windows Adapter V9" - Provider = "TAP-Windows Provider V9" - -;---------------------------------------------------------------- -; Manufacturer + Product Section (Done) -;---------------------------------------------------------------- -[Manufacturer] - %Provider% = tap0901 - -[tap0901] - %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated - %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy - -;--------------------------------------------------------------- -; 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 ------------ - -[tap0901.ndi] - CopyFiles = tap0901.driver, tap0901.files - AddReg = tap0901.reg - AddReg = tap0901.params.reg - Characteristics = - *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD - *MediaType = 0x0 ; NdisMedium802_3 - *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 - -[tap0901.ndi.Services] - AddService = tap0901, 2, tap0901.service - -[tap0901.reg] - HKR, Ndi, Service, 0, "tap0901" - HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" - HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" - HKR, , Manufacturer, 0, "%Provider%" - HKR, , ProductName, 0, "%DeviceDescription%" - -[tap0901.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 --------------- - -[tap0901.service] - DisplayName = %DeviceDescription% - ServiceType = 1 - StartType = 3 - ErrorControl = 1 - LoadOrderGroup = NDIS - ServiceBinary = %12%\tap0901.sys - -;----------------------------------------------------------------- -; File Installation -;----------------------------------------------------------------- - -;----------------- Copy Flags ------------ -; COPYFLG_NOSKIP = 0x02 -; COPYFLG_NOVERSIONCHECK = 0x04 -;----------------- Copy Flags ------------ - -; SourceDisksNames -; diskid = description[, [tagfile] [, , subdir]] -; 1 = "Intel Driver Disk 1",e100bex.sys,, - -[SourceDisksNames] - 1 = %DeviceDescription%, tap0901.sys - -; SourceDisksFiles -; filename_on_source = diskID[, [subdir][, size]] -; e100bex.sys = 1,, ; on distribution disk 1 - -[SourceDisksFiles] -tap0901.sys = 1 - -[DestinationDirs] - tap0901.files = 11 - tap0901.driver = 12 - -[tap0901.files] -; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK -; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK - -[tap0901.driver] - tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK - -;--------------------------------------------------------------- -; End -;--------------------------------------------------------------- +; **************************************************************************** +; * Copyright (C) 2002-2014 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\oemvista.inf +; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm + +; INSTALL/REMOVE DRIVER +; tapinstall install OemVista.inf tapoas +; tapinstall update OemVista.inf tapoas +; tapinstall remove tapoas + +;********************************************************* +; 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 = tap0901.cat + ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} + Provider = %Provider% + Class = Net + +; This version number should match the version +; number given in SOURCES. + DriverVer=04/21/2016,9.00.00.21 + +[Strings] + DeviceDescription = "TAP-Windows Adapter V9" + Provider = "TAP-Windows Provider V9" + +;---------------------------------------------------------------- +; Manufacturer + Product Section (Done) +;---------------------------------------------------------------- +[Manufacturer] + %Provider% = tap0901 + +[tap0901] + %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated + %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy + +;--------------------------------------------------------------- +; 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 ------------ + +[tap0901.ndi] + CopyFiles = tap0901.driver, tap0901.files + AddReg = tap0901.reg + AddReg = tap0901.params.reg + Characteristics = + *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD + *MediaType = 0x0 ; NdisMedium802_3 + *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 + +[tap0901.ndi.Services] + AddService = tap0901, 2, tap0901.service + +[tap0901.reg] + HKR, Ndi, Service, 0, "tap0901" + HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" + HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" + HKR, , Manufacturer, 0, "%Provider%" + HKR, , ProductName, 0, "%DeviceDescription%" + +[tap0901.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 --------------- + +[tap0901.service] + DisplayName = %DeviceDescription% + ServiceType = 1 + StartType = 3 + ErrorControl = 1 + LoadOrderGroup = NDIS + ServiceBinary = %12%\tap0901.sys + +;----------------------------------------------------------------- +; File Installation +;----------------------------------------------------------------- + +;----------------- Copy Flags ------------ +; COPYFLG_NOSKIP = 0x02 +; COPYFLG_NOVERSIONCHECK = 0x04 +;----------------- Copy Flags ------------ + +; SourceDisksNames +; diskid = description[, [tagfile] [, , subdir]] +; 1 = "Intel Driver Disk 1",e100bex.sys,, + +[SourceDisksNames] + 1 = %DeviceDescription%, tap0901.sys + +; SourceDisksFiles +; filename_on_source = diskID[, [subdir][, size]] +; e100bex.sys = 1,, ; on distribution disk 1 + +[SourceDisksFiles] +tap0901.sys = 1 + +[DestinationDirs] + tap0901.files = 11 + tap0901.driver = 12 + +[tap0901.files] +; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK +; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK + +[tap0901.driver] + tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK + +;--------------------------------------------------------------- +; End +;--------------------------------------------------------------- diff --git a/third_party/tap-windows6/bin/include/tap-windows.h b/third_party/tap-windows6/bin/include/tap-windows.h index d546a5b1cb..25bdd82b41 100644 --- a/third_party/tap-windows6/bin/include/tap-windows.h +++ b/third_party/tap-windows6/bin/include/tap-windows.h @@ -1,74 +1,74 @@ -/* - * TAP-Windows -- A kernel driver to provide virtual tap - * device functionality on Windows. - * - * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson. - * - * This source code is Copyright (C) 2002-2014 OpenVPN Technologies, Inc., - * and is released under the GPL version 2 (see below). - * - * 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 - * along with this program (see the file COPYING included with this - * distribution); if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __TAP_WIN_H -#define __TAP_WIN_H - -/* - * ============= - * TAP IOCTLs - * ============= - */ - -#define TAP_WIN_CONTROL_CODE(request,method) \ - CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) - -/* Present in 8.1 */ - -#define TAP_WIN_IOCTL_GET_MAC TAP_WIN_CONTROL_CODE (1, METHOD_BUFFERED) -#define TAP_WIN_IOCTL_GET_VERSION TAP_WIN_CONTROL_CODE (2, METHOD_BUFFERED) -#define TAP_WIN_IOCTL_GET_MTU TAP_WIN_CONTROL_CODE (3, METHOD_BUFFERED) -#define TAP_WIN_IOCTL_GET_INFO TAP_WIN_CONTROL_CODE (4, METHOD_BUFFERED) -#define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE (5, METHOD_BUFFERED) -#define TAP_WIN_IOCTL_SET_MEDIA_STATUS TAP_WIN_CONTROL_CODE (6, METHOD_BUFFERED) -#define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ TAP_WIN_CONTROL_CODE (7, METHOD_BUFFERED) -#define TAP_WIN_IOCTL_GET_LOG_LINE TAP_WIN_CONTROL_CODE (8, METHOD_BUFFERED) -#define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT TAP_WIN_CONTROL_CODE (9, METHOD_BUFFERED) - -/* Added in 8.2 */ - -/* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */ -#define TAP_WIN_IOCTL_CONFIG_TUN TAP_WIN_CONTROL_CODE (10, METHOD_BUFFERED) - -/* - * ================= - * Registry keys - * ================= - */ - -#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}" - -#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}" - -/* - * ====================== - * Filesystem prefixes - * ====================== - */ - -#define USERMODEDEVICEDIR "\\\\.\\Global\\" -#define SYSDEVICEDIR "\\Device\\" -#define USERDEVICEDIR "\\DosDevices\\Global\\" -#define TAP_WIN_SUFFIX ".tap" - -#endif // __TAP_WIN_H +/* + * TAP-Windows -- A kernel driver to provide virtual tap + * device functionality on Windows. + * + * This code was inspired by the CIPE-Win32 driver by Damion K. Wilson. + * + * This source code is Copyright (C) 2002-2014 OpenVPN Technologies, Inc., + * and is released under the GPL version 2 (see below). + * + * 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 + * along with this program (see the file COPYING included with this + * distribution); if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef __TAP_WIN_H +#define __TAP_WIN_H + +/* + * ============= + * TAP IOCTLs + * ============= + */ + +#define TAP_WIN_CONTROL_CODE(request,method) \ + CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS) + +/* Present in 8.1 */ + +#define TAP_WIN_IOCTL_GET_MAC TAP_WIN_CONTROL_CODE (1, METHOD_BUFFERED) +#define TAP_WIN_IOCTL_GET_VERSION TAP_WIN_CONTROL_CODE (2, METHOD_BUFFERED) +#define TAP_WIN_IOCTL_GET_MTU TAP_WIN_CONTROL_CODE (3, METHOD_BUFFERED) +#define TAP_WIN_IOCTL_GET_INFO TAP_WIN_CONTROL_CODE (4, METHOD_BUFFERED) +#define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE (5, METHOD_BUFFERED) +#define TAP_WIN_IOCTL_SET_MEDIA_STATUS TAP_WIN_CONTROL_CODE (6, METHOD_BUFFERED) +#define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ TAP_WIN_CONTROL_CODE (7, METHOD_BUFFERED) +#define TAP_WIN_IOCTL_GET_LOG_LINE TAP_WIN_CONTROL_CODE (8, METHOD_BUFFERED) +#define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT TAP_WIN_CONTROL_CODE (9, METHOD_BUFFERED) + +/* Added in 8.2 */ + +/* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */ +#define TAP_WIN_IOCTL_CONFIG_TUN TAP_WIN_CONTROL_CODE (10, METHOD_BUFFERED) + +/* + * ================= + * Registry keys + * ================= + */ + +#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}" + +#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}" + +/* + * ====================== + * Filesystem prefixes + * ====================== + */ + +#define USERMODEDEVICEDIR "\\\\.\\Global\\" +#define SYSDEVICEDIR "\\Device\\" +#define USERDEVICEDIR "\\DosDevices\\Global\\" +#define TAP_WIN_SUFFIX ".tap" + +#endif // __TAP_WIN_H