Opened 7 years ago

Closed 3 years ago

#780 closed Bug / Defect (worksforme)

tap-windows-9.21.2.exe driver issue in windows 10

Reported by: pendrive13gb Owned by:
Priority: major Milestone:
Component: tap-windows6 Version: OpenVPN 2.2.2 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:
Cc:

Description

Short story:

After installing tap-windows-9.21.2.exe my custom c program is able to connect and open tap interface but cannot read or write to the interface.

Long story:

I've created a c program that connects to TUN interface.

In windows 10, I installed tap-windows-9.21.2.exe that is for NDIS 6 drivers.

In my program I use thus code

handle = CreateFile(device_address,GENERIC_READ | GENERIC_WRITE,0x00000001|0x00000002,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_SYSTEM|FILE_FLAG_OVERLAPPED,NULL);

to open file handler.

device_address is something like

\\.\GLOBAL\{GUID}.tap

It successfully opens the handle.
then using this code

DeviceIoControl(handle,TAP_IOCTL_SET_MEDIA_STATUS,&value,sizeof(value),&value,sizeof(value),&len,&io_ovl1);

and

DeviceIoControl(tun->handle,TAP_IOCTL_CONFIG_TUN,value2,sizeof(value2),value2,sizeof(value2),&len,&io_ovl1);

I create an IOCP IO on the handler.

Everything seems working but the problem is that it is not able to read or write anything from/to tap device.

After I uninstalled the tap-windows-9.21.2.exe and installed the tap-windows-9.9.2_3.exe
everything worked! and I was able to read and write packets from/to tap device.

Considering this note from the download page

Tap-windows

OpenVPN uses TAP-windows to provide virtual tap device functionality on Windows. Normally you don't need to install TAP-windows separately, as OpenVPN installers include it. The tap-windows driver comes in two flavours: the NDIS 5 driver (tap-windows, version 9.9.x) for Windows XP and NDIS 6 (tap-windows6, version 9.21.x) for Windows and above. Source code for both tap-windows drivers is available on GitHub?.

Please correct me if I'm wrong but is not that the tap-windows-9.21.2.exe intended to NDIS version 6?

Thank you all

Change History (4)

comment:1 Changed 7 years ago by Samuli Seppänen

The naming of tap-windows drivers is slightly confusing:

Installer nameProject nameNDIS versionOperating system
tap-windows-9.21.2 tap-windows6 6Windows Vista and above
tap-windows-9.9.2_3 tap-windows 5Windows XP

Tap-windows (NDIS 5) will work on Windows XP -> 7, and possibly also on Windows 8.x. It probably does not work on Windows 10 anymore, as NDIS 5 support should have been ripped out a while back.

As for the problem using tap-windows6: I don't know what is happening. We don't really have any resident Windows driver developers in our project. The only person I know of who has integrated tap-windows6 into a non-OpenVPN project is Thermi on #openvpn-devel IRC channel.

comment:2 Changed 7 years ago by pendrive13gb

Thank you samuli

Well, uhh. Its a little bit confusing. Now I don't get why the 9.9.2_3 works on windows 10 while that should not be. But the 9.21.2 does not work while it should be.

It makes me wondering how to deal with windows 10 if I want to distribute the software.

Anyway thanks again. Maybe I do a little more digging onto the code or go find Thermi.

comment:3 Changed 7 years ago by Samuli Seppänen

Well, Microsoft has threatened to remove NDIS5 support from Windows 10. Apparently they still have not done it, but I'm pretty sure they will do it eventually. So I would not build anything on top of the old NDIS 5 driver.

I would have a look at OpenVPN code to see how OpenVPN communicates with the tap-windows6 driver, which is clearly working fine.

comment:4 Changed 3 years ago by Gert Döring

Resolution: worksforme
Status: newclosed

Since this is really outside OpenVPN, and we know that the tap6 driver works on Win10, I am closing the ticket.

Advice has been given, there is not much more we can do.

Note: See TracTickets for help on using tickets.