Jacek Caban : wininet: Simplify proxy server access in dialogs.

Alexandre Julliard julliard at winehq.org
Fri Jun 8 13:36:13 CDT 2012


Module: wine
Branch: master
Commit: 9bc304689626cac7222da450df30b9e04011c307
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9bc304689626cac7222da450df30b9e04011c307

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Jun  8 10:51:58 2012 +0200

wininet: Simplify proxy server access in dialogs.

---

 dlls/wininet/dialogs.c |   56 +++--------------------------------------------
 1 files changed, 4 insertions(+), 52 deletions(-)

diff --git a/dlls/wininet/dialogs.c b/dlls/wininet/dialogs.c
index a032ebb..2ec12ae 100644
--- a/dlls/wininet/dialogs.c
+++ b/dlls/wininet/dialogs.c
@@ -58,45 +58,6 @@ struct WININET_ErrorDlgParams
 };
 
 /***********************************************************************
- *         WININET_GetProxyServer
- *
- *  Determine the name of the proxy server the request is using
- */
-static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
-{
-    http_request_t *request;
-    http_session_t *session = NULL;
-    appinfo_t *hIC = NULL;
-    BOOL ret = FALSE;
-    LPWSTR p;
-
-    request = (http_request_t*) get_handle_object( hRequest );
-    if (NULL == request)
-        return FALSE;
-
-    session = request->session;
-    if (NULL == session)
-        goto done;
-
-    hIC = session->appInfo;
-    if (NULL == hIC)
-        goto done;
-
-    lstrcpynW(szBuf, hIC->proxy, sz);
-
-    /* FIXME: perhaps it would be better to use InternetCrackUrl here */
-    p = strchrW(szBuf, ':');
-    if (p)
-        *p = 0;
-
-    ret = TRUE;
-
-done:
-    WININET_Release( &request->hdr );
-    return ret;
-}
-
-/***********************************************************************
  *         WININET_GetServer
  *
  *  Determine the name of the web server
@@ -324,13 +285,8 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
             SetWindowTextW( hitem, szRealm );
         }
 
-        /* extract the name of the proxy server */
-        if( WININET_GetProxyServer( params->req->hdr.hInternet,
-                                    szServer, sizeof szServer/sizeof(WCHAR)) )
-        {
-            hitem = GetDlgItem( hdlg, IDC_PROXY );
-            SetWindowTextW( hitem, szServer );
-        }
+        hitem = GetDlgItem( hdlg, IDC_PROXY );
+        SetWindowTextW( hitem, params->req->session->appInfo->proxy );
 
         WININET_GetSetPassword( hdlg, szServer, szRealm, FALSE );
 
@@ -361,12 +317,8 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
             if( hitem &&
                 SendMessageW( hitem, BM_GETSTATE, 0, 0 ) &&
                 WININET_GetAuthRealm( params->req->hdr.hInternet,
-                                  szRealm, sizeof szRealm/sizeof(WCHAR), TRUE ) &&
-                WININET_GetProxyServer( params->req->hdr.hInternet,
-                                    szServer, sizeof szServer/sizeof(WCHAR)) )
-            {
-                WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE );
-            }
+                                      szRealm, sizeof szRealm/sizeof(WCHAR), TRUE) )
+                WININET_GetSetPassword( hdlg, params->req->session->appInfo->proxy, szRealm, TRUE );
             WININET_SetAuthorization( params->req->hdr.hInternet, username, password, TRUE );
 
             EndDialog( hdlg, ERROR_INTERNET_FORCE_RETRY );




More information about the wine-cvs mailing list