OpenVPN / tap-windows6

Windows TAP driver (NDIS 6)
Other
796 stars 237 forks source link

Unable to build custom driver #7

Open elise700 opened 9 years ago

elise700 commented 9 years ago

I have followed the directions to install a custom driver but it will not install.

At this point I would gladly contract out this work.

I am trying to build a custom tuntap driver. I followed the instructions and used buildtap.py to create a new 9.0.21 IPv6 supported driver. I then signed it. It was build on Windows 2012 and I am trying to install it on a different Windows 2012 server.

Trying to install, results in the below:

c:\tapinstall.exe install driver\OemVista.inf tavvetun

Device node created. Install is complete when drivers are installed... Updating drivers for tavvetun from C:\Users\gary\tuntap\driver\OemVista.inf. tapinstall.exe failed.

setupapi.dev look like the following:

[Device Install (UpdateDriverForPlugAndPlayDevices) - tavvetun] Section start 2015/04/19 17:32:34.968 cmd: bin\tapinstall.exe install driver\OemVista.inf tavvetun dvi: {Build Driver List} 17:32:34.968 dvi: Searching for hardware ID(s): dvi: tavvetun cpy: Policy is set to make all digital signatures equal. dvi: {Build Driver List - exit(0x00000000)} 17:32:34.968 dvi: {DIF_SELECTBESTCOMPATDRV} 17:32:34.968 dvi: Using exported function 'NetClassInstaller' in module 'C:\Windows\system32\NetCfgx.dll'. dvi: Class installer == NetCfgx.dll,NetClassInstaller dvi: Using exported function 'WlanDeviceClassCoInstaller' in module 'C:\Windows\system32\wlaninst.dll'. dvi: CoInstaller 1 == wlaninst.dll,WlanDeviceClassCoInstaller dvi: Using exported function 'WwanDeviceClassCoInstaller' in module 'C:\Windows\system32\wwaninst.dll'. dvi: CoInstaller 2 == wwaninst.dll,WwanDeviceClassCoInstaller dvi: CoInstaller 1: Enter 17:32:34.983 dvi: CoInstaller 1: Exit dvi: CoInstaller 2: Enter 17:32:34.983 dvi: CoInstaller 2: Exit dvi: Class installer: Enter 17:32:34.983 dvi: Class installer: Exit dvi: Default installer: Enter 17:32:34.983 dvi: {Select Best Driver} ! dvi: Selecting driver failed(0xe0000228) dvi: {Select Best Driver - exit(0xe0000228)} ! dvi: Default installer: failed! ! dvi: Error 0xe0000228: There are no compatible drivers for this device. dvi: {DIF_SELECTBESTCOMPATDRV - exit(0xe0000228)} 17:32:34.983 dvi: {DIF_DESTROYPRIVATEDATA} 17:32:34.983 dvi: CoInstaller 1: Enter 17:32:34.983 dvi: CoInstaller 1: Exit dvi: CoInstaller 2: Enter 17:32:34.983 dvi: CoInstaller 2: Exit dvi: Class installer: Enter 17:32:34.983 dvi: Class installer: Exit dvi: {DIF_DESTROYPRIVATEDATA - exit(0x00000000)} 17:32:34.983

mattock commented 7 years ago

Building kernel drivers with all the new driver signature requirements is an exercise in madness. I don't see any code signature issues in the above code, which is the usual culprit.

One question: did you change the PRODUCT_TAP_WIN_COMPONENT_ID value in version.m4? It should probably say

define([PRODUCT_TAP_WIN_COMPONENT_ID], [tavvetun])

Without that tapinstall.exe will fail.

elise700 commented 7 years ago

I solved the problem and the biggest issue turned out to be that when you uninstall a windows driver and then recreate the drive and re-install it, the original driver was installed not the new one. I had to manually follow some steps to remove the original driver from the windows system files. After that it all worked ok. I don't remember the exact steps as it was almot 2 years ago.

Thanks for your suggestion.

mattock commented 7 years ago

@elise700 : out of curiosity: what process did you use to remove the driver's system files?

elise700 commented 7 years ago

This link has the directions I used: https://technet.microsoft.com/en-us/library/cc730875.aspx

mattock commented 6 years ago

I actually implemented tap-windows removal tool in Powershell about a year ago, see https://github.com/mattock/tap-windows-scripts.