Fix proxy support, remove typecasts.

This commit is contained in:
Mike McCormack 2004-06-01 20:19:56 +00:00 committed by Alexandre Julliard
parent 0f939fc9b5
commit a9b405cf9a
3 changed files with 18 additions and 14 deletions

View File

@ -58,11 +58,12 @@ struct WININET_ErrorDlgParams
*/
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_GetSetPassword( HWND hdlg, LPCWSTR szServer,
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 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
case WM_COMMAND:
if( wParam == IDOK )
{
LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) params->hRequest;
WCHAR username[0x20], password[0x20];
username[0] = 0;
@ -296,7 +300,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
{
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;

View File

@ -540,7 +540,7 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC,
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;

View File

@ -1172,10 +1172,10 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
* <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 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
}
else
{
lpszcp = (LPWSTR)lpszUrl; /* Relative url */
lpszcp = lpszUrl; /* Relative url */
}
break;
@ -1217,7 +1217,7 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
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 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
/* 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 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
}
else /* Parse out username and password */
{
LPWSTR lpszUser = lpszcp;
LPWSTR lpszPasswd = lpszHost;
LPCWSTR lpszUser = lpszcp;
LPCWSTR lpszPasswd = lpszHost;
while (lpszcp < lpszHost)
{