summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/net.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-10-10 19:28:19 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-10-10 19:28:19 +0000
commitf6a85cddc845c72ed31295c5edbcc4dcb82b8dab (patch)
tree4aba0217f95241d89a336871c7962aba9e715331 /winsup/cygwin/net.cc
parenta0d03b7eafa5d1c5a65ae23d57b5bae07922be89 (diff)
downloadcygnal-f6a85cddc845c72ed31295c5edbcc4dcb82b8dab.tar.gz
cygnal-f6a85cddc845c72ed31295c5edbcc4dcb82b8dab.tar.bz2
cygnal-f6a85cddc845c72ed31295c5edbcc4dcb82b8dab.zip
* net.cc (get_95_ifconf): Using other registry values pointing to
correct networkdevice identification for Windows95.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc75
1 files changed, 26 insertions, 49 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index c310c78b3..840ecc748 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -1921,7 +1921,7 @@ get_95_ifconf (struct ifconf *ifc, int what)
++i)
{
HKEY ifkey, subkey;
- char driver[256], classname[256], bindname[256], netname[256];
+ char driver[256], classname[256], netname[256];
char adapter[256], ip[256], np[256];
if (res != ERROR_SUCCESS
@@ -1997,57 +1997,34 @@ get_95_ifconf (struct ifconf *ifc, int what)
RegCloseKey (subkey);
- if (RegOpenKeyEx (ifkey, "Bindings",
- 0, KEY_READ, &subkey) != ERROR_SUCCESS)
- {
- RegCloseKey (ifkey);
- --ifr;
- continue;
- }
+ strcpy (netname, "System\\CurrentControlSet\\Services\\Class\\Net\\");
+ strcat (netname, ifname);
- for (int j = 0;
- (res = RegEnumValue (subkey, j, bindname,
- (size = sizeof bindname, &size),
- 0, NULL, NULL, NULL)) != ERROR_NO_MORE_ITEMS;
- ++j)
- if (!strncasecmp (bindname, "VREDIR\\", 7))
- break;
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, netname,
+ 0, KEY_READ, &subkey) != ERROR_SUCCESS)
+ {
+ RegCloseKey (ifkey);
+ --ifr;
+ continue;
+ }
+ if (RegQueryValueEx (subkey, "AdapterName", 0,
+ NULL, (unsigned char *) adapter,
+ (size = sizeof adapter, &size)) == ERROR_SUCCESS
+ && strcasematch (adapter, "MS$PPP"))
+ {
+ ++*ppp;
+ strcpy (ifr->ifr_name, "ppp");
+ strcat (ifr->ifr_name, ppp);
+ }
+ else
+ {
+ ++*eth;
+ strcpy (ifr->ifr_name, "eth");
+ strcat (ifr->ifr_name, eth);
+ }
+
RegCloseKey (subkey);
-
- if (res == ERROR_SUCCESS)
- {
- strcpy (netname, "System\\CurrentControlSet\\Services\\Class\\Net\\");
- strcat (netname, bindname + 7);
-
- if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, netname,
- 0, KEY_READ, &subkey) != ERROR_SUCCESS)
- {
- RegCloseKey (ifkey);
- --ifr;
- continue;
- }
-
- if (RegQueryValueEx (subkey, "AdapterName", 0,
- NULL, (unsigned char *) adapter,
- (size = sizeof adapter, &size)) == ERROR_SUCCESS
- && strcasematch (adapter, "MS$PPP"))
- {
- ++*ppp;
- strcpy (ifr->ifr_name, "ppp");
- strcat (ifr->ifr_name, ppp);
- }
- else
- {
- ++*eth;
- strcpy (ifr->ifr_name, "eth");
- strcat (ifr->ifr_name, eth);
- }
-
- RegCloseKey (subkey);
-
- }
-
RegCloseKey (ifkey);
++cnt;