Transient registry entries?

Dan Kegel dank at kegel.com
Thu Mar 27 11:50:13 CST 2003


> My app reads the registry to figure out network information, in
> particular it queries the [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
> NT\CurrentVersion\NetworkCards\] key to discover network cards, then
> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services] to figure out the
> IP address of each one (this program can bind to multiple adaptors).
> ...
> a) In initial setup, ie when you install Wine
> b) At Wine startup
> c) On demand, ie by writing special cases into the registry access code.

Clearly c) because that will work properly even when doing
hotplugging of pcmcia cards and doing interactive dialup
to an isp.  Might want to cache it for 10 seconds or something,
and you might need to worry about what happens when programs
are reading the reg entries *while* an interface is changing. (heh.)

BTW there is a system call getifaddrs on many flavors of Unix that
does this kind of query, and there's a library implementation
of it for linux.  See
http://www.kegel.com/dkftpbench/dkftpbench-0.45/getifaddrs.c
http://www.kegel.com/dkftpbench/dkftpbench-0.45/getifaddrs.h
The registry code should probably just call this function.
- Dan
-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045




More information about the wine-devel mailing list