Fixes error connecting to servers in Life is Strange Remastered (due to timeout).
When there are multiple IP addresses for a host name Linux gethostbyname() returns those in random order upon each call (meaning to provide server load balancing). On Windows the order of IP addresses is not determined as well but it is the same on consequent calls (changes after network resets and probably DNS timeout expiration).
The game executes multiple http requests over TLS connection through its own libraries using only winsock from Wine. Upon executing each next request it calls gethostbyname() for the server DNS name and uses the first returned IP address. When that's different from the previous IP address used for established TLS connection it doesn't reuse the connection and establishes the connection from scratch which is very long process due to how the game does it (on Windows as well).
One obvious way to make gethostbyname() behave like Windows would be to cache the results we get from host. But caching gethostbyname() results is tricky, there are already host-side caches which take into account DNS timeouts and network interfaces change. It is possible in theory to cache the result and then still call native gethostbyname() and keep the order if nothing else has changed in the reply, but it seems to me that would complicate things more than this patch does. The patch sorts the output by IP address randomly hashed with a random transform hash established only once per process run. So it will still provide load balancing between the IP addresses between different clients and different process instances while will be returning the same order of IP addresses on consequent calls.
--
v3: ws2_32: Provide same address order from gethostbyname() on consequent calls.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2074
Bunch of misc fixes and preparations for further improvements. The location changes are especially important later when we'll use outer windows everywhere we pass them to external callers (such as script engines, since inner windows are an implementation detail and all operations otherwise should go through the outer window "proxy").
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/2069
Fixes error connecting to servers in Life is Strange Remastered (due to timeout).
When there are multiple IP addresses for a host name Linux gethostbyname() returns those in random order upon each call (meaning to provide server load balancing). On Windows the order of IP addresses is not determined as well but it is the same on consequent calls (changes after network resets and probably DNS timeout expiration).
The game executes multiple http requests over TLS connection through its own libraries using only winsock from Wine. Upon executing each next request it calls gethostbyname() for the server DNS name and uses the first returned IP address. When that's different from the previous IP address used for established TLS connection it doesn't reuse the connection and establishes the connection from scratch which is very long process due to how the game does it (on Windows as well).
One obvious way to make gethostbyname() behave like Windows would be to cache the results we get from host. But caching gethostbyname() results is tricky, there are already host-side caches which take into account DNS timeouts and network interfaces change. It is possible in theory to cache the result and then still call native gethostbyname() and keep the order if nothing else has changed in the reply, but it seems to me that would complicate things more than this patch does. The patch sorts the output by IP address randomly hashed with a random transform hash established only once per process run. So it will still provide load balancing between the IP addresses between different clients and different process instances while will be returning the same order of IP addresses on consequent calls.
--
v2: ws2_32: Provide same address order from gethostbyname() on consequent calls.
https://gitlab.winehq.org/wine/wine/-/merge_requests/2074
Pretty much the same as https://gitlab.winehq.org/wine/wine/-/merge_requests/1843, but on win32u side, to figure and validate the syscall entry signatures.
--
v5: win32u/tests: Test NtUserGetPointerInfoList syscall signature.
win32u/tests: Test NtUserIsMouseInPointerEnabled syscall.
win32u/tests: Test NtUserEnableMouseInPointer syscall.
win32u: Stub NtUserGetPointerInfoList syscall.
win32u: Stub NtUserIsMouseInPointerEnabled syscall.
win32u: Move NtUserEnableMouseInPointer from user32.
include: Declare some NtUser pointer related syscalls.
https://gitlab.winehq.org/wine/wine/-/merge_requests/1844