UI bugs hampering porting effort for shaped window
cto at xten.com
Fri Oct 31 11:39:04 CST 2003
>When I implemented the case that name == NULL ( another call for help, I
>wasn't aware of your bug report, sorry), the only reference I could find
>| If null is provided in the name parameter, the returned string is the
>| as the string returned by a successful gethostname function call.
I can't remember where I saw it (as I have been developing with winsock for
years), all I do know that it's well known among windows winsock developers.
In fact, since passing gethostname into gethostbyname is guarenteed to
return back local IPs in Windows, you can therefor logically deduce that
passing in NULL guarentees that local IPs are returned as well. In fact, I
would say you should be checking for NULL and return back local IPs AND you
should also do your own call to gethostname and if that equals the string
passed into gethostbyname, then you should return a list of local IPs as
well. On *nux, this behaviour is not guarenteed, like it is on Windows.
Our application relies on this behaviour to function under all OSes (98
through XP). If Microsoft were to change how this worked, it would break our
application and many others. Only on Windows CE do we have to pass the
results of gethostname() into the function to get correct results as WinCE
doesn't like NULL. WinCE has many conflicts with the Win32 API - so this
isn't surprising. We can pass in the results of gethostname into the
function and it will return local IPs as well - the trouble is that on Linux
gethostname passed into gethostbyname doesn't always work as it does in
windows (i.e. returning back local IPs). Certainly, documented or not, the
results from passing in NULL should be identical to the windows platform.
One more thing, 127.0.0.1 is filtered in the results when passing in NULL -
at least on Windows 2000. It's a safe bet to screen for it since any
developer would have to anticipate the loopback address missing from the
results even if other Win OSes included the loopback (which is doubtful they
return this result either).
From: Rein Klazes [mailto:rklazes at xs4all.nl]
Sent: October 31, 2003 3:01 AM
To: cto at xten.com
Cc: Mike Hearn; wine-devel at winehq.com
Subject: Re: UI bugs hampering porting effort for shaped window
On Thu, 30 Oct 2003 10:59:40 -0800, you wrote:
> Hi Mike,
> bug 1541 is still *not* fixed correctly. See when passing in NULL in
> to gethostbyname, it is guarenteed to return a list of local IP addresses
> mapped on the box. However, with WINE, passing NULL causes gethostname to
> passed into gethostbyname and does *not* always return back the list of
> local IP addresses on the box.
When I implemented the case that name == NULL ( another call for help, I
wasn't aware of your bug report, sorry), the only reference I could find
| If null is provided in the name parameter, the returned string is the same
| as the string returned by a successful gethostname function call.
Small detail: gethostbyname does not return a string, but this is what I
guessed the intention of the writer was.
Can you point to any documentation where this guarantee is specified?
rklazes at xs4all.nl
More information about the wine-devel