WININET: fix proxy support, remove typecasts

Mike McCormack mike at codeweavers.com
Mon May 31 11:18:12 CDT 2004


ChangeLog:
* fix proxy support, remove typecasts
-------------- next part --------------
Index: dlls/wininet/dialogs.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/dialogs.c,v
retrieving revision 1.6
diff -u -r1.6 dialogs.c
--- dlls/wininet/dialogs.c	19 Apr 2004 20:12:14 -0000	1.6
+++ dlls/wininet/dialogs.c	31 May 2004 15:07:14 -0000
@@ -58,11 +58,12 @@
  */
 static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
 {
-    LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) hRequest;
+    LPWININETHTTPREQW lpwhr;
     LPWININETHTTPSESSIONW lpwhs = NULL;
     LPWININETAPPINFOW hIC = NULL;
     LPWSTR p;
 
+    lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest );
     if (NULL == lpwhr)
 	return FALSE;
 
@@ -195,11 +196,15 @@
 static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest,
                                          LPWSTR username, LPWSTR password )
 {
-    LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) hRequest;
+    LPWININETHTTPREQW lpwhr;
     LPWININETHTTPSESSIONW lpwhs;
     LPWININETAPPINFOW hIC;
     LPWSTR p;
 
+    lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest );
+    if( !lpwhr )
+	return FALSE;
+        
     lpwhs = (LPWININETHTTPSESSIONW) lpwhr->hdr.lpwhparent;
     if (NULL == lpwhs ||  lpwhs->hdr.htype != WH_HHTTPSESSION)
     {
@@ -273,7 +278,6 @@
     case WM_COMMAND:
         if( wParam == IDOK )
         {
-            LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) params->hRequest;
             WCHAR username[0x20], password[0x20];
 
             username[0] = 0;
@@ -296,7 +300,7 @@
             {
                 WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE );
             }
-            WININET_SetProxyAuthorization( lpwhr, username, password );
+            WININET_SetProxyAuthorization( params->hRequest, username, password );
 
             EndDialog( hdlg, ERROR_INTERNET_FORCE_RETRY );
             return TRUE;
Index: dlls/wininet/http.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/http.c,v
retrieving revision 1.61
diff -u -r1.61 http.c
--- dlls/wininet/http.c	13 May 2004 05:17:25 -0000	1.61
+++ dlls/wininet/http.c	31 May 2004 15:07:15 -0000
@@ -540,7 +540,7 @@
     static const WCHAR szNul[] = { 0 };
     URL_COMPONENTSW UrlComponents;
     static const WCHAR szHttp[] = { 'h','t','t','p',':','/','/',0 }, szSlash[] = { '/',0 } ;
-    static const WCHAR szFormat1[] = { 'h','t','t','p',':','/','/','%','s',':','%','d',0 };
+    static const WCHAR szFormat1[] = { 'h','t','t','p',':','/','/','%','s',0 };
     static const WCHAR szFormat2[] = { 'h','t','t','p',':','/','/','%','s',':','%','d',0 };
     int len;
 
Index: dlls/wininet/internet.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/internet.c,v
retrieving revision 1.86
diff -u -r1.86 internet.c
--- dlls/wininet/internet.c	25 May 2004 04:02:05 -0000	1.86
+++ dlls/wininet/internet.c	31 May 2004 15:07:16 -0000
@@ -1172,10 +1172,10 @@
    * <protocol>:[//<net_loc>][/path][;<params>][?<query>][#<fragment>]
    *
    */
-    LPWSTR lpszParam    = NULL;
+    LPCWSTR lpszParam    = NULL;
     BOOL  bIsAbsolute = FALSE;
-    LPWSTR lpszap = (WCHAR*)lpszUrl;
-    LPWSTR lpszcp = NULL;
+    LPCWSTR lpszap = lpszUrl;
+    LPCWSTR lpszcp = NULL;
     const WCHAR lpszSeparators[3]={';','?',0};
     const WCHAR lpszSlash[2]={'/',0};
     if(dwUrlLength==0)
@@ -1198,7 +1198,7 @@
         }
         else
         {
-            lpszcp = (LPWSTR)lpszUrl; /* Relative url */
+            lpszcp = lpszUrl; /* Relative url */
         }
 
         break;
@@ -1217,7 +1217,7 @@
 
     if (bIsAbsolute) /* Parse <protocol>:[//<net_loc>] */
     {
-        LPWSTR lpszNetLoc;
+        LPCWSTR lpszNetLoc;
         static const WCHAR wszAbout[]={'a','b','o','u','t',':',0};
 
         /* Get scheme first. */
@@ -1265,8 +1265,8 @@
             /* Parse net-loc */
             if (lpszNetLoc)
             {
-                LPWSTR lpszHost;
-                LPWSTR lpszPort;
+                LPCWSTR lpszHost;
+                LPCWSTR lpszPort;
 
                 /* [<user>[<:password>]@]<host>[:<port>] */
                 /* First find the user and password if they exist */
@@ -1280,8 +1280,8 @@
                 }
                 else /* Parse out username and password */
                 {
-                    LPWSTR lpszUser = lpszcp;
-                    LPWSTR lpszPasswd = lpszHost;
+                    LPCWSTR lpszUser = lpszcp;
+                    LPCWSTR lpszPasswd = lpszHost;
 
                     while (lpszcp < lpszHost)
                     {


More information about the wine-patches mailing list