Commit 09d2d477 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Convert WININETAPPINFOA structure to unicode.

parent cb308327
...@@ -56,12 +56,12 @@ struct WININET_ErrorDlgParams ...@@ -56,12 +56,12 @@ struct WININET_ErrorDlgParams
* *
* Determine the name of the proxy server the request is using * Determine the name of the proxy server the request is using
*/ */
static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPSTR szBuf, DWORD sz ) static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
{ {
LPWININETHTTPREQA lpwhr = (LPWININETHTTPREQA) hRequest; LPWININETHTTPREQA lpwhr = (LPWININETHTTPREQA) hRequest;
LPWININETHTTPSESSIONA lpwhs = NULL; LPWININETHTTPSESSIONA lpwhs = NULL;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPSTR p; LPWSTR p;
if (NULL == lpwhr) if (NULL == lpwhr)
return FALSE; return FALSE;
...@@ -70,14 +70,14 @@ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPSTR szBuf, DWORD sz ) ...@@ -70,14 +70,14 @@ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPSTR szBuf, DWORD sz )
if (NULL == lpwhs) if (NULL == lpwhs)
return FALSE; return FALSE;
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
if (NULL == hIC) if (NULL == hIC)
return FALSE; return FALSE;
strncpy(szBuf, hIC->lpszProxy, sz); strncpyW(szBuf, hIC->lpszProxy, sz);
/* FIXME: perhaps it would be better to use InternetCrackUrl here */ /* FIXME: perhaps it would be better to use InternetCrackUrl here */
p = strchr(szBuf, ':'); p = strchrW(szBuf, ':');
if(*p) if(*p)
*p = 0; *p = 0;
...@@ -89,14 +89,15 @@ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPSTR szBuf, DWORD sz ) ...@@ -89,14 +89,15 @@ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPSTR szBuf, DWORD sz )
* *
* Determine the name of the (basic) Authentication realm * Determine the name of the (basic) Authentication realm
*/ */
static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPSTR szBuf, DWORD sz ) static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
{ {
LPSTR p, q; LPWSTR p, q;
DWORD index; DWORD index;
WCHAR szRealm[] = { 'r','e','a','l','m','=',0 };
/* extract the Realm from the proxy response and show it */ /* extract the Realm from the proxy response and show it */
index = 0; index = 0;
if( !HttpQueryInfoA( hRequest, HTTP_QUERY_PROXY_AUTHENTICATE, if( !HttpQueryInfoW( hRequest, HTTP_QUERY_PROXY_AUTHENTICATE,
szBuf, &sz, &index) ) szBuf, &sz, &index) )
return FALSE; return FALSE;
...@@ -104,21 +105,21 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPSTR szBuf, DWORD sz ) ...@@ -104,21 +105,21 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPSTR szBuf, DWORD sz )
* FIXME: maybe we should check that we're * FIXME: maybe we should check that we're
* dealing with 'Basic' Authentication * dealing with 'Basic' Authentication
*/ */
p = strchr( szBuf, ' ' ); p = strchrW( szBuf, ' ' );
if( p && !strncmp( p+1, "realm=", 6 ) ) if( p && !strncmpW( p+1, szRealm, strlenW(szRealm) ) )
{ {
/* remove quotes */ /* remove quotes */
p += 7; p += 7;
if( *p == '"' ) if( *p == '"' )
{ {
p++; p++;
q = strrchr( p, '"' ); q = strrchrW( p, '"' );
if( q ) if( q )
*q = 0; *q = 0;
} }
} }
strcpy( szBuf, p ); strcpyW( szBuf, p );
return TRUE; return TRUE;
} }
...@@ -126,50 +127,62 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPSTR szBuf, DWORD sz ) ...@@ -126,50 +127,62 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPSTR szBuf, DWORD sz )
/*********************************************************************** /***********************************************************************
* WININET_GetSetPassword * WININET_GetSetPassword
*/ */
static BOOL WININET_GetSetPassword( HWND hdlg, LPCSTR szServer, static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
LPCSTR szRealm, BOOL bSet ) LPCWSTR szRealm, BOOL bSet )
{ {
CHAR szResource[0x80], szUserPass[0x40]; WCHAR szResource[0x80], szUserPass[0x40];
LPSTR p; LPWSTR p;
HWND hUserItem, hPassItem; HWND hUserItem, hPassItem;
DWORD r, dwMagic = 19; DWORD r, dwMagic = 19;
UINT len; UINT r_len, u_len;
WORD sz; WORD sz;
WCHAR szColon[] = { ':',0 }, szbs[] = { '/', 0 };
hUserItem = GetDlgItem( hdlg, IDC_USERNAME ); hUserItem = GetDlgItem( hdlg, IDC_USERNAME );
hPassItem = GetDlgItem( hdlg, IDC_PASSWORD ); hPassItem = GetDlgItem( hdlg, IDC_PASSWORD );
/* now try fetch the username and password */ /* now try fetch the username and password */
strcpy( szResource, szServer); lstrcpyW( szResource, szServer);
strcat( szResource, "/"); lstrcatW( szResource, szbs);
strcat( szResource, szRealm); lstrcatW( szResource, szRealm);
/*
* WNetCachePassword is only concerned with the length
* of the data stored (which we tell it) and it does
* not use strlen() internally so we can add WCHAR data
* instead of ASCII data and get it back the same way.
*/
if( bSet ) if( bSet )
{ {
szUserPass[0] = 0; szUserPass[0] = 0;
GetWindowTextA( hUserItem, szUserPass, sizeof szUserPass-1 ); GetWindowTextW( hUserItem, szUserPass,
strcat(szUserPass, ":"); (sizeof szUserPass-1)/sizeof(WCHAR) );
len = strlen( szUserPass ); lstrcatW(szUserPass, szColon);
GetWindowTextA( hPassItem, szUserPass+len, sizeof szUserPass-len ); u_len = strlenW( szUserPass );
GetWindowTextW( hPassItem, szUserPass+u_len,
r = WNetCachePassword( szResource, strlen( szResource ) + 1, (sizeof szUserPass)/sizeof(WCHAR)-u_len );
szUserPass, strlen( szUserPass ) + 1, dwMagic, 0 );
r_len = (strlenW( szResource ) + 1)*sizeof(WCHAR);
u_len = (strlenW( szUserPass ) + 1)*sizeof(WCHAR);
r = WNetCachePassword( (CHAR*)szResource, r_len,
(CHAR*)szUserPass, u_len, dwMagic, 0 );
return ( r == WN_SUCCESS ); return ( r == WN_SUCCESS );
} }
sz = sizeof szUserPass; sz = sizeof szUserPass;
r = WNetGetCachedPassword( szResource, strlen( szResource ) + 1, r_len = (strlenW( szResource ) + 1)*sizeof(WCHAR);
szUserPass, &sz, dwMagic ); r = WNetGetCachedPassword( (CHAR*)szResource, r_len,
(CHAR*)szUserPass, &sz, dwMagic );
if( r != WN_SUCCESS ) if( r != WN_SUCCESS )
return FALSE; return FALSE;
p = strchr( szUserPass, ':' ); p = strchrW( szUserPass, ':' );
if( p ) if( p )
{ {
*p = 0; *p = 0;
SetWindowTextA( hUserItem, szUserPass ); SetWindowTextW( hUserItem, szUserPass );
SetWindowTextA( hPassItem, p+1 ); SetWindowTextW( hPassItem, p+1 );
} }
return TRUE; return TRUE;
...@@ -179,12 +192,12 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCSTR szServer, ...@@ -179,12 +192,12 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCSTR szServer,
* WININET_SetProxyAuthorization * WININET_SetProxyAuthorization
*/ */
static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest, static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest,
LPSTR username, LPSTR password ) LPWSTR username, LPWSTR password )
{ {
LPWININETHTTPREQA lpwhr = (LPWININETHTTPREQA) hRequest; LPWININETHTTPREQA lpwhr = (LPWININETHTTPREQA) hRequest;
LPWININETHTTPSESSIONA lpwhs; LPWININETHTTPSESSIONA lpwhs;
LPWININETAPPINFOA hIC; LPWININETAPPINFOW hIC;
LPSTR p; LPWSTR p;
lpwhs = (LPWININETHTTPSESSIONA) lpwhr->hdr.lpwhparent; lpwhs = (LPWININETHTTPSESSIONA) lpwhr->hdr.lpwhparent;
if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION) if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION)
...@@ -193,20 +206,20 @@ static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest, ...@@ -193,20 +206,20 @@ static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest,
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
p = HeapAlloc( GetProcessHeap(), 0, strlen( username ) + 1 ); p = HeapAlloc( GetProcessHeap(), 0, (strlenW( username ) + 1)*sizeof(WCHAR) );
if( !p ) if( !p )
return FALSE; return FALSE;
strcpy( p, username ); lstrcpyW( p, username );
hIC->lpszProxyUsername = p; hIC->lpszProxyUsername = p;
p = HeapAlloc( GetProcessHeap(), 0, strlen( password ) + 1 ); p = HeapAlloc( GetProcessHeap(), 0, (strlenW( password ) + 1)*sizeof(WCHAR) );
if( !p ) if( !p )
return FALSE; return FALSE;
strcpy( p, password ); lstrcpyW( p, password );
hIC->lpszProxyPassword = p; hIC->lpszProxyPassword = p;
return TRUE; return TRUE;
...@@ -220,7 +233,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog( ...@@ -220,7 +233,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
{ {
HWND hitem; HWND hitem;
struct WININET_ErrorDlgParams *params; struct WININET_ErrorDlgParams *params;
CHAR szRealm[0x80], szServer[0x80]; WCHAR szRealm[0x80], szServer[0x80];
if( uMsg == WM_INITDIALOG ) if( uMsg == WM_INITDIALOG )
{ {
...@@ -232,18 +245,18 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog( ...@@ -232,18 +245,18 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
/* extract the Realm from the proxy response and show it */ /* extract the Realm from the proxy response and show it */
if( WININET_GetAuthRealm( params->hRequest, if( WININET_GetAuthRealm( params->hRequest,
szRealm, sizeof szRealm) ) szRealm, sizeof szRealm/sizeof(WCHAR)) )
{ {
hitem = GetDlgItem( hdlg, IDC_REALM ); hitem = GetDlgItem( hdlg, IDC_REALM );
SetWindowTextA( hitem, szRealm ); SetWindowTextW( hitem, szRealm );
} }
/* extract the name of the proxy server */ /* extract the name of the proxy server */
if( WININET_GetProxyServer( params->hRequest, if( WININET_GetProxyServer( params->hRequest,
szServer, sizeof szServer) ) szServer, sizeof szServer/sizeof(WCHAR)) )
{ {
hitem = GetDlgItem( hdlg, IDC_PROXY ); hitem = GetDlgItem( hdlg, IDC_PROXY );
SetWindowTextA( hitem, szServer ); SetWindowTextW( hitem, szServer );
} }
WININET_GetSetPassword( hdlg, szServer, szRealm, FALSE ); WININET_GetSetPassword( hdlg, szServer, szRealm, FALSE );
...@@ -260,25 +273,25 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog( ...@@ -260,25 +273,25 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
if( wParam == IDOK ) if( wParam == IDOK )
{ {
LPWININETHTTPREQA lpwhr = (LPWININETHTTPREQA) params->hRequest; LPWININETHTTPREQA lpwhr = (LPWININETHTTPREQA) params->hRequest;
CHAR username[0x20], password[0x20]; WCHAR username[0x20], password[0x20];
username[0] = 0; username[0] = 0;
hitem = GetDlgItem( hdlg, IDC_USERNAME ); hitem = GetDlgItem( hdlg, IDC_USERNAME );
if( hitem ) if( hitem )
GetWindowTextA( hitem, username, sizeof username ); GetWindowTextW( hitem, username, sizeof username/sizeof(WCHAR) );
password[0] = 0; password[0] = 0;
hitem = GetDlgItem( hdlg, IDC_PASSWORD ); hitem = GetDlgItem( hdlg, IDC_PASSWORD );
if( hitem ) if( hitem )
GetWindowTextA( hitem, password, sizeof password ); GetWindowTextW( hitem, password, sizeof password/sizeof(WCHAR) );
hitem = GetDlgItem( hdlg, IDC_SAVEPASSWORD ); hitem = GetDlgItem( hdlg, IDC_SAVEPASSWORD );
if( hitem && if( hitem &&
SendMessageA( hitem, BM_GETSTATE, 0, 0 ) && SendMessageW( hitem, BM_GETSTATE, 0, 0 ) &&
WININET_GetAuthRealm( params->hRequest, WININET_GetAuthRealm( params->hRequest,
szRealm, sizeof szRealm) && szRealm, sizeof szRealm/sizeof(WCHAR)) &&
WININET_GetProxyServer( params->hRequest, WININET_GetProxyServer( params->hRequest,
szServer, sizeof szServer) ) szServer, sizeof szServer/sizeof(WCHAR)) )
{ {
WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE ); WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE );
} }
...@@ -302,17 +315,17 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog( ...@@ -302,17 +315,17 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
*/ */
static INT WININET_GetConnectionStatus( HINTERNET hRequest ) static INT WININET_GetConnectionStatus( HINTERNET hRequest )
{ {
CHAR szStatus[0x20]; WCHAR szStatus[0x20];
DWORD sz, index, dwStatus; DWORD sz, index, dwStatus;
TRACE("%p\n", hRequest ); TRACE("%p\n", hRequest );
sz = sizeof szStatus; sz = sizeof(szStatus) / sizeof(WCHAR);
index = 0; index = 0;
if( !HttpQueryInfoA( hRequest, HTTP_QUERY_STATUS_CODE, if( !HttpQueryInfoW( hRequest, HTTP_QUERY_STATUS_CODE,
szStatus, &sz, &index)) szStatus, &sz, &index))
return -1; return -1;
dwStatus = atoi( szStatus ); dwStatus = atoiW( szStatus );
TRACE("request %p status = %ld\n", hRequest, dwStatus ); TRACE("request %p status = %ld\n", hRequest, dwStatus );
......
...@@ -158,7 +158,7 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, ...@@ -158,7 +158,7 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
LPCSTR lpszNewRemoteFile, DWORD dwFlags, DWORD dwContext) LPCSTR lpszNewRemoteFile, DWORD dwFlags, DWORD dwContext)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hConnect ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hConnect );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -167,7 +167,7 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, ...@@ -167,7 +167,7 @@ BOOL WINAPI FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -204,7 +204,7 @@ BOOL WINAPI FTP_FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, ...@@ -204,7 +204,7 @@ BOOL WINAPI FTP_FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
{ {
HANDLE hFile = NULL; HANDLE hFile = NULL;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
INT nResCode; INT nResCode;
...@@ -228,7 +228,7 @@ BOOL WINAPI FTP_FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile, ...@@ -228,7 +228,7 @@ BOOL WINAPI FTP_FtpPutFileA(HINTERNET hConnect, LPCSTR lpszLocalFile,
goto lend; goto lend;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->lpfnStatusCB) if (hIC->lpfnStatusCB)
hIC->lpfnStatusCB(hConnect, lpwfs->hdr.dwContext, INTERNET_STATUS_SENDING_REQUEST, NULL, 0); hIC->lpfnStatusCB(hConnect, lpwfs->hdr.dwContext, INTERNET_STATUS_SENDING_REQUEST, NULL, 0);
...@@ -287,7 +287,7 @@ lend: ...@@ -287,7 +287,7 @@ lend:
BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hConnect ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hConnect );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -298,7 +298,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) ...@@ -298,7 +298,7 @@ BOOL WINAPI FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
TRACE("lpszDirectory(%s)\n", lpszDirectory); TRACE("lpszDirectory(%s)\n", lpszDirectory);
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -360,7 +360,7 @@ BOOL WINAPI FTP_FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory ...@@ -360,7 +360,7 @@ BOOL WINAPI FTP_FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory
{ {
INT nResCode; INT nResCode;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
DWORD bSuccess = FALSE; DWORD bSuccess = FALSE;
TRACE("lpszDirectory(%s)\n", lpszDirectory); TRACE("lpszDirectory(%s)\n", lpszDirectory);
...@@ -375,7 +375,7 @@ BOOL WINAPI FTP_FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory ...@@ -375,7 +375,7 @@ BOOL WINAPI FTP_FtpSetCurrentDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory
/* Clear any error information */ /* Clear any error information */
INTERNET_SetLastError(0); INTERNET_SetLastError(0);
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_CWD, lpszDirectory, if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_CWD, lpszDirectory,
hIC->lpfnStatusCB, hConnect, lpwfs->hdr.dwContext)) hIC->lpfnStatusCB, hConnect, lpwfs->hdr.dwContext))
goto lend; goto lend;
...@@ -418,7 +418,7 @@ lend: ...@@ -418,7 +418,7 @@ lend:
BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hConnect ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hConnect );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -427,7 +427,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) ...@@ -427,7 +427,7 @@ BOOL WINAPI FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -489,7 +489,7 @@ BOOL WINAPI FTP_FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) ...@@ -489,7 +489,7 @@ BOOL WINAPI FTP_FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
{ {
INT nResCode; INT nResCode;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
TRACE("\n"); TRACE("\n");
...@@ -518,7 +518,7 @@ BOOL WINAPI FTP_FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory) ...@@ -518,7 +518,7 @@ BOOL WINAPI FTP_FtpCreateDirectoryA(HINTERNET hConnect, LPCSTR lpszDirectory)
} }
lend: lend:
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
{ {
INTERNET_ASYNC_RESULT iar; INTERNET_ASYNC_RESULT iar;
...@@ -547,7 +547,7 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect, ...@@ -547,7 +547,7 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect,
LPCSTR lpszSearchFile, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwFlags, DWORD dwContext) LPCSTR lpszSearchFile, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwFlags, DWORD dwContext)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hConnect ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hConnect );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -556,7 +556,7 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect, ...@@ -556,7 +556,7 @@ HINTERNET WINAPI FtpFindFirstFileA(HINTERNET hConnect,
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -613,7 +613,7 @@ HINTERNET WINAPI FTP_FtpFindFirstFileA(HINTERNET hConnect, ...@@ -613,7 +613,7 @@ HINTERNET WINAPI FTP_FtpFindFirstFileA(HINTERNET hConnect,
LPCSTR lpszSearchFile, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwFlags, DWORD dwContext) LPCSTR lpszSearchFile, LPWIN32_FIND_DATAA lpFindFileData, DWORD dwFlags, DWORD dwContext)
{ {
INT nResCode; INT nResCode;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
HINTERNET hFindNext = NULL; HINTERNET hFindNext = NULL;
...@@ -638,7 +638,7 @@ HINTERNET WINAPI FTP_FtpFindFirstFileA(HINTERNET hConnect, ...@@ -638,7 +638,7 @@ HINTERNET WINAPI FTP_FtpFindFirstFileA(HINTERNET hConnect,
if (!FTP_SendPortOrPasv(lpwfs)) if (!FTP_SendPortOrPasv(lpwfs))
goto lend; goto lend;
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_LIST, lpszSearchFile, if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_LIST, lpszSearchFile,
hIC->lpfnStatusCB, hConnect, lpwfs->hdr.dwContext)) hIC->lpfnStatusCB, hConnect, lpwfs->hdr.dwContext))
goto lend; goto lend;
...@@ -708,7 +708,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire ...@@ -708,7 +708,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire
LPDWORD lpdwCurrentDirectory) LPDWORD lpdwCurrentDirectory)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
TRACE("len(%ld)\n", *lpdwCurrentDirectory); TRACE("len(%ld)\n", *lpdwCurrentDirectory);
...@@ -719,7 +719,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire ...@@ -719,7 +719,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -774,7 +774,7 @@ BOOL WINAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrent ...@@ -774,7 +774,7 @@ BOOL WINAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrent
{ {
INT nResCode; INT nResCode;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
DWORD bSuccess = FALSE; DWORD bSuccess = FALSE;
TRACE("len(%ld)\n", *lpdwCurrentDirectory); TRACE("len(%ld)\n", *lpdwCurrentDirectory);
...@@ -791,7 +791,7 @@ BOOL WINAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrent ...@@ -791,7 +791,7 @@ BOOL WINAPI FTP_FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrent
ZeroMemory(lpszCurrentDirectory, *lpdwCurrentDirectory); ZeroMemory(lpszCurrentDirectory, *lpdwCurrentDirectory);
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_PWD, NULL, if (!FTP_SendCommand(lpwfs->sndSocket, FTP_CMD_PWD, NULL,
hIC->lpfnStatusCB, hFtpSession, lpwfs->hdr.dwContext)) hIC->lpfnStatusCB, hFtpSession, lpwfs->hdr.dwContext))
goto lend; goto lend;
...@@ -855,7 +855,7 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession, ...@@ -855,7 +855,7 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession,
DWORD dwContext) DWORD dwContext)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hFtpSession ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hFtpSession );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -869,7 +869,7 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession, ...@@ -869,7 +869,7 @@ HINTERNET WINAPI FtpOpenFileA(HINTERNET hFtpSession,
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -929,7 +929,7 @@ HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, ...@@ -929,7 +929,7 @@ HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession,
INT nDataSocket; INT nDataSocket;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETFILE lpwh = NULL; LPWININETFILE lpwh = NULL;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
HINTERNET handle = NULL; HINTERNET handle = NULL;
...@@ -975,7 +975,7 @@ HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession, ...@@ -975,7 +975,7 @@ HINTERNET FTP_FtpOpenFileA(HINTERNET hFtpSession,
if (lpwfs->lstnSocket != -1) if (lpwfs->lstnSocket != -1)
close(lpwfs->lstnSocket); close(lpwfs->lstnSocket);
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
{ {
INTERNET_ASYNC_RESULT iar; INTERNET_ASYNC_RESULT iar;
...@@ -1013,7 +1013,7 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN ...@@ -1013,7 +1013,7 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
DWORD dwContext) DWORD dwContext)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hInternet ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hInternet );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -1027,7 +1027,7 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN ...@@ -1027,7 +1027,7 @@ BOOL WINAPI FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR lpszN
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -1089,7 +1089,7 @@ BOOL WINAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR l ...@@ -1089,7 +1089,7 @@ BOOL WINAPI FTP_FtpGetFileA(HINTERNET hInternet, LPCSTR lpszRemoteFile, LPCSTR l
DWORD nBytes; DWORD nBytes;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
HANDLE hFile; HANDLE hFile;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
TRACE("lpszRemoteFile(%s) lpszNewFile(%s)\n", lpszRemoteFile, lpszNewFile); TRACE("lpszRemoteFile(%s) lpszNewFile(%s)\n", lpszRemoteFile, lpszNewFile);
...@@ -1144,7 +1144,7 @@ lend: ...@@ -1144,7 +1144,7 @@ lend:
if (hFile) if (hFile)
CloseHandle(hFile); CloseHandle(hFile);
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
{ {
INTERNET_ASYNC_RESULT iar; INTERNET_ASYNC_RESULT iar;
...@@ -1172,7 +1172,7 @@ lend: ...@@ -1172,7 +1172,7 @@ lend:
BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName) BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hFtpSession ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hFtpSession );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -1181,7 +1181,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName) ...@@ -1181,7 +1181,7 @@ BOOL WINAPI FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -1215,7 +1215,7 @@ BOOL FTP_FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName) ...@@ -1215,7 +1215,7 @@ BOOL FTP_FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
{ {
INT nResCode; INT nResCode;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
TRACE("0x%08lx\n", (ULONG) hFtpSession); TRACE("0x%08lx\n", (ULONG) hFtpSession);
...@@ -1243,7 +1243,7 @@ BOOL FTP_FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName) ...@@ -1243,7 +1243,7 @@ BOOL FTP_FtpDeleteFileA(HINTERNET hFtpSession, LPCSTR lpszFileName)
FTP_SetResponseError(nResCode); FTP_SetResponseError(nResCode);
} }
lend: lend:
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
{ {
INTERNET_ASYNC_RESULT iar; INTERNET_ASYNC_RESULT iar;
...@@ -1271,7 +1271,7 @@ lend: ...@@ -1271,7 +1271,7 @@ lend:
BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory) BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hFtpSession ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hFtpSession );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -1280,7 +1280,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory) ...@@ -1280,7 +1280,7 @@ BOOL WINAPI FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory)
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -1314,7 +1314,7 @@ BOOL FTP_FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory) ...@@ -1314,7 +1314,7 @@ BOOL FTP_FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory)
{ {
INT nResCode; INT nResCode;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
TRACE("\n"); TRACE("\n");
...@@ -1343,7 +1343,7 @@ BOOL FTP_FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory) ...@@ -1343,7 +1343,7 @@ BOOL FTP_FtpRemoveDirectoryA(HINTERNET hFtpSession, LPCSTR lpszDirectory)
} }
lend: lend:
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
{ {
INTERNET_ASYNC_RESULT iar; INTERNET_ASYNC_RESULT iar;
...@@ -1371,7 +1371,7 @@ lend: ...@@ -1371,7 +1371,7 @@ lend:
BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest) BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest)
{ {
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hFtpSession ); lpwfs = (LPWININETFTPSESSIONA) WININET_GetObject( hFtpSession );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype) if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
...@@ -1380,7 +1380,7 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes ...@@ -1380,7 +1380,7 @@ BOOL WINAPI FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDes
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
{ {
WORKREQUEST workRequest; WORKREQUEST workRequest;
...@@ -1414,7 +1414,7 @@ BOOL FTP_FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest) ...@@ -1414,7 +1414,7 @@ BOOL FTP_FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest)
{ {
INT nResCode; INT nResCode;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFTPSESSIONA lpwfs; LPWININETFTPSESSIONA lpwfs;
TRACE("\n"); TRACE("\n");
...@@ -1449,7 +1449,7 @@ BOOL FTP_FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest) ...@@ -1449,7 +1449,7 @@ BOOL FTP_FtpRenameFileA(HINTERNET hFtpSession, LPCSTR lpszSrc, LPCSTR lpszDest)
FTP_SetResponseError(nResCode); FTP_SetResponseError(nResCode);
lend: lend:
hIC = (LPWININETAPPINFOA) lpwfs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwfs->hdr.lpwhparent;
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB) if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC && hIC->lpfnStatusCB)
{ {
INTERNET_ASYNC_RESULT iar; INTERNET_ASYNC_RESULT iar;
...@@ -1482,7 +1482,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, ...@@ -1482,7 +1482,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
struct sockaddr_in socketAddr; struct sockaddr_in socketAddr;
struct hostent *phe = NULL; struct hostent *phe = NULL;
INT nsocket = -1, sock_namelen; INT nsocket = -1, sock_namelen;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETFTPSESSIONA lpwfs = NULL; LPWININETFTPSESSIONA lpwfs = NULL;
HINTERNET handle = NULL; HINTERNET handle = NULL;
...@@ -1491,7 +1491,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, ...@@ -1491,7 +1491,7 @@ HINTERNET FTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
(ULONG) hInternet, lpszServerName, (ULONG) hInternet, lpszServerName,
nServerPort, lpszUserName, lpszPassword); nServerPort, lpszUserName, lpszPassword);
hIC = (LPWININETAPPINFOA) WININET_GetObject( hInternet ); hIC = (LPWININETAPPINFOW) WININET_GetObject( hInternet );
if ( (hIC == NULL) || (hIC->hdr.htype != WH_HINIT) ) if ( (hIC == NULL) || (hIC->hdr.htype != WH_HINIT) )
goto lerror; goto lerror;
......
...@@ -205,7 +205,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, ...@@ -205,7 +205,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession,
DWORD dwFlags, DWORD dwContext) DWORD dwFlags, DWORD dwContext)
{ {
LPWININETHTTPSESSIONA lpwhs; LPWININETHTTPSESSIONA lpwhs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
HINTERNET handle = NULL; HINTERNET handle = NULL;
TRACE("(%p, %s, %s, %s, %s, %p, %08lx, %08lx)\n", hHttpSession, TRACE("(%p, %s, %s, %s, %s, %p, %08lx, %08lx)\n", hHttpSession,
...@@ -225,7 +225,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, ...@@ -225,7 +225,7 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession,
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
return NULL; return NULL;
} }
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
/* /*
* My tests seem to show that the windows version does not * My tests seem to show that the windows version does not
...@@ -381,7 +381,7 @@ end: ...@@ -381,7 +381,7 @@ end:
/*********************************************************************** /***********************************************************************
* HTTP_Base64 * HTTP_Base64
*/ */
static UINT HTTP_Base64( LPCSTR bin, LPSTR base64 ) static UINT HTTP_Base64( LPCWSTR bin, LPWSTR base64 )
{ {
UINT n = 0, x; UINT n = 0, x;
static LPSTR HTTP_Base64Enc = static LPSTR HTTP_Base64Enc =
...@@ -426,26 +426,28 @@ static UINT HTTP_Base64( LPCSTR bin, LPSTR base64 ) ...@@ -426,26 +426,28 @@ static UINT HTTP_Base64( LPCSTR bin, LPSTR base64 )
* *
* Encode the basic authentication string for HTTP 1.1 * Encode the basic authentication string for HTTP 1.1
*/ */
static LPSTR HTTP_EncodeBasicAuth( LPCSTR username, LPCSTR password) static LPWSTR HTTP_EncodeBasicAuth( LPCWSTR username, LPCWSTR password)
{ {
UINT len; UINT len;
LPSTR in, out, szBasic = "Basic "; LPWSTR in, out;
WCHAR szBasic[] = {'B','a','s','i','c',' ',0};
WCHAR szColon[] = {':',0};
len = strlen( username ) + 1 + strlen ( password ) + 1; len = lstrlenW( username ) + 1 + lstrlenW ( password ) + 1;
in = HeapAlloc( GetProcessHeap(), 0, len ); in = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if( !in ) if( !in )
return NULL; return NULL;
len = strlen(szBasic) + len = lstrlenW(szBasic) +
(strlen( username ) + 1 + strlen ( password ))*2 + 1 + 1; (lstrlenW( username ) + 1 + lstrlenW ( password ))*2 + 1 + 1;
out = HeapAlloc( GetProcessHeap(), 0, len ); out = HeapAlloc( GetProcessHeap(), 0, len );
if( out ) if( out )
{ {
strcpy( in, username ); lstrcpyW( in, username );
strcat( in, ":" ); lstrcatW( in, szColon );
strcat( in, password ); lstrcatW( in, password );
strcpy( out, szBasic ); lstrcpyW( out, szBasic );
HTTP_Base64( in, &out[strlen(out)] ); HTTP_Base64( in, &out[strlenW(out)] );
} }
HeapFree( GetProcessHeap(), 0, in ); HeapFree( GetProcessHeap(), 0, in );
...@@ -458,13 +460,19 @@ static LPSTR HTTP_EncodeBasicAuth( LPCSTR username, LPCSTR password) ...@@ -458,13 +460,19 @@ static LPSTR HTTP_EncodeBasicAuth( LPCSTR username, LPCSTR password)
* Insert the basic authorization field in the request header * Insert the basic authorization field in the request header
*/ */
BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQA lpwhr, BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQA lpwhr,
LPCSTR username, LPCSTR password ) LPCWSTR username, LPCWSTR password )
{ {
HTTPHEADERA hdr; HTTPHEADERA hdr;
INT index; INT index, len;
LPWSTR authW;
authW = HTTP_EncodeBasicAuth( username, password );
len = WideCharToMultiByte( CP_ACP, 0, authW, -1, NULL, 0, NULL, NULL);
hdr.lpszValue = HeapAlloc( GetProcessHeap(), 0, len );
WideCharToMultiByte( CP_ACP, 0, authW, -1, hdr.lpszValue, len, NULL, NULL);
hdr.lpszField = "Proxy-Authorization"; hdr.lpszField = "Proxy-Authorization";
hdr.lpszValue = HTTP_EncodeBasicAuth( username, password );
hdr.wFlags = HDR_ISREQUEST; hdr.wFlags = HDR_ISREQUEST;
hdr.wCount = 0; hdr.wCount = 0;
if( !hdr.lpszValue ) if( !hdr.lpszValue )
...@@ -480,6 +488,7 @@ BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQA lpwhr, ...@@ -480,6 +488,7 @@ BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQA lpwhr,
HTTP_InsertCustomHeader(lpwhr, &hdr); HTTP_InsertCustomHeader(lpwhr, &hdr);
HeapFree( GetProcessHeap(), 0, hdr.lpszValue ); HeapFree( GetProcessHeap(), 0, hdr.lpszValue );
HeapFree( GetProcessHeap(), 0, authW );
return TRUE; return TRUE;
} }
...@@ -487,7 +496,7 @@ BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQA lpwhr, ...@@ -487,7 +496,7 @@ BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQA lpwhr,
/*********************************************************************** /***********************************************************************
* HTTP_DealWithProxy * HTTP_DealWithProxy
*/ */
static BOOL HTTP_DealWithProxy( LPWININETAPPINFOA hIC, static BOOL HTTP_DealWithProxy( LPWININETAPPINFOW hIC,
LPWININETHTTPSESSIONA lpwhs, LPWININETHTTPREQA lpwhr) LPWININETHTTPSESSIONA lpwhs, LPWININETHTTPREQA lpwhr)
{ {
char buf[MAXHOSTNAME]; char buf[MAXHOSTNAME];
...@@ -500,10 +509,11 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOA hIC, ...@@ -500,10 +509,11 @@ static BOOL HTTP_DealWithProxy( LPWININETAPPINFOA hIC,
UrlComponents.lpszHostName = buf; UrlComponents.lpszHostName = buf;
UrlComponents.dwHostNameLength = MAXHOSTNAME; UrlComponents.dwHostNameLength = MAXHOSTNAME;
if (strncasecmp(hIC->lpszProxy,"http://",strlen("http://"))) WideCharToMultiByte(CP_ACP, 0, hIC->lpszProxy, -1, buf, sizeof buf, NULL, NULL);
sprintf(proxy, "http://%s/", hIC->lpszProxy); if (strncasecmp(buf,"http://",strlen("http://")))
sprintf(proxy, "http://%s/", buf);
else else
strcpy(proxy,hIC->lpszProxy); strcpy(proxy,buf);
if( !InternetCrackUrlA(proxy, 0, 0, &UrlComponents) ) if( !InternetCrackUrlA(proxy, 0, 0, &UrlComponents) )
return FALSE; return FALSE;
if( UrlComponents.dwHostNameLength == 0 ) if( UrlComponents.dwHostNameLength == 0 )
...@@ -551,7 +561,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, ...@@ -551,7 +561,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
DWORD dwFlags, DWORD dwContext) DWORD dwFlags, DWORD dwContext)
{ {
LPWININETHTTPSESSIONA lpwhs; LPWININETHTTPSESSIONA lpwhs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETHTTPREQA lpwhr; LPWININETHTTPREQA lpwhr;
LPSTR lpszCookies; LPSTR lpszCookies;
LPSTR lpszUrl = NULL; LPSTR lpszUrl = NULL;
...@@ -567,7 +577,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, ...@@ -567,7 +577,7 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
return NULL; return NULL;
} }
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
lpwhr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WININETHTTPREQA)); lpwhr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WININETHTTPREQA));
if (NULL == lpwhr) if (NULL == lpwhr)
...@@ -641,8 +651,16 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, ...@@ -641,8 +651,16 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
if (hIC->lpszAgent) if (hIC->lpszAgent)
{ {
char *agent_header = HeapAlloc(GetProcessHeap(), 0, strlen(hIC->lpszAgent) + 1 + 14); int len = WideCharToMultiByte(CP_ACP, 0, hIC->lpszAgent, -1, NULL, 0, NULL, NULL );
sprintf(agent_header, "User-Agent: %s\r\n", hIC->lpszAgent); char *agent_header, *user_agent = "User-Agent: ";
agent_header = HeapAlloc( GetProcessHeap(), 0,
strlen(user_agent) + len + 3 );
strcpy(agent_header, user_agent);
WideCharToMultiByte(CP_ACP, 0, hIC->lpszAgent, -1,
agent_header+strlen(user_agent), len, NULL, NULL );
strcat(agent_header, "\r\n");
HttpAddRequestHeadersA(handle, agent_header, strlen(agent_header), HttpAddRequestHeadersA(handle, agent_header, strlen(agent_header),
HTTP_ADDREQ_FLAG_ADD); HTTP_ADDREQ_FLAG_ADD);
HeapFree(GetProcessHeap(), 0, agent_header); HeapFree(GetProcessHeap(), 0, agent_header);
...@@ -1071,7 +1089,7 @@ BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, ...@@ -1071,7 +1089,7 @@ BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
{ {
LPWININETHTTPREQA lpwhr; LPWININETHTTPREQA lpwhr;
LPWININETHTTPSESSIONA lpwhs = NULL; LPWININETHTTPSESSIONA lpwhs = NULL;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
TRACE("%p, %p (%s), %li, %p, %li)\n", hHttpRequest, TRACE("%p, %p (%s), %li, %p, %li)\n", hHttpRequest,
lpszHeaders, debugstr_a(lpszHeaders), dwHeaderLength, lpOptional, dwOptionalLength); lpszHeaders, debugstr_a(lpszHeaders), dwHeaderLength, lpOptional, dwOptionalLength);
...@@ -1090,7 +1108,7 @@ BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, ...@@ -1090,7 +1108,7 @@ BOOL WINAPI HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
if (NULL == hIC || hIC->hdr.htype != WH_HINIT) if (NULL == hIC || hIC->hdr.htype != WH_HINIT)
{ {
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
...@@ -1162,7 +1180,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQA lpwhr, LPCSTR lpszUrl, LPCSTR ...@@ -1162,7 +1180,7 @@ static BOOL HTTP_HandleRedirect(LPWININETHTTPREQA lpwhr, LPCSTR lpszUrl, LPCSTR
DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength) DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength)
{ {
LPWININETHTTPSESSIONA lpwhs = (LPWININETHTTPSESSIONA) lpwhr->hdr.lpwhparent; LPWININETHTTPSESSIONA lpwhs = (LPWININETHTTPSESSIONA) lpwhr->hdr.lpwhparent;
LPWININETAPPINFOA hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; LPWININETAPPINFOW hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
char path[2048]; char path[2048];
HINTERNET handle; HINTERNET handle;
...@@ -1295,7 +1313,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, ...@@ -1295,7 +1313,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
INT headerLength = 0; INT headerLength = 0;
LPWININETHTTPREQA lpwhr; LPWININETHTTPREQA lpwhr;
LPWININETHTTPSESSIONA lpwhs = NULL; LPWININETHTTPSESSIONA lpwhs = NULL;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
BOOL loop_next = FALSE; BOOL loop_next = FALSE;
int CustHeaderIndex; int CustHeaderIndex;
...@@ -1316,7 +1334,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders, ...@@ -1316,7 +1334,7 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
return FALSE; return FALSE;
} }
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
if (NULL == hIC || hIC->hdr.htype != WH_HINIT) if (NULL == hIC || hIC->hdr.htype != WH_HINIT)
{ {
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
...@@ -1689,13 +1707,13 @@ HINTERNET HTTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, ...@@ -1689,13 +1707,13 @@ HINTERNET HTTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext) LPCSTR lpszPassword, DWORD dwFlags, DWORD dwContext)
{ {
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETHTTPSESSIONA lpwhs = NULL; LPWININETHTTPSESSIONA lpwhs = NULL;
HINTERNET handle = NULL; HINTERNET handle = NULL;
TRACE("-->\n"); TRACE("-->\n");
hIC = (LPWININETAPPINFOA) WININET_GetObject( hInternet ); hIC = (LPWININETAPPINFOW) WININET_GetObject( hInternet );
if( (hIC == NULL) || (hIC->hdr.htype != WH_HINIT) ) if( (hIC == NULL) || (hIC->hdr.htype != WH_HINIT) )
goto lerror; goto lerror;
...@@ -1728,7 +1746,7 @@ HINTERNET HTTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName, ...@@ -1728,7 +1746,7 @@ HINTERNET HTTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
lpwhs->hdr.dwFlags = dwFlags; lpwhs->hdr.dwFlags = dwFlags;
lpwhs->hdr.dwContext = dwContext; lpwhs->hdr.dwContext = dwContext;
if(hIC->lpszProxy && hIC->dwAccessType == INTERNET_OPEN_TYPE_PROXY) { if(hIC->lpszProxy && hIC->dwAccessType == INTERNET_OPEN_TYPE_PROXY) {
if(strchr(hIC->lpszProxy, ' ')) if(strchrW(hIC->lpszProxy, ' '))
FIXME("Several proxies not implemented.\n"); FIXME("Several proxies not implemented.\n");
if(hIC->lpszProxyBypass) if(hIC->lpszProxyBypass)
FIXME("Proxy bypass is ignored.\n"); FIXME("Proxy bypass is ignored.\n");
...@@ -1785,7 +1803,7 @@ BOOL HTTP_OpenConnection(LPWININETHTTPREQA lpwhr) ...@@ -1785,7 +1803,7 @@ BOOL HTTP_OpenConnection(LPWININETHTTPREQA lpwhr)
{ {
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
LPWININETHTTPSESSIONA lpwhs; LPWININETHTTPSESSIONA lpwhs;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
TRACE("-->\n"); TRACE("-->\n");
...@@ -1798,7 +1816,7 @@ BOOL HTTP_OpenConnection(LPWININETHTTPREQA lpwhr) ...@@ -1798,7 +1816,7 @@ BOOL HTTP_OpenConnection(LPWININETHTTPREQA lpwhr)
lpwhs = (LPWININETHTTPSESSIONA)lpwhr->hdr.lpwhparent; lpwhs = (LPWININETHTTPSESSIONA)lpwhr->hdr.lpwhparent;
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
SendAsyncCallback(hIC, lpwhr, lpwhr->hdr.dwContext, SendAsyncCallback(hIC, lpwhr, lpwhr->hdr.dwContext,
INTERNET_STATUS_CONNECTING_TO_SERVER, INTERNET_STATUS_CONNECTING_TO_SERVER,
&(lpwhs->socketAddress), &(lpwhs->socketAddress),
...@@ -2202,14 +2220,14 @@ VOID HTTP_CloseConnection(LPWININETHTTPREQA lpwhr) ...@@ -2202,14 +2220,14 @@ VOID HTTP_CloseConnection(LPWININETHTTPREQA lpwhr)
LPWININETHTTPSESSIONA lpwhs = NULL; LPWININETHTTPSESSIONA lpwhs = NULL;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
HINTERNET handle; HINTERNET handle;
TRACE("%p\n",lpwhr); TRACE("%p\n",lpwhr);
handle = WININET_FindHandle( &lpwhr->hdr ); handle = WININET_FindHandle( &lpwhr->hdr );
lpwhs = (LPWININETHTTPSESSIONA) lpwhr->hdr.lpwhparent; lpwhs = (LPWININETHTTPSESSIONA) lpwhr->hdr.lpwhparent;
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
SendAsyncCallback(hIC, lpwhr, lpwhr->hdr.dwContext, SendAsyncCallback(hIC, lpwhr, lpwhr->hdr.dwContext,
INTERNET_STATUS_CLOSING_CONNECTION, 0, 0); INTERNET_STATUS_CLOSING_CONNECTION, 0, 0);
...@@ -2234,7 +2252,7 @@ void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr) ...@@ -2234,7 +2252,7 @@ void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr)
{ {
int i; int i;
LPWININETHTTPSESSIONA lpwhs = NULL; LPWININETHTTPSESSIONA lpwhs = NULL;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
HINTERNET handle; HINTERNET handle;
TRACE("\n"); TRACE("\n");
...@@ -2244,7 +2262,7 @@ void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr) ...@@ -2244,7 +2262,7 @@ void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr)
handle = WININET_FindHandle( &lpwhr->hdr ); handle = WININET_FindHandle( &lpwhr->hdr );
lpwhs = (LPWININETHTTPSESSIONA) lpwhr->hdr.lpwhparent; lpwhs = (LPWININETHTTPSESSIONA) lpwhr->hdr.lpwhparent;
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
SendAsyncCallback(hIC, handle, lpwhr->hdr.dwContext, SendAsyncCallback(hIC, handle, lpwhr->hdr.dwContext,
INTERNET_STATUS_HANDLE_CLOSING, lpwhr, INTERNET_STATUS_HANDLE_CLOSING, lpwhr,
...@@ -2286,12 +2304,12 @@ void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr) ...@@ -2286,12 +2304,12 @@ void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr)
*/ */
void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONA lpwhs) void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONA lpwhs)
{ {
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
HINTERNET handle; HINTERNET handle;
TRACE("%p\n", lpwhs); TRACE("%p\n", lpwhs);
hIC = (LPWININETAPPINFOA) lpwhs->hdr.lpwhparent; hIC = (LPWININETAPPINFOW) lpwhs->hdr.lpwhparent;
handle = WININET_FindHandle( &lpwhs->hdr ); handle = WININET_FindHandle( &lpwhs->hdr );
SendAsyncCallback(hIC, handle, lpwhs->hdr.dwContext, SendAsyncCallback(hIC, handle, lpwhs->hdr.dwContext,
......
...@@ -72,7 +72,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet); ...@@ -72,7 +72,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet);
#define RESPONSE_TIMEOUT 30 #define RESPONSE_TIMEOUT 30
#define GET_HWININET_FROM_LPWININETFINDNEXT(lpwh) \ #define GET_HWININET_FROM_LPWININETFINDNEXT(lpwh) \
(LPWININETAPPINFOA)(((LPWININETFTPSESSIONA)(lpwh->hdr.lpwhparent))->hdr.lpwhparent) (LPWININETAPPINFOW)(((LPWININETFTPSESSIONA)(lpwh->hdr.lpwhparent))->hdr.lpwhparent)
typedef struct typedef struct
...@@ -336,12 +336,13 @@ BOOL WINAPI DetectAutoProxyUrl(LPSTR lpszAutoProxyUrl, ...@@ -336,12 +336,13 @@ BOOL WINAPI DetectAutoProxyUrl(LPSTR lpszAutoProxyUrl,
* The proxy may be specified in the form 'http=proxy.my.org' * The proxy may be specified in the form 'http=proxy.my.org'
* Presumably that means there can be ftp=ftpproxy.my.org too. * Presumably that means there can be ftp=ftpproxy.my.org too.
*/ */
static BOOL INTERNET_ConfigureProxyFromReg( LPWININETAPPINFOA lpwai ) static BOOL INTERNET_ConfigureProxyFromReg( LPWININETAPPINFOW lpwai )
{ {
HKEY key; HKEY key;
DWORD r, keytype, len, enabled; DWORD r, keytype, len, enabled;
LPSTR lpszInternetSettings = LPSTR lpszInternetSettings =
"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"; "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings";
WCHAR szProxyServer[] = { 'P','r','o','x','y','S','e','r','v','e','r', 0 };
r = RegOpenKeyA(HKEY_CURRENT_USER, lpszInternetSettings, &key); r = RegOpenKeyA(HKEY_CURRENT_USER, lpszInternetSettings, &key);
if ( r != ERROR_SUCCESS ) if ( r != ERROR_SUCCESS )
...@@ -355,31 +356,32 @@ static BOOL INTERNET_ConfigureProxyFromReg( LPWININETAPPINFOA lpwai ) ...@@ -355,31 +356,32 @@ static BOOL INTERNET_ConfigureProxyFromReg( LPWININETAPPINFOA lpwai )
TRACE("Proxy is enabled.\n"); TRACE("Proxy is enabled.\n");
/* figure out how much memory the proxy setting takes */ /* figure out how much memory the proxy setting takes */
r = RegQueryValueExA( key, "ProxyServer", NULL, &keytype, r = RegQueryValueExW( key, szProxyServer, NULL, &keytype,
NULL, &len); NULL, &len);
if( (r == ERROR_SUCCESS) && len && (keytype == REG_SZ) ) if( (r == ERROR_SUCCESS) && len && (keytype == REG_SZ) )
{ {
LPSTR szProxy, p, szHttp = "http="; LPWSTR szProxy, p;
WCHAR szHttp[] = {'h','t','t','p','=',0};
szProxy=HeapAlloc( GetProcessHeap(), 0, len+1 ); szProxy=HeapAlloc( GetProcessHeap(), 0, len );
RegQueryValueExA( key, "ProxyServer", NULL, &keytype, RegQueryValueExW( key, szProxyServer, NULL, &keytype,
(BYTE*)szProxy, &len); (BYTE*)szProxy, &len);
/* find the http proxy, and strip away everything else */ /* find the http proxy, and strip away everything else */
p = strstr( szProxy, szHttp ); p = strstrW( szProxy, szHttp );
if( p ) if( p )
{ {
p += strlen(szHttp); p += lstrlenW(szHttp);
strcpy( szProxy, p ); lstrcpyW( szProxy, p );
} }
p = strchr( szProxy, ' ' ); p = strchrW( szProxy, ' ' );
if( p ) if( p )
*p = 0; *p = 0;
lpwai->dwAccessType = INTERNET_OPEN_TYPE_PROXY; lpwai->dwAccessType = INTERNET_OPEN_TYPE_PROXY;
lpwai->lpszProxy = szProxy; lpwai->lpszProxy = szProxy;
TRACE("http proxy = %s\n", lpwai->lpszProxy); TRACE("http proxy = %s\n", debugstr_w(lpwai->lpszProxy));
} }
else else
ERR("Couldn't read proxy server settings.\n"); ERR("Couldn't read proxy server settings.\n");
...@@ -401,10 +403,10 @@ static BOOL INTERNET_ConfigureProxyFromReg( LPWININETAPPINFOA lpwai ) ...@@ -401,10 +403,10 @@ static BOOL INTERNET_ConfigureProxyFromReg( LPWININETAPPINFOA lpwai )
* NULL on failure * NULL on failure
* *
*/ */
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType,
LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags) LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
{ {
LPWININETAPPINFOA lpwai = NULL; LPWININETAPPINFOW lpwai = NULL;
HINTERNET handle = NULL; HINTERNET handle = NULL;
if (TRACE_ON(wininet)) { if (TRACE_ON(wininet)) {
...@@ -425,8 +427,8 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, ...@@ -425,8 +427,8 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
const char *access_type_str = "Unknown"; const char *access_type_str = "Unknown";
DWORD flag_val = dwFlags; DWORD flag_val = dwFlags;
TRACE("(%s, %li, %s, %s, %li)\n", debugstr_a(lpszAgent), dwAccessType, TRACE("(%s, %li, %s, %s, %li)\n", debugstr_w(lpszAgent), dwAccessType,
debugstr_a(lpszProxy), debugstr_a(lpszProxyBypass), dwFlags); debugstr_w(lpszProxy), debugstr_w(lpszProxyBypass), dwFlags);
for (i = 0; i < (sizeof(access_type) / sizeof(access_type[0])); i++) { for (i = 0; i < (sizeof(access_type) / sizeof(access_type[0])); i++) {
if (access_type[i].val == dwAccessType) { if (access_type[i].val == dwAccessType) {
access_type_str = access_type[i].name; access_type_str = access_type[i].name;
...@@ -448,14 +450,14 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, ...@@ -448,14 +450,14 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
/* Clear any error information */ /* Clear any error information */
INTERNET_SetLastError(0); INTERNET_SetLastError(0);
lpwai = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETAPPINFOA)); lpwai = HeapAlloc(GetProcessHeap(), 0, sizeof(WININETAPPINFOW));
if (NULL == lpwai) if (NULL == lpwai)
{ {
INTERNET_SetLastError(ERROR_OUTOFMEMORY); INTERNET_SetLastError(ERROR_OUTOFMEMORY);
goto lend; goto lend;
} }
memset(lpwai, 0, sizeof(WININETAPPINFOA)); memset(lpwai, 0, sizeof(WININETAPPINFOW));
lpwai->hdr.htype = WH_HINIT; lpwai->hdr.htype = WH_HINIT;
lpwai->hdr.lpwhparent = NULL; lpwai->hdr.lpwhparent = NULL;
lpwai->hdr.dwFlags = dwFlags; lpwai->hdr.dwFlags = dwFlags;
...@@ -474,26 +476,26 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, ...@@ -474,26 +476,26 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
if (NULL != lpszAgent) if (NULL != lpszAgent)
{ {
lpwai->lpszAgent = HeapAlloc( GetProcessHeap(),0, lpwai->lpszAgent = HeapAlloc( GetProcessHeap(),0,
strlen(lpszAgent)+1); (strlenW(lpszAgent)+1)*sizeof(WCHAR));
if (lpwai->lpszAgent) if (lpwai->lpszAgent)
strcpy( lpwai->lpszAgent, lpszAgent ); lstrcpyW( lpwai->lpszAgent, lpszAgent );
} }
if(dwAccessType == INTERNET_OPEN_TYPE_PRECONFIG) if(dwAccessType == INTERNET_OPEN_TYPE_PRECONFIG)
INTERNET_ConfigureProxyFromReg( lpwai ); INTERNET_ConfigureProxyFromReg( lpwai );
else if (NULL != lpszProxy) else if (NULL != lpszProxy)
{ {
lpwai->lpszProxy = HeapAlloc( GetProcessHeap(), 0, lpwai->lpszProxy = HeapAlloc( GetProcessHeap(), 0,
strlen(lpszProxy)+1); (strlenW(lpszProxy)+1)*sizeof(WCHAR));
if (lpwai->lpszProxy) if (lpwai->lpszProxy)
strcpy( lpwai->lpszProxy, lpszProxy ); lstrcpyW( lpwai->lpszProxy, lpszProxy );
} }
if (NULL != lpszProxyBypass) if (NULL != lpszProxyBypass)
{ {
lpwai->lpszProxyBypass = HeapAlloc( GetProcessHeap(), 0, lpwai->lpszProxyBypass = HeapAlloc( GetProcessHeap(), 0,
strlen(lpszProxyBypass)+1); (strlenW(lpszProxyBypass)+1)*sizeof(WCHAR));
if (lpwai->lpszProxyBypass) if (lpwai->lpszProxyBypass)
strcpy( lpwai->lpszProxyBypass, lpszProxyBypass ); lstrcpyW( lpwai->lpszProxyBypass, lpszProxyBypass );
} }
lend: lend:
...@@ -513,41 +515,44 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType, ...@@ -513,41 +515,44 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
* NULL on failure * NULL on failure
* *
*/ */
HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType, HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags) LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
{ {
HINTERNET rc = (HINTERNET)NULL; HINTERNET rc = (HINTERNET)NULL;
INT lenAgent = WideCharToMultiByte(CP_ACP, 0, lpszAgent, -1, NULL, 0, NULL, NULL); INT len;
INT lenProxy = WideCharToMultiByte(CP_ACP, 0, lpszProxy, -1, NULL, 0, NULL, NULL); WCHAR *szAgent = NULL, *szProxy = NULL, *szBypass = NULL;
INT lenBypass = WideCharToMultiByte(CP_ACP, 0, lpszProxyBypass, -1, NULL, 0, NULL, NULL);
CHAR *szAgent = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenAgent*sizeof(CHAR));
CHAR *szProxy = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenProxy*sizeof(CHAR));
CHAR *szBypass = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenBypass*sizeof(CHAR));
TRACE("(%s, 0x%08lx, %s, %s, 0x%08lx)\n", debugstr_w(lpszAgent), dwAccessType, debugstr_w(lpszProxy), debugstr_w(lpszProxyBypass), dwFlags); TRACE("(%s, 0x%08lx, %s, %s, 0x%08lx)\n", debugstr_a(lpszAgent),
dwAccessType, debugstr_a(lpszProxy), debugstr_a(lpszProxyBypass), dwFlags);
if (!szAgent || !szProxy || !szBypass) if( lpszAgent )
{ {
if (szAgent) len = MultiByteToWideChar(CP_ACP, 0, lpszAgent, -1, NULL, 0);
HeapFree(GetProcessHeap(), 0, szAgent); szAgent = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
if (szProxy) MultiByteToWideChar(CP_ACP, 0, lpszAgent, -1, szAgent, len);
HeapFree(GetProcessHeap(), 0, szProxy);
if (szBypass)
HeapFree(GetProcessHeap(), 0, szBypass);
return (HINTERNET)NULL;
} }
WideCharToMultiByte(CP_ACP, 0, lpszAgent, -1, szAgent, lenAgent, if( lpszProxy )
NULL, NULL); {
WideCharToMultiByte(CP_ACP, 0, lpszProxy, -1, szProxy, lenProxy, len = MultiByteToWideChar(CP_ACP, 0, lpszProxy, -1, NULL, 0);
NULL, NULL); szProxy = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
WideCharToMultiByte(CP_ACP, 0, lpszProxyBypass, -1, szBypass, lenBypass, MultiByteToWideChar(CP_ACP, 0, lpszProxy, -1, szProxy, len);
NULL, NULL); }
if( lpszProxyBypass )
{
len = MultiByteToWideChar(CP_ACP, 0, lpszProxyBypass, -1, NULL, 0);
szBypass = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpszProxyBypass, -1, szBypass, len);
}
rc = InternetOpenA(szAgent, dwAccessType, szProxy, szBypass, dwFlags); rc = InternetOpenW(szAgent, dwAccessType, szProxy, szBypass, dwFlags);
if( szAgent )
HeapFree(GetProcessHeap(), 0, szAgent); HeapFree(GetProcessHeap(), 0, szAgent);
if( szProxy )
HeapFree(GetProcessHeap(), 0, szProxy); HeapFree(GetProcessHeap(), 0, szProxy);
if( szBypass )
HeapFree(GetProcessHeap(), 0, szBypass); HeapFree(GetProcessHeap(), 0, szBypass);
return rc; return rc;
...@@ -749,7 +754,7 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet, ...@@ -749,7 +754,7 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
*/ */
BOOL WINAPI InternetFindNextFileA(HINTERNET hFind, LPVOID lpvFindData) BOOL WINAPI InternetFindNextFileA(HINTERNET hFind, LPVOID lpvFindData)
{ {
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWININETFINDNEXTA lpwh; LPWININETFINDNEXTA lpwh;
TRACE("\n"); TRACE("\n");
...@@ -794,7 +799,7 @@ BOOL WINAPI InternetFindNextFileA(HINTERNET hFind, LPVOID lpvFindData) ...@@ -794,7 +799,7 @@ BOOL WINAPI InternetFindNextFileA(HINTERNET hFind, LPVOID lpvFindData)
BOOL WINAPI INTERNET_FindNextFileA(HINTERNET hFind, LPVOID lpvFindData) BOOL WINAPI INTERNET_FindNextFileA(HINTERNET hFind, LPVOID lpvFindData)
{ {
BOOL bSuccess = TRUE; BOOL bSuccess = TRUE;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
LPWIN32_FIND_DATAA lpFindFileData; LPWIN32_FIND_DATAA lpFindFileData;
LPWININETFINDNEXTA lpwh; LPWININETFINDNEXTA lpwh;
...@@ -863,7 +868,7 @@ lend: ...@@ -863,7 +868,7 @@ lend:
* Void * Void
* *
*/ */
VOID INTERNET_CloseHandle(LPWININETAPPINFOA lpwai) VOID INTERNET_CloseHandle(LPWININETAPPINFOW lpwai)
{ {
TRACE("%p\n",lpwai); TRACE("%p\n",lpwai);
...@@ -921,7 +926,7 @@ BOOL WINAPI InternetCloseHandle(HINTERNET hInternet) ...@@ -921,7 +926,7 @@ BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
switch (lpwh->htype) switch (lpwh->htype)
{ {
case WH_HINIT: case WH_HINIT:
INTERNET_CloseHandle((LPWININETAPPINFOA) lpwh); INTERNET_CloseHandle((LPWININETAPPINFOW) lpwh);
retval = TRUE; retval = TRUE;
break; break;
...@@ -1461,9 +1466,9 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA( ...@@ -1461,9 +1466,9 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA(
HINTERNET hInternet ,INTERNET_STATUS_CALLBACK lpfnIntCB) HINTERNET hInternet ,INTERNET_STATUS_CALLBACK lpfnIntCB)
{ {
INTERNET_STATUS_CALLBACK retVal; INTERNET_STATUS_CALLBACK retVal;
LPWININETAPPINFOA lpwai; LPWININETAPPINFOW lpwai;
lpwai = (LPWININETAPPINFOA)WININET_GetObject(hInternet); lpwai = (LPWININETAPPINFOW)WININET_GetObject(hInternet);
if (!lpwai) if (!lpwai)
return NULL; return NULL;
...@@ -2126,12 +2131,12 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl, ...@@ -2126,12 +2131,12 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD dwContext) LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD dwContext)
{ {
HINTERNET ret = NULL; HINTERNET ret = NULL;
LPWININETAPPINFOA hIC = NULL; LPWININETAPPINFOW hIC = NULL;
TRACE("(%p, %s, %s, %08lx, %08lx, %08lx\n", hInternet, debugstr_a(lpszUrl), debugstr_a(lpszHeaders), TRACE("(%p, %s, %s, %08lx, %08lx, %08lx\n", hInternet, debugstr_a(lpszUrl), debugstr_a(lpszHeaders),
dwHeadersLength, dwFlags, dwContext); dwHeadersLength, dwFlags, dwContext);
hIC = (LPWININETAPPINFOA) WININET_GetObject( hInternet ); hIC = (LPWININETAPPINFOW) WININET_GetObject( hInternet );
if (NULL == hIC || hIC->hdr.htype != WH_HINIT) { if (NULL == hIC || hIC->hdr.htype != WH_HINIT) {
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
goto lend; goto lend;
......
...@@ -85,14 +85,14 @@ typedef struct _WININETHANDLEHEADER ...@@ -85,14 +85,14 @@ typedef struct _WININETHANDLEHEADER
typedef struct typedef struct
{ {
WININETHANDLEHEADER hdr; WININETHANDLEHEADER hdr;
LPSTR lpszAgent; LPWSTR lpszAgent;
LPSTR lpszProxy; LPWSTR lpszProxy;
LPSTR lpszProxyBypass; LPWSTR lpszProxyBypass;
LPSTR lpszProxyUsername; LPWSTR lpszProxyUsername;
LPSTR lpszProxyPassword; LPWSTR lpszProxyPassword;
DWORD dwAccessType; DWORD dwAccessType;
INTERNET_STATUS_CALLBACK lpfnStatusCB; INTERNET_STATUS_CALLBACK lpfnStatusCB;
} WININETAPPINFOA, *LPWININETAPPINFOA; } WININETAPPINFOW, *LPWININETAPPINFOW;
typedef struct typedef struct
...@@ -382,16 +382,16 @@ INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, ...@@ -382,16 +382,16 @@ INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONA lpwhs); void HTTP_CloseHTTPSessionHandle(LPWININETHTTPSESSIONA lpwhs);
void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr); void HTTP_CloseHTTPRequestHandle(LPWININETHTTPREQA lpwhr);
VOID SendAsyncCallback(LPWININETAPPINFOA hIC, HINTERNET hHttpSession, VOID SendAsyncCallback(LPWININETAPPINFOW hIC, HINTERNET hHttpSession,
DWORD dwContext, DWORD dwInternetStatus, LPVOID DWORD dwContext, DWORD dwInternetStatus, LPVOID
lpvStatusInfo , DWORD dwStatusInfoLength); lpvStatusInfo , DWORD dwStatusInfoLength);
VOID SendAsyncCallbackInt(LPWININETAPPINFOA hIC, HINTERNET hHttpSession, VOID SendAsyncCallbackInt(LPWININETAPPINFOW hIC, HINTERNET hHttpSession,
DWORD dwContext, DWORD dwInternetStatus, LPVOID DWORD dwContext, DWORD dwInternetStatus, LPVOID
lpvStatusInfo , DWORD dwStatusInfoLength); lpvStatusInfo , DWORD dwStatusInfoLength);
BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQA lpwhr, BOOL HTTP_InsertProxyAuthorization( LPWININETHTTPREQA lpwhr,
LPCSTR username, LPCSTR password ); LPCWSTR username, LPCWSTR password );
BOOL NETCON_connected(WININET_NETCONNECTION *connection); BOOL NETCON_connected(WININET_NETCONNECTION *connection);
void NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL); void NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
......
...@@ -212,7 +212,7 @@ static const char *get_callback_name(DWORD dwInternetStatus) { ...@@ -212,7 +212,7 @@ static const char *get_callback_name(DWORD dwInternetStatus) {
return "Unknown"; return "Unknown";
} }
VOID SendAsyncCallbackInt(LPWININETAPPINFOA hIC, HINTERNET hHttpSession, VOID SendAsyncCallbackInt(LPWININETAPPINFOW hIC, HINTERNET hHttpSession,
DWORD dwContext, DWORD dwInternetStatus, LPVOID DWORD dwContext, DWORD dwInternetStatus, LPVOID
lpvStatusInfo, DWORD dwStatusInfoLength) lpvStatusInfo, DWORD dwStatusInfoLength)
{ {
...@@ -234,7 +234,7 @@ VOID SendAsyncCallbackInt(LPWININETAPPINFOA hIC, HINTERNET hHttpSession, ...@@ -234,7 +234,7 @@ VOID SendAsyncCallbackInt(LPWININETAPPINFOA hIC, HINTERNET hHttpSession,
VOID SendAsyncCallback(LPWININETAPPINFOA hIC, HINTERNET hHttpSession, VOID SendAsyncCallback(LPWININETAPPINFOW hIC, HINTERNET hHttpSession,
DWORD dwContext, DWORD dwInternetStatus, LPVOID DWORD dwContext, DWORD dwInternetStatus, LPVOID
lpvStatusInfo, DWORD dwStatusInfoLength) lpvStatusInfo, DWORD dwStatusInfoLength)
{ {
......
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