emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b05aa8d: Support wlan in network-interface-list on pre-Vista Wind


From: Robert Pluim
Subject: master b05aa8d: Support wlan in network-interface-list on pre-Vista Windows
Date: Thu, 28 Nov 2019 03:42:10 -0500 (EST)

branch: master
commit b05aa8d742d80aeb692c54289e8ccb074a68bf51
Author: Robert Pluim <address@hidden>
Commit: Robert Pluim <address@hidden>

    Support wlan in network-interface-list on pre-Vista Windows
    
    * src/w32.c (network_interface_list): Check for 'Wireless' in
    adapter description to support pre-Vista Windows.
---
 src/w32.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/w32.c b/src/w32.c
index a6ebe55..9f3c1b5 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]