Branch: Tag:

2001-03-18

2001-03-18 20:53:00 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Backported use of RegGetKeyNames() from Pike 7.2. Fixes [bug 761 (#761)].

Rev: lib/modules/Protocols.pmod/DNS.pmod:1.44

3:   //! module Protocols   //! submodule DNS   //! - //! $Id: DNS.pmod,v 1.43 2001/01/05 23:33:04 grubba Exp $ + //! $Id: DNS.pmod,v 1.44 2001/03/18 20:53:00 grubba Exp $      constant NOERROR=0;   constant FORMERR=1;
248: Inside #if defined(__NT__)
   res += ({ RegGetValue(HKEY_LOCAL_MACHINE, key, val) });    };    } +  + #if constant(RegGetKeyNames) +  /* Catch if RegGetKeyNames() doesn't find the directory. */ +  catch { +  foreach(RegGetKeyNames(HKEY_LOCAL_MACHINE, +  "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\" +  "Parameters\\Interfaces"), string key) +  { +  catch { +  res += ({ RegGetValue(HKEY_LOCAL_MACHINE, +  "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\" +  "Parameters\\Interfaces\\" + key, val) }); +  }; +  } +  }; + #endif    return sizeof(res) ? res : ({ fallbackvalue });    }   #endif