mirror of
https://github.com/reactos/reactos.git
synced 2025-07-08 00:47:51 +00:00
[WINESYNC] wininet: Handle http_proxy variable entirely in Unicode.
Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id cadad89d106186a9d0377607096a58677496ec50 by Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5f12c8d726
commit
0a44ccfa80
2 changed files with 8 additions and 20 deletions
|
@ -545,7 +545,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
|
||||||
{
|
{
|
||||||
HKEY key;
|
HKEY key;
|
||||||
DWORD type, len;
|
DWORD type, len;
|
||||||
LPCSTR envproxy;
|
const WCHAR *envproxy;
|
||||||
LONG ret;
|
LONG ret;
|
||||||
|
|
||||||
memset( lpwpi, 0, sizeof(*lpwpi) );
|
memset( lpwpi, 0, sizeof(*lpwpi) );
|
||||||
|
@ -577,7 +577,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(envproxy = getenv( "http_proxy" )) || lpwpi->proxyEnabled)
|
if (!(envproxy = _wgetenv( L"http_proxy" )) || lpwpi->proxyEnabled)
|
||||||
{
|
{
|
||||||
/* figure out how much memory the proxy setting takes */
|
/* figure out how much memory the proxy setting takes */
|
||||||
if (!RegQueryValueExW( key, szProxyServer, NULL, &type, NULL, &len ) && len && (type == REG_SZ))
|
if (!RegQueryValueExW( key, szProxyServer, NULL, &type, NULL, &len ) && len && (type == REG_SZ))
|
||||||
|
@ -619,18 +619,8 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
|
||||||
}
|
}
|
||||||
else if (envproxy)
|
else if (envproxy)
|
||||||
{
|
{
|
||||||
WCHAR *envproxyW;
|
|
||||||
|
|
||||||
len = MultiByteToWideChar( CP_UNIXCP, 0, envproxy, -1, NULL, 0 );
|
|
||||||
if (!(envproxyW = heap_alloc(len * sizeof(WCHAR))))
|
|
||||||
{
|
|
||||||
RegCloseKey( key );
|
|
||||||
return ERROR_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
MultiByteToWideChar( CP_UNIXCP, 0, envproxy, -1, envproxyW, len );
|
|
||||||
|
|
||||||
FreeProxyInfo( lpwpi );
|
FreeProxyInfo( lpwpi );
|
||||||
if (parse_proxy_url( lpwpi, envproxyW ))
|
if (parse_proxy_url( lpwpi, envproxy ))
|
||||||
{
|
{
|
||||||
TRACE("http proxy (from environment) = %s\n", debugstr_w(lpwpi->proxy));
|
TRACE("http proxy (from environment) = %s\n", debugstr_w(lpwpi->proxy));
|
||||||
lpwpi->proxyEnabled = 1;
|
lpwpi->proxyEnabled = 1;
|
||||||
|
@ -638,19 +628,18 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WARN("failed to parse http_proxy value %s\n", debugstr_w(envproxyW));
|
WARN("failed to parse http_proxy value %s\n", debugstr_w(envproxy));
|
||||||
lpwpi->proxyEnabled = 0;
|
lpwpi->proxyEnabled = 0;
|
||||||
lpwpi->proxy = NULL;
|
lpwpi->proxy = NULL;
|
||||||
lpwpi->proxyBypass = NULL;
|
lpwpi->proxyBypass = NULL;
|
||||||
}
|
}
|
||||||
heap_free( envproxyW );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lpwpi->proxyEnabled)
|
if (lpwpi->proxyEnabled)
|
||||||
{
|
{
|
||||||
TRACE("Proxy is enabled.\n");
|
TRACE("Proxy is enabled.\n");
|
||||||
|
|
||||||
if (!(envproxy = getenv( "no_proxy" )))
|
if (!(envproxy = _wgetenv( L"no_proxy" )))
|
||||||
{
|
{
|
||||||
/* figure out how much memory the proxy setting takes */
|
/* figure out how much memory the proxy setting takes */
|
||||||
if (!RegQueryValueExW( key, szProxyOverride, NULL, &type, NULL, &len ) && len && (type == REG_SZ))
|
if (!RegQueryValueExW( key, szProxyOverride, NULL, &type, NULL, &len ) && len && (type == REG_SZ))
|
||||||
|
@ -681,13 +670,12 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
|
||||||
{
|
{
|
||||||
WCHAR *envproxyW;
|
WCHAR *envproxyW;
|
||||||
|
|
||||||
len = MultiByteToWideChar( CP_UNIXCP, 0, envproxy, -1, NULL, 0 );
|
if (!(envproxyW = heap_alloc(lstrlenW(envproxy) * sizeof(WCHAR))))
|
||||||
if (!(envproxyW = heap_alloc(len * sizeof(WCHAR))))
|
|
||||||
{
|
{
|
||||||
RegCloseKey( key );
|
RegCloseKey( key );
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
MultiByteToWideChar( CP_UNIXCP, 0, envproxy, -1, envproxyW, len );
|
lstrcpyW( envproxyW, envproxy );
|
||||||
|
|
||||||
heap_free( lpwpi->proxyBypass );
|
heap_free( lpwpi->proxyBypass );
|
||||||
lpwpi->proxyBypass = envproxyW;
|
lpwpi->proxyBypass = envproxyW;
|
||||||
|
|
|
@ -5,4 +5,4 @@ files:
|
||||||
include/wininet.h: sdk/include/psdk/wininet.h
|
include/wininet.h: sdk/include/psdk/wininet.h
|
||||||
include/winineti.h: sdk/include/psdk/winineti.h
|
include/winineti.h: sdk/include/psdk/winineti.h
|
||||||
tags:
|
tags:
|
||||||
wine: 3c31cc5836026b45a40818ec874bbbcc4d6ad982
|
wine: cadad89d106186a9d0377607096a58677496ec50
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue