All Forums
 Microsoft Windows CE
 General CE
 HOSTS file with Windows CE
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 29 Sep 2003 :  14:36:00  Show Profile  Email Poster
Q: Can I use a HOSTS file with my CE device?

Windows CE does not support HOSTS files but you can get the same functionality by using the device registry.

The host name can be configured through the HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts subkey. When an application calls gethostbyname or getaddrinfo, the registry is queried first, before a DNS or WINS request is sent. If the host name is found in the registry, the registry values are returned.

The following table shows the values for the HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\<Host Name> subkey.



Value : typeDescription
Aliases : REG_MULTI_SZThis value stores the aliases by which this host is known.
ExpireTime : REG_BINARYIf the current time, obtained by calling GetCurrentFT, exceeds the value in ExpireTime, the entire Host Name subkey is deleted the next time that gethostbyname is called. The length of this value is 8 bytes.
ipaddr : REG_BINARYThis value stores the IPv4 addresses associated with this host name. The length of this value is 4 bytes per address.
ipaddr6 : REG_BINARYThis value stores the IPv6 addresses associated with this host name. The length of this value is 20 bytes per address (16 bytes for address and 4 bytes for Scope ID).
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.01 seconds. Snitz Forums 2000