From 8c37f4362bff08732d0fc199670ef99ce413b33d Mon Sep 17 00:00:00 2001 From: Benjamin Cutler Date: Thu, 14 Apr 2005 11:31:39 +0000 Subject: [PATCH] Better handling of hInternet == NULL for INTERNET_OPTION_PROXY in INET_QueryOptionHelper. MSDN says to return 'global proxy info' when hInternet == NULL. Thanks to Juan Lang for helping with this. --- dlls/wininet/internet.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 5a239f45987..950cb0e96ce 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1875,12 +1875,14 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d case INTERNET_OPTION_PROXY: { LPWININETAPPINFOW lpwai = (LPWININETAPPINFOW)lpwhh; + WININETAPPINFOW wai; - if (!lpwhh) + if (lpwai == NULL) { - WARN("Invalid hInternet handle\n"); - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; + TRACE("Getting global proxy info\n"); + memset(&wai, 0, sizeof(WININETAPPINFOW)); + INTERNET_ConfigureProxyFromReg( &wai ); + lpwai = &wai; } if (bIsUnicode)