Commit ed1cb1f0 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wininet: Set ProxyEnable registry value if it isn't already set.

parent e4c59c26
......@@ -357,16 +357,15 @@ static BOOL INTERNET_ConfigureProxy( LPWININETAPPINFOW lpwai )
if (RegOpenKeyW( HKEY_CURRENT_USER, szInternetSettings, &key )) return FALSE;
len = sizeof enabled;
if (!RegQueryValueExW( key, szProxyEnable, NULL, &type, (BYTE *)&enabled, &len ) &&
(type == REG_DWORD))
{
if (RegQueryValueExW( key, szProxyEnable, NULL, &type, (BYTE *)&enabled, &len ) || type != REG_DWORD)
RegSetValueExW( key, szProxyEnable, 0, REG_DWORD, (BYTE *)&enabled, sizeof(REG_DWORD) );
if (enabled)
{
TRACE("Proxy is enabled.\n");
/* 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))
{
LPWSTR szProxy, p;
static const WCHAR szHttp[] = {'h','t','t','p','=',0};
......@@ -396,7 +395,6 @@ static BOOL INTERNET_ConfigureProxy( LPWININETAPPINFOW lpwai )
else
ERR("Couldn't read proxy server settings from registry.\n");
}
}
else if ((envproxy = getenv( "http_proxy" )))
{
WCHAR *envproxyW;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment