This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
SIOCGIFCONF
- To: cygwin-patches at cygwin dot com
- Subject: SIOCGIFCONF
- From: Alexander Gottwald <alexander dot gottwald at informatik dot tu-chemnitz dot de>
- Date: Wed, 10 Oct 2001 16:45:32 +0200 (CEST)
Hi,
after my copyright assignment form reached redhat, I again send the patch
for SIOCGIFCONF on Win95.
bye
ago
--
Alexander.Gottwald@informatik.tu-chemnitz.de
http://www.gotti.org ICQ: 126018723
phone: +49 3725 349 80 80 mobile: +49 172 7854017
--- net.cc.orig Wed Oct 10 16:06:35 2001
+++ net.cc Wed Oct 10 16:08:07 2001
@@ -1905,7 +1905,7 @@ get_95_ifconf (struct ifconf *ifc, int w
++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
@@ -1981,57 +1981,34 @@ get_95_ifconf (struct ifconf *ifc, int w
RegCloseKey (subkey);
- if (RegOpenKeyEx (ifkey, "Bindings",
- 0, KEY_READ, &subkey) != ERROR_SUCCESS)
- {
- RegCloseKey (ifkey);
- --ifr;
- continue;
- }
-
- 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;
+ strcpy (netname, "System\\CurrentControlSet\\Services\\Class\\Net\\");
+ strcat (netname, ifname);
+ 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;
Wed Oct 10 16:10:41 2001 Alexander Gottwald <ago@informatik.tu-chemnitz.de>
* net.cc (get_95_ifconf): Using other registry values to correct
networkdevice identification for Windows95.