Fix proxy support, remove typecasts.
diff --git a/dlls/wininet/dialogs.c b/dlls/wininet/dialogs.c
index 9ca2290..9187ed8 100644
--- a/dlls/wininet/dialogs.c
+++ b/dlls/wininet/dialogs.c
@@ -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;
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 64f87ab..4c3391d 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -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;
diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c
index c4feac6..f81348e 100644
--- a/dlls/wininet/internet.c
+++ b/dlls/wininet/internet.c
@@ -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)
{