Skip to content

Commit

Permalink
Support wlan in network-interface-list on pre-Vista Windows
Browse files Browse the repository at this point in the history
* src/w32.c (network_interface_list): Check for 'Wireless' in
adapter description to support pre-Vista Windows.
  • Loading branch information
rpluim committed Nov 28, 2019
1 parent 25d4bf4 commit b05aa8d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/w32.c
Expand Up @@ -9540,8 +9540,23 @@ network_interface_list (bool full, unsigned short match)
switch (adapter->IfType)
{
case IF_TYPE_ETHERNET_CSMACD:
ifmt_idx = ETHERNET;
if_num = eth_count++;
/* Windows before Vista reports wireless adapters as
Ethernet. Work around by looking at the Description
string. */
{
char description[MAX_UTF8_PATH];
if (filename_from_utf16 (adapter->Description, description) == 0
&& strstr (description, "Wireless "))
{
ifmt_idx = WLAN;
if_num = wlan_count++;
}
else
{
ifmt_idx = ETHERNET;
if_num = eth_count++;
}
}
break;
case IF_TYPE_ISO88025_TOKENRING:
ifmt_idx = TOKENRING;
Expand Down

0 comments on commit b05aa8d

Please sign in to comment.