Commit 74f596c5 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Read status code directly from request object in InternetErrorDlg.

parent ebff6036
...@@ -477,28 +477,6 @@ static INT_PTR WINAPI WININET_InvalidCertificateDialog( ...@@ -477,28 +477,6 @@ static INT_PTR WINAPI WININET_InvalidCertificateDialog(
} }
/*********************************************************************** /***********************************************************************
* WININET_GetConnectionStatus
*/
static INT WININET_GetConnectionStatus( HINTERNET hRequest )
{
WCHAR szStatus[0x20];
DWORD sz, index, dwStatus;
TRACE("%p\n", hRequest );
sz = sizeof szStatus;
index = 0;
if( !HttpQueryInfoW( hRequest, HTTP_QUERY_STATUS_CODE,
szStatus, &sz, &index))
return -1;
dwStatus = atoiW( szStatus );
TRACE("request %p status = %d\n", hRequest, dwStatus );
return dwStatus;
}
/***********************************************************************
* InternetErrorDlg * InternetErrorDlg
*/ */
DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest, DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
...@@ -531,16 +509,12 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest, ...@@ -531,16 +509,12 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
{ {
case ERROR_SUCCESS: case ERROR_SUCCESS:
case ERROR_INTERNET_INCORRECT_PASSWORD: { case ERROR_INTERNET_INCORRECT_PASSWORD: {
DWORD dwStatus;
if( !dwError && !(dwFlags & FLAGS_ERROR_UI_FILTER_FOR_ERRORS ) ) if( !dwError && !(dwFlags & FLAGS_ERROR_UI_FILTER_FOR_ERRORS ) )
break; break;
if(!req) if(!req)
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
dwStatus = WININET_GetConnectionStatus( hRequest ); switch(req->status_code) {
switch (dwStatus)
{
case HTTP_STATUS_PROXY_AUTH_REQ: case HTTP_STATUS_PROXY_AUTH_REQ:
res = DialogBoxParamW( WININET_hModule, MAKEINTRESOURCEW( IDD_PROXYDLG ), res = DialogBoxParamW( WININET_hModule, MAKEINTRESOURCEW( IDD_PROXYDLG ),
hWnd, WININET_ProxyPasswordDialog, (LPARAM) &params ); hWnd, WININET_ProxyPasswordDialog, (LPARAM) &params );
...@@ -550,7 +524,7 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest, ...@@ -550,7 +524,7 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
hWnd, WININET_PasswordDialog, (LPARAM) &params ); hWnd, WININET_PasswordDialog, (LPARAM) &params );
break; break;
default: default:
WARN("unhandled status %u\n", dwStatus); WARN("unhandled status %u\n", req->status_code);
} }
break; break;
} }
......
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