Module: wine Branch: master Commit: 40b5e767d464917a6b53f444ce4d2a3a8f53389c URL: https://gitlab.winehq.org/wine/wine/-/commit/40b5e767d464917a6b53f444ce4d2a3...
Author: Piotr Caban piotr@codeweavers.com Date: Tue Feb 6 17:21:16 2024 +0100
wininet: Add support for reading AutoConfigURL from registry.
---
dlls/wininet/internet.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 4739834df53..1d7b9796a21 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -86,6 +86,7 @@ typedef struct LPWSTR proxyBypass; LPWSTR proxyUsername; LPWSTR proxyPassword; + LPWSTR autoconf_url; } proxyinfo_t;
static ULONG max_conns = 2, max_1_0_conns = 4; @@ -470,6 +471,7 @@ static void FreeProxyInfo( proxyinfo_t *lpwpi ) free(lpwpi->proxyBypass); free(lpwpi->proxyUsername); free(lpwpi->proxyPassword); + free(lpwpi->autoconf_url); }
static proxyinfo_t global_proxy; @@ -605,6 +607,23 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi ) TRACE("No proxy bypass server settings in registry.\n"); }
+ if (!RegQueryValueExW( key, L"AutoConfigURL", NULL, &type, NULL, &len ) && len && (type == REG_SZ)) + { + LPWSTR autoconf_url; + + if (!(autoconf_url = malloc( len ))) + { + RegCloseKey( key ); + FreeProxyInfo( lpwpi ); + return ERROR_OUTOFMEMORY; + } + RegQueryValueExW( key, L"AutoConfigURL", NULL, &type, (BYTE*)autoconf_url, &len ); + + lpwpi->flags |= PROXY_TYPE_AUTO_PROXY_URL; + lpwpi->autoconf_url = autoconf_url; + TRACE("AutoConfigURL = %s\n", debugstr_w(lpwpi->autoconf_url)); + } + RegCloseKey( key ); return ERROR_SUCCESS; }