Commit f547592b authored by Haoyang Chen's avatar Haoyang Chen Committed by Alexandre Julliard

winhttp: Invalid url decomposition should return failure when it fails.

parent 326f44e1
......@@ -1854,7 +1854,7 @@ static BOOL run_script( char *script, DWORD size, const WCHAR *url, WINHTTP_PROX
uc.dwStructSize = sizeof(uc);
uc.dwHostNameLength = -1;
if (WinHttpCrackUrl( url, 0, 0, &uc ))
if ((ret = WinHttpCrackUrl( url, 0, 0, &uc )))
{
char *hostnameA = strdupWA_sized( uc.lpszHostName, uc.dwHostNameLength );
......@@ -1868,7 +1868,8 @@ static BOOL run_script( char *script, DWORD size, const WCHAR *url, WINHTTP_PROX
heap_free( hostnameA );
}
heap_free( urlA );
return InternetDeInitializeAutoProxyDll( NULL, 0 );
InternetDeInitializeAutoProxyDll( NULL, 0 );
return ret;
}
/***********************************************************************
......
......@@ -4974,6 +4974,9 @@ static void test_WinHttpGetProxyForUrl(void)
trace("Proxy.ProxyBypass=%s\n", wine_dbgstr_w(info.lpszProxyBypass));
GlobalFree( info.lpszProxy );
GlobalFree( info.lpszProxyBypass );
ret = WinHttpGetProxyForUrl( session, L"http:", &options, &info );
ok( !ret, "expected failure\n" );
}
options.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
......@@ -4990,6 +4993,13 @@ static void test_WinHttpGetProxyForUrl(void)
GlobalFree( info.lpszProxy );
GlobalFree( info.lpszProxyBypass );
}
options.dwFlags = WINHTTP_AUTOPROXY_AUTO_DETECT;
options.dwAutoDetectFlags = WINHTTP_AUTO_DETECT_TYPE_DHCP|WINHTTP_AUTO_DETECT_TYPE_DNS_A;
ret = WinHttpGetProxyForUrl( session, L"http:", &options, &info );
ok( !ret, "expected failure\n" );
WinHttpCloseHandle( session );
}
......
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