views:

10557

answers:

2

Windows 7 has a (neat?) new feature called a 'virtual wireless adapter'. Read about it here:

http://www.istartedsomething.com/20090516/windows-7-native-virtual-wifi-technology-microsoft-research/

I have an application that directly controls the windows wifi interface card using the Native Wifi API ( http://msdn.microsoft.com/en-us/library/ms706556%28VS.85%29.aspx ). Please take as a given for this question that I need to directly control the wifi adapter using this documented api and can't just leave it up to OS and user.

The Windows 7 virtual adapter is supposed to be included with any approved Windows 7 wifi drivers. The drivers that out there now seem to be pretty buggy, and I've found that unless I manually disable the virtual wifi adapter the real adapter will not reliably connect to a wireless access point when commanded by the WLAN api.

My main question is 'How to I detect the presence of a windows virtual wifi adapter?'

Note that the documentation for WlanEnumInterfaces says:

This virtual device normally shows up in the “Network Connections Folder” as ‘Wireless Network Connection 2’ with a Device Name of ‘Microsoft Virtual WiFi Miniport adapter’ if the computer has a single wireless network adapter. This virtual device is used exclusively for performing software access point (SoftAP) connections and is not present in the list returned by the WlanEnumInterfaces function .

I suspect there is shell api that might provide the enumeration that the control panel uses to display the virtual adapter.

For extra credit, how can I disable this adapter programatically?

Thanks in advance.

+1  A: 

To detect the Windows 7 virtual adapter with the WLAN api you need to use the version defined by wlanapi.h in Windows SDK version 6.1.

You can enable or disable network adapters by using WMI or the INetConnection COM interface defined in netcon.h .

Jim In Texas
A: 

In the control panel > Network and Internet there's an option that says: "add a wireless device". I used that to detect the microsoft virtual wifi miniport adapter, cause after I installed Windows 7 it didn't appear in the network adapters but it was there and enabled, but not started. To disable it from a command prompt run as administrator you could try: netsh wlan set hostednetwork mode=disallow (or disallowed, I haven't tried). See http://msdn.microsoft.com/en-us/library/dd815243%28VS.85%29.aspx

Leviathan316