Commit 2b09cfe9 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

winhttp/tests: Properly restore proxy settings on 64-bit.

parent 1c3d6ab9
......@@ -1217,21 +1217,28 @@ static DWORD get_default_proxy_reg_value( BYTE *buf, DWORD len, DWORD *type )
return ret;
}
static void set_default_proxy_reg_value( BYTE *buf, DWORD len, DWORD type )
static void set_proxy( REGSAM access, BYTE *buf, DWORD len, DWORD type )
{
LONG l;
HKEY key;
HKEY hkey;
if (!RegCreateKeyExW( HKEY_LOCAL_MACHINE, Connections, 0, NULL, 0, access, NULL, &hkey, NULL ))
{
if (len) RegSetValueExW( hkey, WinHttpSettings, 0, type, buf, len );
else RegDeleteValueW( hkey, WinHttpSettings );
RegCloseKey( hkey );
}
}
l = RegCreateKeyExW( HKEY_LOCAL_MACHINE, Connections, 0, NULL, 0,
KEY_WRITE, NULL, &key, NULL );
if (!l)
static void set_default_proxy_reg_value( BYTE *buf, DWORD len, DWORD type )
{
BOOL wow64;
IsWow64Process( GetCurrentProcess(), &wow64 );
if (sizeof(void *) > sizeof(int) || wow64)
{
if (len)
RegSetValueExW( key, WinHttpSettings, 0, type, buf, len );
else
RegDeleteValueW( key, WinHttpSettings );
RegCloseKey( key );
set_proxy( KEY_WRITE|KEY_WOW64_64KEY, buf, len, type );
set_proxy( KEY_WRITE|KEY_WOW64_32KEY, buf, len, type );
}
else
set_proxy( KEY_WRITE, buf, len, type );
}
static void test_set_default_proxy_config(void)
......
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