[WININET]

- Sync to wine 1.3.21
[PSDK]
- Update headers from sync

svn path=/trunk/; revision=52107
This commit is contained in:
Cameron Gutman 2011-06-05 23:11:41 +00:00
parent 9616b43abc
commit 7cfff50f9a
39 changed files with 3637 additions and 2208 deletions

View file

@ -89,7 +89,7 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain);
/* adds a cookie to the domain */
static cookie *COOKIE_addCookie(cookie_domain *domain, LPCWSTR name, LPCWSTR data, FILETIME expiry)
{
cookie *newCookie = HeapAlloc(GetProcessHeap(), 0, sizeof(cookie));
cookie *newCookie = heap_alloc(sizeof(cookie));
list_init(&newCookie->entry);
newCookie->lpCookieName = NULL;
@ -145,7 +145,7 @@ static void COOKIE_deleteCookie(cookie *deadCookie, BOOL deleteDomain)
/* allocates a domain and adds it to the end */
static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path)
{
cookie_domain *newDomain = HeapAlloc(GetProcessHeap(), 0, sizeof(cookie_domain));
cookie_domain *newDomain = heap_alloc(sizeof(cookie_domain));
list_init(&newDomain->entry);
list_init(&newDomain->cookie_list);
@ -260,6 +260,78 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain)
HeapFree(GetProcessHeap(), 0, deadDomain);
}
BOOL get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size)
{
unsigned cnt = 0, len, domain_count = 0, cookie_count = 0;
cookie_domain *domain;
FILETIME tm;
GetSystemTimeAsFileTime(&tm);
LIST_FOR_EACH_ENTRY(domain, &domain_list, cookie_domain, entry) {
struct list *cursor, *cursor2;
if(!COOKIE_matchDomain(host, path, domain, TRUE))
continue;
domain_count++;
TRACE("found domain %p\n", domain);
LIST_FOR_EACH_SAFE(cursor, cursor2, &domain->cookie_list) {
cookie *cookie_iter = LIST_ENTRY(cursor, cookie, entry);
/* check for expiry */
if((cookie_iter->expiry.dwLowDateTime != 0 || cookie_iter->expiry.dwHighDateTime != 0)
&& CompareFileTime(&tm, &cookie_iter->expiry) > 0)
{
TRACE("Found expired cookie. deleting\n");
COOKIE_deleteCookie(cookie_iter, FALSE);
continue;
}
if(!cookie_data) { /* return the size of the buffer required to lpdwSize */
if (cookie_count)
cnt += 2; /* '; ' */
cnt += strlenW(cookie_iter->lpCookieName);
if ((len = strlenW(cookie_iter->lpCookieData))) {
cnt += 1; /* = */
cnt += len;
}
}else {
static const WCHAR szsc[] = { ';',' ',0 };
static const WCHAR szname[] = { '%','s',0 };
static const WCHAR szdata[] = { '=','%','s',0 };
if (cookie_count) cnt += snprintfW(cookie_data + cnt, *size - cnt, szsc);
cnt += snprintfW(cookie_data + cnt, *size - cnt, szname, cookie_iter->lpCookieName);
if (cookie_iter->lpCookieData[0])
cnt += snprintfW(cookie_data + cnt, *size - cnt, szdata, cookie_iter->lpCookieData);
TRACE("Cookie: %s\n", debugstr_w(cookie_data));
}
cookie_count++;
}
}
if (!domain_count) {
TRACE("no cookies found for %s\n", debugstr_w(host));
SetLastError(ERROR_NO_MORE_ITEMS);
return FALSE;
}
if(!cookie_data) {
*size = (cnt + 1) * sizeof(WCHAR);
TRACE("returning %u\n", *size);
return TRUE;
}
*size = cnt + 1;
TRACE("Returning %u (from %u domains): %s\n", cnt, domain_count, debugstr_w(cookie_data));
return cnt != 0;
}
/***********************************************************************
* InternetGetCookieW (WININET.@)
*
@ -276,14 +348,10 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain)
BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
LPWSTR lpCookieData, LPDWORD lpdwSize)
{
WCHAR host[INTERNET_MAX_HOST_NAME_LENGTH], path[INTERNET_MAX_PATH_LENGTH];
BOOL ret;
struct list * cursor;
unsigned int cnt = 0, domain_count = 0, cookie_count = 0;
WCHAR hostName[2048], path[2048];
FILETIME tm;
TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName),
lpCookieData, lpdwSize);
TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName), lpCookieData, lpdwSize);
if (!lpszUrl)
{
@ -291,83 +359,11 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
return FALSE;
}
hostName[0] = 0;
ret = COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0]));
if (!ret || !hostName[0]) return FALSE;
host[0] = 0;
ret = COOKIE_crackUrlSimple(lpszUrl, host, sizeof(host)/sizeof(host[0]), path, sizeof(path)/sizeof(path[0]));
if (!ret || !host[0]) return FALSE;
GetSystemTimeAsFileTime(&tm);
LIST_FOR_EACH(cursor, &domain_list)
{
cookie_domain *cookiesDomain = LIST_ENTRY(cursor, cookie_domain, entry);
if (COOKIE_matchDomain(hostName, path, cookiesDomain, TRUE))
{
struct list * cursor;
domain_count++;
TRACE("found domain %p\n", cookiesDomain);
LIST_FOR_EACH(cursor, &cookiesDomain->cookie_list)
{
cookie *thisCookie = LIST_ENTRY(cursor, cookie, entry);
/* check for expiry */
if ((thisCookie->expiry.dwLowDateTime != 0 || thisCookie->expiry.dwHighDateTime != 0) && CompareFileTime(&tm,&thisCookie->expiry) > 0)
{
TRACE("Found expired cookie. deleting\n");
COOKIE_deleteCookie(thisCookie, FALSE);
continue;
}
if (lpCookieData == NULL) /* return the size of the buffer required to lpdwSize */
{
unsigned int len;
if (cookie_count) cnt += 2; /* '; ' */
cnt += strlenW(thisCookie->lpCookieName);
if ((len = strlenW(thisCookie->lpCookieData)))
{
cnt += 1; /* = */
cnt += len;
}
}
else
{
static const WCHAR szsc[] = { ';',' ',0 };
static const WCHAR szname[] = { '%','s',0 };
static const WCHAR szdata[] = { '=','%','s',0 };
if (cookie_count) cnt += snprintfW(lpCookieData + cnt, *lpdwSize - cnt, szsc);
cnt += snprintfW(lpCookieData + cnt, *lpdwSize - cnt, szname, thisCookie->lpCookieName);
if (thisCookie->lpCookieData[0])
cnt += snprintfW(lpCookieData + cnt, *lpdwSize - cnt, szdata, thisCookie->lpCookieData);
TRACE("Cookie: %s\n", debugstr_w(lpCookieData));
}
cookie_count++;
}
}
}
if (!domain_count)
{
TRACE("no cookies found for %s\n", debugstr_w(hostName));
SetLastError(ERROR_NO_MORE_ITEMS);
return FALSE;
}
if (lpCookieData == NULL)
{
*lpdwSize = (cnt + 1) * sizeof(WCHAR);
TRACE("returning %u\n", *lpdwSize);
return TRUE;
}
*lpdwSize = cnt + 1;
TRACE("Returning %u (from %u domains): %s\n", cnt, domain_count,
debugstr_w(lpCookieData));
return (cnt ? TRUE : FALSE);
return get_cookie(host, path, lpCookieData, lpdwSize);
}
@ -397,7 +393,7 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
r = InternetGetCookieW( url, name, NULL, &len );
if( r )
{
szCookieData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
szCookieData = heap_alloc(len * sizeof(WCHAR));
if( !szCookieData )
{
r = FALSE;
@ -418,7 +414,7 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
return r;
}
static BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWSTR cookie_data)
BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWSTR cookie_data)
{
cookie_domain *thisCookieDomain = NULL;
cookie *thisCookie;
@ -453,7 +449,7 @@ static BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWST
if (value != data)
HeapFree(GetProcessHeap(), 0, value);
value = HeapAlloc(GetProcessHeap(), 0, (ptr - data) * sizeof(WCHAR));
value = heap_alloc((ptr - data) * sizeof(WCHAR));
if (value == NULL)
{
HeapFree(GetProcessHeap(), 0, data);

View file

@ -44,6 +44,8 @@
#include "resource.h"
#define MAX_STRING_LEN 1024
WINE_DEFAULT_DEBUG_CHANNEL(wininet);
struct WININET_ErrorDlgParams
@ -62,25 +64,25 @@ struct WININET_ErrorDlgParams
*/
static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
{
http_request_t *lpwhr;
http_session_t *lpwhs = NULL;
http_request_t *request;
http_session_t *session = NULL;
appinfo_t *hIC = NULL;
BOOL ret = FALSE;
LPWSTR p;
lpwhr = (http_request_t*) WININET_GetObject( hRequest );
if (NULL == lpwhr)
request = (http_request_t*) get_handle_object( hRequest );
if (NULL == request)
return FALSE;
lpwhs = lpwhr->lpHttpSession;
if (NULL == lpwhs)
session = request->session;
if (NULL == session)
goto done;
hIC = lpwhs->lpAppInfo;
hIC = session->appInfo;
if (NULL == hIC)
goto done;
lstrcpynW(szBuf, hIC->lpszProxy, sz);
lstrcpynW(szBuf, hIC->proxy, sz);
/* FIXME: perhaps it would be better to use InternetCrackUrl here */
p = strchrW(szBuf, ':');
@ -90,7 +92,7 @@ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
ret = TRUE;
done:
WININET_Release( &lpwhr->hdr );
WININET_Release( &request->hdr );
return ret;
}
@ -101,24 +103,24 @@ done:
*/
static BOOL WININET_GetServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
{
http_request_t *lpwhr;
http_session_t *lpwhs = NULL;
http_request_t *request;
http_session_t *session = NULL;
BOOL ret = FALSE;
lpwhr = (http_request_t*) WININET_GetObject( hRequest );
if (NULL == lpwhr)
request = (http_request_t*) get_handle_object( hRequest );
if (NULL == request)
return FALSE;
lpwhs = lpwhr->lpHttpSession;
if (NULL == lpwhs)
session = request->session;
if (NULL == session)
goto done;
lstrcpynW(szBuf, lpwhs->lpszHostName, sz);
lstrcpynW(szBuf, session->hostName, sz);
ret = TRUE;
done:
WININET_Release( &lpwhr->hdr );
WININET_Release( &request->hdr );
return ret;
}
@ -239,17 +241,17 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
static BOOL WININET_SetAuthorization( HINTERNET hRequest, LPWSTR username,
LPWSTR password, BOOL proxy )
{
http_request_t *lpwhr;
http_session_t *lpwhs;
http_request_t *request;
http_session_t *session;
BOOL ret = FALSE;
LPWSTR p, q;
lpwhr = (http_request_t*) WININET_GetObject( hRequest );
if( !lpwhr )
request = (http_request_t*) get_handle_object( hRequest );
if( !request )
return FALSE;
lpwhs = lpwhr->lpHttpSession;
if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION)
session = request->session;
if (NULL == session || session->hdr.htype != WH_HHTTPSESSION)
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
goto done;
@ -268,27 +270,27 @@ static BOOL WININET_SetAuthorization( HINTERNET hRequest, LPWSTR username,
if (proxy)
{
appinfo_t *hIC = lpwhs->lpAppInfo;
appinfo_t *hIC = session->appInfo;
HeapFree(GetProcessHeap(), 0, hIC->lpszProxyUsername);
hIC->lpszProxyUsername = p;
HeapFree(GetProcessHeap(), 0, hIC->proxyUsername);
hIC->proxyUsername = p;
HeapFree(GetProcessHeap(), 0, hIC->lpszProxyPassword);
hIC->lpszProxyPassword = q;
HeapFree(GetProcessHeap(), 0, hIC->proxyPassword);
hIC->proxyPassword = q;
}
else
{
HeapFree(GetProcessHeap(), 0, lpwhs->lpszUserName);
lpwhs->lpszUserName = p;
HeapFree(GetProcessHeap(), 0, session->userName);
session->userName = p;
HeapFree(GetProcessHeap(), 0, lpwhs->lpszPassword);
lpwhs->lpszPassword = q;
HeapFree(GetProcessHeap(), 0, session->password);
session->password = q;
}
ret = TRUE;
done:
WININET_Release( &lpwhr->hdr );
WININET_Release( &request->hdr );
return ret;
}
@ -460,6 +462,109 @@ static INT_PTR WINAPI WININET_PasswordDialog(
return FALSE;
}
/***********************************************************************
* WININET_InvalidCertificateDialog
*/
static INT_PTR WINAPI WININET_InvalidCertificateDialog(
HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
struct WININET_ErrorDlgParams *params;
HWND hitem;
WCHAR buf[1024];
if( uMsg == WM_INITDIALOG )
{
TRACE("WM_INITDIALOG (%08lx)\n", lParam);
/* save the parameter list */
params = (struct WININET_ErrorDlgParams*) lParam;
SetWindowLongPtrW( hdlg, GWLP_USERDATA, lParam );
switch( params->dwError )
{
case ERROR_INTERNET_INVALID_CA:
LoadStringW( WININET_hModule, IDS_CERT_CA_INVALID, buf, 1024 );
break;
case ERROR_INTERNET_SEC_CERT_DATE_INVALID:
LoadStringW( WININET_hModule, IDS_CERT_DATE_INVALID, buf, 1024 );
break;
case ERROR_INTERNET_SEC_CERT_CN_INVALID:
LoadStringW( WININET_hModule, IDS_CERT_CN_INVALID, buf, 1024 );
break;
case ERROR_INTERNET_SEC_CERT_ERRORS:
/* FIXME: We should fetch information about the
* certificate here and show all the relevant errors.
*/
LoadStringW( WININET_hModule, IDS_CERT_ERRORS, buf, 1024 );
break;
default:
FIXME( "No message for error %d\n", params->dwError );
buf[0] = '\0';
}
hitem = GetDlgItem( hdlg, IDC_CERT_ERROR );
SetWindowTextW( hitem, buf );
return TRUE;
}
params = (struct WININET_ErrorDlgParams*)
GetWindowLongPtrW( hdlg, GWLP_USERDATA );
switch( uMsg )
{
case WM_COMMAND:
if( wParam == IDOK )
{
BOOL res = TRUE;
if( params->dwFlags & FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS )
{
DWORD flags, size = sizeof(flags);
InternetQueryOptionW( params->hRequest, INTERNET_OPTION_SECURITY_FLAGS, &flags, &size );
switch( params->dwError )
{
case ERROR_INTERNET_INVALID_CA:
flags |= SECURITY_FLAG_IGNORE_UNKNOWN_CA;
break;
case ERROR_INTERNET_SEC_CERT_DATE_INVALID:
flags |= SECURITY_FLAG_IGNORE_CERT_DATE_INVALID;
break;
case ERROR_INTERNET_SEC_CERT_CN_INVALID:
flags |= SECURITY_FLAG_IGNORE_CERT_CN_INVALID;
break;
case ERROR_INTERNET_SEC_CERT_ERRORS:
FIXME("Should only add ignore flags as needed.\n");
flags |= SECURITY_FLAG_IGNORE_CERT_CN_INVALID |
SECURITY_FLAG_IGNORE_CERT_DATE_INVALID |
SECURITY_FLAG_IGNORE_UNKNOWN_CA;
/* FIXME: ERROR_INTERNET_SEC_CERT_ERRORS also
* seems to set the corresponding DLG_* flags.
*/
break;
}
res = InternetSetOptionW( params->hRequest, INTERNET_OPTION_SECURITY_FLAGS, &flags, size );
if(!res)
WARN("InternetSetOption(INTERNET_OPTION_SECURITY_FLAGS) failed.\n");
}
EndDialog( hdlg, res ? ERROR_SUCCESS : ERROR_NOT_SUPPORTED );
return TRUE;
}
if( wParam == IDCANCEL )
{
TRACE("Pressed cancel.\n");
EndDialog( hdlg, ERROR_CANCELLED );
return TRUE;
}
break;
}
return FALSE;
}
/***********************************************************************
* WININET_GetConnectionStatus
*/
@ -490,11 +595,13 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
DWORD dwError, DWORD dwFlags, LPVOID* lppvData)
{
struct WININET_ErrorDlgParams params;
HMODULE hwininet = GetModuleHandleA( "wininet.dll" );
INT dwStatus;
TRACE("%p %p %d %08x %p\n", hWnd, hRequest, dwError, dwFlags, lppvData);
if( !hWnd && !(dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI) )
return ERROR_INVALID_HANDLE;
params.hWnd = hWnd;
params.hRequest = hRequest;
params.dwError = dwError;
@ -512,23 +619,32 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
switch (dwStatus)
{
case HTTP_STATUS_PROXY_AUTH_REQ:
return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ),
return DialogBoxParamW( WININET_hModule, MAKEINTRESOURCEW( IDD_PROXYDLG ),
hWnd, WININET_ProxyPasswordDialog, (LPARAM) &params );
case HTTP_STATUS_DENIED:
return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_AUTHDLG ),
return DialogBoxParamW( WININET_hModule, MAKEINTRESOURCEW( IDD_AUTHDLG ),
hWnd, WININET_PasswordDialog, (LPARAM) &params );
default:
WARN("unhandled status %u\n", dwStatus);
return 0;
}
case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR:
case ERROR_INTERNET_INVALID_CA:
case ERROR_INTERNET_POST_IS_NON_SECURE:
case ERROR_INTERNET_SEC_CERT_ERRORS:
case ERROR_INTERNET_SEC_CERT_CN_INVALID:
case ERROR_INTERNET_SEC_CERT_DATE_INVALID:
case ERROR_INTERNET_INVALID_CA:
if( dwFlags & FLAGS_ERROR_UI_FLAGS_NO_UI )
return ERROR_CANCELLED;
if( dwFlags & ~FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS )
FIXME("%08x contains unsupported flags.\n", dwFlags);
return DialogBoxParamW( WININET_hModule, MAKEINTRESOURCEW( IDD_INVCERTDLG ),
hWnd, WININET_InvalidCertificateDialog, (LPARAM) &params );
case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR:
case ERROR_INTERNET_POST_IS_NON_SECURE:
FIXME("Need to display dialog for error %d\n", dwError);
return ERROR_SUCCESS;
}
return ERROR_INVALID_PARAMETER;
return ERROR_NOT_SUPPORTED;
}

View file

@ -288,7 +288,7 @@ BOOL WINAPI FtpPutFileW(HINTERNET hConnect, LPCWSTR lpszLocalFile,
return FALSE;
}
lpwfs = (ftp_session_t*) WININET_GetObject( hConnect );
lpwfs = (ftp_session_t*) get_handle_object( hConnect );
if (!lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -470,7 +470,7 @@ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
goto lend;
}
lpwfs = (ftp_session_t*) WININET_GetObject( hConnect );
lpwfs = (ftp_session_t*) get_handle_object( hConnect );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
@ -610,7 +610,7 @@ BOOL WINAPI FtpCreateDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
appinfo_t *hIC = NULL;
BOOL r = FALSE;
lpwfs = (ftp_session_t*) WININET_GetObject( hConnect );
lpwfs = (ftp_session_t*) get_handle_object( hConnect );
if (!lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -766,7 +766,7 @@ HINTERNET WINAPI FtpFindFirstFileW(HINTERNET hConnect,
appinfo_t *hIC = NULL;
HINTERNET r = NULL;
lpwfs = (ftp_session_t*) WININET_GetObject( hConnect );
lpwfs = (ftp_session_t*) get_handle_object( hConnect );
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
@ -916,7 +916,7 @@ BOOL WINAPI FtpGetCurrentDirectoryA(HINTERNET hFtpSession, LPSTR lpszCurrentDire
len = *lpdwCurrentDirectory;
if(lpszCurrentDirectory)
{
dir = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
dir = heap_alloc(len * sizeof(WCHAR));
if (NULL == dir)
{
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
@ -964,7 +964,7 @@ BOOL WINAPI FtpGetCurrentDirectoryW(HINTERNET hFtpSession, LPWSTR lpszCurrentDir
TRACE("%p %p %p\n", hFtpSession, lpszCurrentDirectory, lpdwCurrentDirectory);
lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession );
lpwfs = (ftp_session_t*) get_handle_object( hFtpSession );
if (NULL == lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -1127,8 +1127,6 @@ static void FTPFILE_Destroy(object_header_t *hdr)
if (nResCode > 0 && nResCode != 226) WARN("server reports failed transfer\n");
WININET_Release(&lpwh->lpFtpSession->hdr);
HeapFree(GetProcessHeap(), 0, lpwh);
}
static DWORD FTPFILE_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
@ -1326,7 +1324,6 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
BOOL bSuccess = FALSE;
ftp_file_t *lpwh = NULL;
appinfo_t *hIC = NULL;
HINTERNET handle = NULL;
TRACE("\n");
@ -1347,14 +1344,10 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
/* Get data socket to server */
if (bSuccess && FTP_GetDataSocket(lpwfs, &nDataSocket))
{
lpwh = HeapAlloc(GetProcessHeap(), 0, sizeof(ftp_file_t));
lpwh = alloc_object(&lpwfs->hdr, &FTPFILEVtbl, sizeof(ftp_file_t));
lpwh->hdr.htype = WH_HFILE;
lpwh->hdr.vtbl = &FTPFILEVtbl;
lpwh->hdr.dwFlags = dwFlags;
lpwh->hdr.dwContext = dwContext;
lpwh->hdr.dwInternalFlags = 0;
lpwh->hdr.refs = 1;
lpwh->hdr.lpfnStatusCB = lpwfs->hdr.lpfnStatusCB;
lpwh->nDataSocket = nDataSocket;
lpwh->cache_file = NULL;
lpwh->cache_file_handle = INVALID_HANDLE_VALUE;
@ -1364,10 +1357,6 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
lpwh->lpFtpSession = lpwfs;
list_add_head( &lpwfs->hdr.children, &lpwh->hdr.entry );
handle = WININET_AllocHandle( &lpwh->hdr );
if( !handle )
goto lend;
/* Indicate that a download is currently in progress */
lpwfs->download_in_progress = lpwh;
}
@ -1394,7 +1383,7 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
if (!InternetCreateUrlW(&uc, 0, NULL, &len) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
{
WCHAR *url = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
WCHAR *url = heap_alloc(len * sizeof(WCHAR));
if (url && InternetCreateUrlW(&uc, 0, url, &len) && CreateUrlCacheEntryW(url, 0, NULL, filename, 0))
{
@ -1420,7 +1409,7 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
if (lpwh)
{
iar.dwResult = (DWORD_PTR)handle;
iar.dwResult = (DWORD_PTR)lpwh->hdr.hInternet;
iar.dwError = ERROR_SUCCESS;
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_HANDLE_CREATED,
&iar, sizeof(INTERNET_ASYNC_RESULT));
@ -1436,11 +1425,13 @@ static HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs,
}
}
lend:
if( lpwh )
WININET_Release( &lpwh->hdr );
if(!bSuccess) {
if(lpwh)
WININET_Release( &lpwh->hdr );
return FALSE;
}
return handle;
return lpwh->hdr.hInternet;
}
@ -1501,7 +1492,7 @@ HINTERNET WINAPI FtpOpenFileW(HINTERNET hFtpSession,
TRACE("(%p,%s,0x%08x,0x%08x,0x%08lx)\n", hFtpSession,
debugstr_w(lpszFileName), fdwAccess, dwFlags, dwContext);
lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession );
lpwfs = (ftp_session_t*) get_handle_object( hFtpSession );
if (!lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -1624,7 +1615,7 @@ BOOL WINAPI FtpGetFileW(HINTERNET hInternet, LPCWSTR lpszRemoteFile, LPCWSTR lps
return FALSE;
}
lpwfs = (ftp_session_t*) WININET_GetObject( hInternet );
lpwfs = (ftp_session_t*) get_handle_object( hInternet );
if (!lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -1818,7 +1809,7 @@ BOOL WINAPI FtpDeleteFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName)
appinfo_t *hIC = NULL;
BOOL r = FALSE;
lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession );
lpwfs = (ftp_session_t*) get_handle_object( hFtpSession );
if (!lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -1963,7 +1954,7 @@ BOOL WINAPI FtpRemoveDirectoryW(HINTERNET hFtpSession, LPCWSTR lpszDirectory)
appinfo_t *hIC = NULL;
BOOL r = FALSE;
lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession );
lpwfs = (ftp_session_t*) get_handle_object( hFtpSession );
if (!lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -2113,7 +2104,7 @@ BOOL WINAPI FtpRenameFileW(HINTERNET hFtpSession, LPCWSTR lpszSrc, LPCWSTR lpszD
appinfo_t *hIC = NULL;
BOOL r = FALSE;
lpwfs = (ftp_session_t*) WININET_GetObject( hFtpSession );
lpwfs = (ftp_session_t*) get_handle_object( hFtpSession );
if (!lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -2279,7 +2270,7 @@ BOOL WINAPI FtpCommandW( HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags
return FALSE;
}
lpwfs = (ftp_session_t*) WININET_GetObject( hConnect );
lpwfs = (ftp_session_t*) get_handle_object( hConnect );
if (!lpwfs)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
@ -2299,7 +2290,7 @@ BOOL WINAPI FtpCommandW( HINTERNET hConnect, BOOL fExpectResponse, DWORD dwFlags
}
len = WideCharToMultiByte(CP_ACP, 0, lpszCommand, -1, NULL, 0, NULL, NULL) + strlen(szCRLF);
if ((cmd = HeapAlloc(GetProcessHeap(), 0, len )))
if ((cmd = heap_alloc(len)))
WideCharToMultiByte(CP_ACP, 0, lpszCommand, -1, cmd, len, NULL, NULL);
else
{
@ -2353,7 +2344,6 @@ static void FTPSESSION_Destroy(object_header_t *hdr)
HeapFree(GetProcessHeap(), 0, lpwfs->lpszPassword);
HeapFree(GetProcessHeap(), 0, lpwfs->lpszUserName);
HeapFree(GetProcessHeap(), 0, lpwfs->servername);
HeapFree(GetProcessHeap(), 0, lpwfs);
}
static void FTPSESSION_CloseConnection(object_header_t *hdr)
@ -2449,7 +2439,6 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
UINT sock_namelen;
BOOL bSuccess = FALSE;
ftp_session_t *lpwfs = NULL;
HINTERNET handle = NULL;
char szaddr[INET_ADDRSTRLEN];
TRACE("%p Server(%s) Port(%d) User(%s) Paswd(%s)\n",
@ -2461,14 +2450,14 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
if ((!lpszUserName || !*lpszUserName) && lpszPassword && *lpszPassword)
{
INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
goto lerror;
return NULL;
}
lpwfs = HeapAlloc(GetProcessHeap(), 0, sizeof(ftp_session_t));
lpwfs = alloc_object(&hIC->hdr, &FTPSESSIONVtbl, sizeof(ftp_session_t));
if (NULL == lpwfs)
{
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
goto lerror;
return NULL;
}
if (nServerPort == INTERNET_INVALID_PORT_NUMBER)
@ -2477,12 +2466,9 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
lpwfs->serverport = nServerPort;
lpwfs->hdr.htype = WH_HFTPSESSION;
lpwfs->hdr.vtbl = &FTPSESSIONVtbl;
lpwfs->hdr.dwFlags = dwFlags;
lpwfs->hdr.dwContext = dwContext;
lpwfs->hdr.dwInternalFlags = dwInternalFlags;
lpwfs->hdr.refs = 1;
lpwfs->hdr.lpfnStatusCB = hIC->hdr.lpfnStatusCB;
lpwfs->hdr.dwInternalFlags |= dwInternalFlags;
lpwfs->download_in_progress = NULL;
lpwfs->sndSocket = -1;
lpwfs->lstnSocket = -1;
@ -2492,18 +2478,10 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
lpwfs->lpAppInfo = hIC;
list_add_head( &hIC->hdr.children, &lpwfs->hdr.entry );
handle = WININET_AllocHandle( &lpwfs->hdr );
if( !handle )
{
ERR("Failed to alloc handle\n");
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
goto lerror;
}
if(hIC->lpszProxy && hIC->dwAccessType == INTERNET_OPEN_TYPE_PROXY) {
if(strchrW(hIC->lpszProxy, ' '))
if(hIC->proxy && hIC->accessType == INTERNET_OPEN_TYPE_PROXY) {
if(strchrW(hIC->proxy, ' '))
FIXME("Several proxies not implemented.\n");
if(hIC->lpszProxyBypass)
if(hIC->proxyBypass)
FIXME("Proxy bypass is ignored.\n");
}
if (!lpszUserName || !strlenW(lpszUserName)) {
@ -2537,7 +2515,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
{
INTERNET_ASYNC_RESULT iar;
iar.dwResult = (DWORD_PTR)handle;
iar.dwResult = (DWORD_PTR)lpwfs->hdr.hInternet;
iar.dwError = ERROR_SUCCESS;
SendAsyncCallback(&hIC->hdr, dwContext,
@ -2600,15 +2578,14 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
}
lerror:
if (lpwfs) WININET_Release( &lpwfs->hdr );
if (!bSuccess && handle)
if (!bSuccess)
{
WININET_FreeHandle( handle );
handle = NULL;
if(lpwfs)
WININET_Release( &lpwfs->hdr );
return NULL;
}
return handle;
return lpwfs->hdr.hInternet;
}
@ -2683,7 +2660,7 @@ static BOOL FTP_SendCommandA(INT nSocket, FTP_COMMAND ftpCmd, LPCSTR lpszParam,
dwParamLen = lpszParam?strlen(lpszParam)+1:0;
len = dwParamLen + strlen(szFtpCommands[ftpCmd]) + strlen(szCRLF);
if (NULL == (buf = HeapAlloc(GetProcessHeap(), 0, len+1)))
if (NULL == (buf = heap_alloc(len+1)))
{
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
@ -3250,7 +3227,7 @@ static BOOL FTP_SendData(ftp_session_t *lpwfs, INT nDataSocket, HANDLE hFile)
CHAR *lpszBuffer;
TRACE("\n");
lpszBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CHAR)*DATA_PACKET_SIZE);
lpszBuffer = heap_alloc_zero(sizeof(CHAR)*DATA_PACKET_SIZE);
/* Get the size of the file. */
GetFileInformationByHandle(hFile, &fi);
@ -3372,7 +3349,7 @@ static BOOL FTP_RetrieveFileData(ftp_session_t *lpwfs, INT nDataSocket, HANDLE h
TRACE("\n");
lpszBuffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CHAR)*DATA_PACKET_SIZE);
lpszBuffer = heap_alloc_zero(sizeof(CHAR)*DATA_PACKET_SIZE);
if (NULL == lpszBuffer)
{
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
@ -3419,7 +3396,6 @@ static void FTPFINDNEXT_Destroy(object_header_t *hdr)
}
HeapFree(GetProcessHeap(), 0, lpwfn->lpafp);
HeapFree(GetProcessHeap(), 0, lpwfn);
}
static DWORD FTPFINDNEXT_FindNextFileProc(WININETFTPFINDNEXTW *find, LPVOID data)
@ -3530,7 +3506,6 @@ static HINTERNET FTP_ReceiveFileList(ftp_session_t *lpwfs, INT nSocket, LPCWSTR
DWORD dwSize = 0;
LPFILEPROPERTIESW lpafp = NULL;
LPWININETFTPFINDNEXTW lpwfn = NULL;
HINTERNET handle = 0;
TRACE("(%p,%d,%s,%p,%08lx)\n", lpwfs, nSocket, debugstr_w(lpszSearchFile), lpFindFileData, dwContext);
@ -3539,14 +3514,11 @@ static HINTERNET FTP_ReceiveFileList(ftp_session_t *lpwfs, INT nSocket, LPCWSTR
if(lpFindFileData)
FTP_ConvertFileProp(lpafp, lpFindFileData);
lpwfn = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WININETFTPFINDNEXTW));
lpwfn = alloc_object(&lpwfs->hdr, &FTPFINDNEXTVtbl, sizeof(WININETFTPFINDNEXTW));
if (lpwfn)
{
lpwfn->hdr.htype = WH_HFTPFINDNEXT;
lpwfn->hdr.vtbl = &FTPFINDNEXTVtbl;
lpwfn->hdr.dwContext = dwContext;
lpwfn->hdr.refs = 1;
lpwfn->hdr.lpfnStatusCB = lpwfs->hdr.lpfnStatusCB;
lpwfn->index = 1; /* Next index is 1 since we return index 0 */
lpwfn->size = dwSize;
lpwfn->lpafp = lpafp;
@ -3554,16 +3526,11 @@ static HINTERNET FTP_ReceiveFileList(ftp_session_t *lpwfs, INT nSocket, LPCWSTR
WININET_AddRef( &lpwfs->hdr );
lpwfn->lpFtpSession = lpwfs;
list_add_head( &lpwfs->hdr.children, &lpwfn->hdr.entry );
handle = WININET_AllocHandle( &lpwfn->hdr );
}
}
if( lpwfn )
WININET_Release( &lpwfn->hdr );
TRACE("Matched %d files\n", dwSize);
return handle;
return lpwfn ? lpwfn->hdr.hInternet : NULL;
}
@ -3785,7 +3752,7 @@ static BOOL FTP_ParseDirectory(ftp_session_t *lpwfs, INT nSocket, LPCWSTR lpszSe
TRACE("\n");
/* Allocate initial file properties array */
*lpafp = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FILEPROPERTIESW)*(sizeFilePropArray));
*lpafp = heap_alloc_zero(sizeof(FILEPROPERTIESW)*(sizeFilePropArray));
if (!*lpafp)
return FALSE;
@ -3795,8 +3762,7 @@ static BOOL FTP_ParseDirectory(ftp_session_t *lpwfs, INT nSocket, LPCWSTR lpszSe
LPFILEPROPERTIESW tmpafp;
sizeFilePropArray *= 2;
tmpafp = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *lpafp,
sizeof(FILEPROPERTIESW)*sizeFilePropArray);
tmpafp = heap_realloc_zero(*lpafp, sizeof(FILEPROPERTIESW)*sizeFilePropArray);
if (NULL == tmpafp)
{
bSuccess = FALSE;
@ -3814,8 +3780,7 @@ static BOOL FTP_ParseDirectory(ftp_session_t *lpwfs, INT nSocket, LPCWSTR lpszSe
{
LPFILEPROPERTIESW tmpafp;
tmpafp = HeapReAlloc(GetProcessHeap(), 0, *lpafp,
sizeof(FILEPROPERTIESW)*indexFilePropArray);
tmpafp = heap_realloc(*lpafp, sizeof(FILEPROPERTIESW)*indexFilePropArray);
if (NULL != tmpafp)
*lpafp = tmpafp;
}

File diff suppressed because it is too large Load diff

View file

@ -88,9 +88,7 @@ typedef struct
} WITHREADERROR, *LPWITHREADERROR;
static DWORD g_dwTlsErrIndex = TLS_OUT_OF_INDEXES;
static HMODULE WININET_hModule;
#define HANDLE_CHUNK_SIZE 0x10
HMODULE WININET_hModule;
static CRITICAL_SECTION WININET_cs;
static CRITICAL_SECTION_DEBUG WININET_cs_debug =
@ -101,9 +99,9 @@ static CRITICAL_SECTION_DEBUG WININET_cs_debug =
};
static CRITICAL_SECTION WININET_cs = { &WININET_cs_debug, -1, 0, 0, 0, 0 };
static object_header_t **WININET_Handles;
static UINT_PTR WININET_dwNextHandle;
static UINT_PTR WININET_dwMaxHandles;
static object_header_t **handle_table;
static UINT_PTR next_handle;
static UINT_PTR handle_table_size;
typedef struct
{
@ -119,48 +117,70 @@ static const WCHAR szInternetSettings[] =
static const WCHAR szProxyServer[] = { 'P','r','o','x','y','S','e','r','v','e','r', 0 };
static const WCHAR szProxyEnable[] = { 'P','r','o','x','y','E','n','a','b','l','e', 0 };
HINTERNET WININET_AllocHandle( object_header_t *info )
void *alloc_object(object_header_t *parent, const object_vtbl_t *vtbl, size_t size)
{
object_header_t **p;
UINT_PTR handle = 0, num;
object_header_t *ret;
object_header_t **p;
BOOL res = TRUE;
list_init( &info->children );
ret = heap_alloc_zero(size);
if(!ret)
return NULL;
list_init(&ret->children);
EnterCriticalSection( &WININET_cs );
if( !WININET_dwMaxHandles )
{
num = HANDLE_CHUNK_SIZE;
p = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof (*WININET_Handles)* num);
if( !p )
goto end;
WININET_Handles = p;
WININET_dwMaxHandles = num;
}
if( WININET_dwMaxHandles == WININET_dwNextHandle )
{
num = WININET_dwMaxHandles + HANDLE_CHUNK_SIZE;
p = HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY,
WININET_Handles, sizeof (*WININET_Handles)* num);
if( !p )
goto end;
WININET_Handles = p;
WININET_dwMaxHandles = num;
if(!handle_table_size) {
num = 16;
p = heap_alloc_zero(sizeof(handle_table[0]) * num);
if(p) {
handle_table = p;
handle_table_size = num;
next_handle = 1;
}else {
res = FALSE;
}
}else if(next_handle == handle_table_size) {
num = handle_table_size * 2;
p = heap_realloc_zero(handle_table, sizeof(handle_table[0]) * num);
if(p) {
handle_table = p;
handle_table_size = num;
}else {
res = FALSE;
}
}
handle = WININET_dwNextHandle;
if( WININET_Handles[handle] )
ERR("handle isn't free but should be\n");
WININET_Handles[handle] = WININET_AddRef( info );
if(res) {
handle = next_handle;
if(handle_table[handle])
ERR("handle isn't free but should be\n");
handle_table[handle] = ret;
ret->valid_handle = TRUE;
while(handle_table[next_handle] && next_handle < handle_table_size)
next_handle++;
}
while( WININET_Handles[WININET_dwNextHandle] &&
(WININET_dwNextHandle < WININET_dwMaxHandles ) )
WININET_dwNextHandle++;
end:
LeaveCriticalSection( &WININET_cs );
return info->hInternet = (HINTERNET) (handle+1);
if(!res) {
heap_free(ret);
return NULL;
}
ret->vtbl = vtbl;
ret->refs = 1;
ret->hInternet = (HINTERNET)handle;
if(parent) {
ret->lpfnStatusCB = parent->lpfnStatusCB;
ret->dwInternalFlags = parent->dwInternalFlags & INET_CALLBACKW;
}
return ret;
}
object_header_t *WININET_AddRef( object_header_t *info )
@ -170,16 +190,15 @@ object_header_t *WININET_AddRef( object_header_t *info )
return info;
}
object_header_t *WININET_GetObject( HINTERNET hinternet )
object_header_t *get_handle_object( HINTERNET hinternet )
{
object_header_t *info = NULL;
UINT_PTR handle = (UINT_PTR) hinternet;
EnterCriticalSection( &WININET_cs );
if( (handle > 0) && ( handle <= WININET_dwMaxHandles ) &&
WININET_Handles[handle-1] )
info = WININET_AddRef( WININET_Handles[handle-1] );
if(handle > 0 && handle < handle_table_size && handle_table[handle] && handle_table[handle]->valid_handle)
info = WININET_AddRef(handle_table[handle]);
LeaveCriticalSection( &WININET_cs );
@ -188,12 +207,31 @@ object_header_t *WININET_GetObject( HINTERNET hinternet )
return info;
}
static void invalidate_handle(object_header_t *info)
{
object_header_t *child, *next;
if(!info->valid_handle)
return;
info->valid_handle = FALSE;
/* Free all children as native does */
LIST_FOR_EACH_ENTRY_SAFE( child, next, &info->children, object_header_t, entry )
{
TRACE("invalidating child handle %p for parent %p\n", child->hInternet, info);
invalidate_handle( child );
}
WININET_Release(info);
}
BOOL WININET_Release( object_header_t *info )
{
ULONG refs = InterlockedDecrement(&info->refs);
TRACE( "object %p refcount = %d\n", info, refs );
if( !refs )
{
invalidate_handle(info);
if ( info->vtbl->CloseConnection )
{
TRACE( "closing connection %p\n", info);
@ -211,57 +249,24 @@ BOOL WININET_Release( object_header_t *info )
if ( info->htype != WH_HINIT )
list_remove( &info->entry );
info->vtbl->Destroy( info );
if(info->hInternet) {
UINT_PTR handle = (UINT_PTR)info->hInternet;
EnterCriticalSection( &WININET_cs );
handle_table[handle] = NULL;
if(next_handle > handle)
next_handle = handle;
LeaveCriticalSection( &WININET_cs );
}
heap_free(info);
}
return TRUE;
}
BOOL WININET_FreeHandle( HINTERNET hinternet )
{
BOOL ret = FALSE;
UINT_PTR handle = (UINT_PTR) hinternet;
object_header_t *info = NULL, *child, *next;
EnterCriticalSection( &WININET_cs );
if( (handle > 0) && ( handle <= WININET_dwMaxHandles ) )
{
handle--;
if( WININET_Handles[handle] )
{
info = WININET_Handles[handle];
TRACE( "destroying handle %ld for object %p\n", handle+1, info);
WININET_Handles[handle] = NULL;
ret = TRUE;
}
}
LeaveCriticalSection( &WININET_cs );
/* As on native when the equivalent of WININET_Release is called, the handle
* is already invalid, but if a new handle is created at this time it does
* not yet get assigned the freed handle number */
if( info )
{
/* Free all children as native does */
LIST_FOR_EACH_ENTRY_SAFE( child, next, &info->children, object_header_t, entry )
{
TRACE( "freeing child handle %ld for parent handle %ld\n",
(UINT_PTR)child->hInternet, handle+1);
WININET_FreeHandle( child->hInternet );
}
WININET_Release( info );
}
EnterCriticalSection( &WININET_cs );
if( WININET_dwNextHandle > handle && !WININET_Handles[handle] )
WININET_dwNextHandle = handle;
LeaveCriticalSection( &WININET_cs );
return ret;
}
/***********************************************************************
* DllMain [Internal] Initializes the internal 'WININET.DLL'.
*
@ -303,7 +308,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
break;
case DLL_PROCESS_DETACH:
collect_connections(TRUE);
NETCON_unload();
URLCacheContainers_DeleteAll();
@ -538,7 +543,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
LPWSTR szProxy, p;
static const WCHAR szHttp[] = {'h','t','t','p','=',0};
if (!(szProxy = HeapAlloc( GetProcessHeap(), 0, len )))
if (!(szProxy = heap_alloc(len)))
{
RegCloseKey( key );
return ERROR_OUTOFMEMORY;
@ -570,7 +575,7 @@ static LONG INTERNET_LoadProxySettings( proxyinfo_t *lpwpi )
WCHAR *envproxyW;
len = MultiByteToWideChar( CP_UNIXCP, 0, envproxy, -1, NULL, 0 );
if (!(envproxyW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR))))
if (!(envproxyW = heap_alloc(len * sizeof(WCHAR))))
return ERROR_OUTOFMEMORY;
MultiByteToWideChar( CP_UNIXCP, 0, envproxy, -1, envproxyW, len );
@ -598,12 +603,12 @@ static BOOL INTERNET_ConfigureProxy( appinfo_t *lpwai )
if (wpi.dwProxyEnabled)
{
lpwai->dwAccessType = INTERNET_OPEN_TYPE_PROXY;
lpwai->lpszProxy = wpi.lpszProxyServer;
lpwai->accessType = INTERNET_OPEN_TYPE_PROXY;
lpwai->proxy = wpi.lpszProxyServer;
return TRUE;
}
lpwai->dwAccessType = INTERNET_OPEN_TYPE_DIRECT;
lpwai->accessType = INTERNET_OPEN_TYPE_DIRECT;
return FALSE;
}
@ -676,12 +681,11 @@ static VOID APPINFO_Destroy(object_header_t *hdr)
TRACE("%p\n",lpwai);
HeapFree(GetProcessHeap(), 0, lpwai->lpszAgent);
HeapFree(GetProcessHeap(), 0, lpwai->lpszProxy);
HeapFree(GetProcessHeap(), 0, lpwai->lpszProxyBypass);
HeapFree(GetProcessHeap(), 0, lpwai->lpszProxyUsername);
HeapFree(GetProcessHeap(), 0, lpwai->lpszProxyPassword);
HeapFree(GetProcessHeap(), 0, lpwai);
HeapFree(GetProcessHeap(), 0, lpwai->agent);
HeapFree(GetProcessHeap(), 0, lpwai->proxy);
HeapFree(GetProcessHeap(), 0, lpwai->proxyBypass);
HeapFree(GetProcessHeap(), 0, lpwai->proxyUsername);
HeapFree(GetProcessHeap(), 0, lpwai->proxyPassword);
}
static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
@ -707,14 +711,14 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe
bufsize = *size;
if (unicode) {
DWORD len = ai->lpszAgent ? strlenW(ai->lpszAgent) : 0;
DWORD len = ai->agent ? strlenW(ai->agent) : 0;
*size = (len + 1) * sizeof(WCHAR);
if(!buffer || bufsize < *size)
return ERROR_INSUFFICIENT_BUFFER;
if (ai->lpszAgent)
strcpyW(buffer, ai->lpszAgent);
if (ai->agent)
strcpyW(buffer, ai->agent);
else
*(WCHAR *)buffer = 0;
/* If the buffer is copied, the returned length doesn't include
@ -722,15 +726,15 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe
*/
*size = len * sizeof(WCHAR);
}else {
if (ai->lpszAgent)
*size = WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, NULL, 0, NULL, NULL);
if (ai->agent)
*size = WideCharToMultiByte(CP_ACP, 0, ai->agent, -1, NULL, 0, NULL, NULL);
else
*size = 1;
if(!buffer || bufsize < *size)
return ERROR_INSUFFICIENT_BUFFER;
if (ai->lpszAgent)
WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, buffer, *size, NULL, NULL);
if (ai->agent)
WideCharToMultiByte(CP_ACP, 0, ai->agent, -1, buffer, *size, NULL, NULL);
else
*(char *)buffer = 0;
/* If the buffer is copied, the returned length doesn't include
@ -748,10 +752,10 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe
DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0;
LPWSTR proxy, proxy_bypass;
if (ai->lpszProxy)
proxyBytesRequired = (lstrlenW(ai->lpszProxy) + 1) * sizeof(WCHAR);
if (ai->lpszProxyBypass)
proxyBypassBytesRequired = (lstrlenW(ai->lpszProxyBypass) + 1) * sizeof(WCHAR);
if (ai->proxy)
proxyBytesRequired = (lstrlenW(ai->proxy) + 1) * sizeof(WCHAR);
if (ai->proxyBypass)
proxyBypassBytesRequired = (lstrlenW(ai->proxyBypass) + 1) * sizeof(WCHAR);
if (*size < sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired)
{
*size = sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired;
@ -760,16 +764,16 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe
proxy = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW));
proxy_bypass = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired);
pi->dwAccessType = ai->dwAccessType;
pi->dwAccessType = ai->accessType;
pi->lpszProxy = NULL;
pi->lpszProxyBypass = NULL;
if (ai->lpszProxy) {
lstrcpyW(proxy, ai->lpszProxy);
if (ai->proxy) {
lstrcpyW(proxy, ai->proxy);
pi->lpszProxy = proxy;
}
if (ai->lpszProxyBypass) {
lstrcpyW(proxy_bypass, ai->lpszProxyBypass);
if (ai->proxyBypass) {
lstrcpyW(proxy_bypass, ai->proxyBypass);
pi->lpszProxyBypass = proxy_bypass;
}
@ -780,10 +784,10 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe
DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0;
LPSTR proxy, proxy_bypass;
if (ai->lpszProxy)
proxyBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->lpszProxy, -1, NULL, 0, NULL, NULL);
if (ai->lpszProxyBypass)
proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->lpszProxyBypass, -1,
if (ai->proxy)
proxyBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->proxy, -1, NULL, 0, NULL, NULL);
if (ai->proxyBypass)
proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->proxyBypass, -1,
NULL, 0, NULL, NULL);
if (*size < sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired)
{
@ -793,16 +797,16 @@ static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffe
proxy = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA));
proxy_bypass = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired);
pi->dwAccessType = ai->dwAccessType;
pi->dwAccessType = ai->accessType;
pi->lpszProxy = NULL;
pi->lpszProxyBypass = NULL;
if (ai->lpszProxy) {
WideCharToMultiByte(CP_ACP, 0, ai->lpszProxy, -1, proxy, proxyBytesRequired, NULL, NULL);
if (ai->proxy) {
WideCharToMultiByte(CP_ACP, 0, ai->proxy, -1, proxy, proxyBytesRequired, NULL, NULL);
pi->lpszProxy = proxy;
}
if (ai->lpszProxyBypass) {
WideCharToMultiByte(CP_ACP, 0, ai->lpszProxyBypass, -1, proxy_bypass,
if (ai->proxyBypass) {
WideCharToMultiByte(CP_ACP, 0, ai->proxyBypass, -1, proxy_bypass,
proxyBypassBytesRequired, NULL, NULL);
pi->lpszProxyBypass = proxy_bypass;
}
@ -842,7 +846,6 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType,
LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
{
appinfo_t *lpwai = NULL;
HINTERNET handle = NULL;
if (TRACE_ON(wininet)) {
#define FE(x) { x, #x }
@ -872,43 +875,28 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType,
/* Clear any error information */
INTERNET_SetLastError(0);
lpwai = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(appinfo_t));
if (NULL == lpwai)
{
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
goto lend;
lpwai = alloc_object(NULL, &APPINFOVtbl, sizeof(appinfo_t));
if (!lpwai) {
SetLastError(ERROR_OUTOFMEMORY);
return NULL;
}
lpwai->hdr.htype = WH_HINIT;
lpwai->hdr.vtbl = &APPINFOVtbl;
lpwai->hdr.dwFlags = dwFlags;
lpwai->hdr.refs = 1;
lpwai->dwAccessType = dwAccessType;
lpwai->lpszProxyUsername = NULL;
lpwai->lpszProxyPassword = NULL;
lpwai->accessType = dwAccessType;
lpwai->proxyUsername = NULL;
lpwai->proxyPassword = NULL;
handle = WININET_AllocHandle( &lpwai->hdr );
if( !handle )
{
HeapFree( GetProcessHeap(), 0, lpwai );
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
goto lend;
}
lpwai->lpszAgent = heap_strdupW(lpszAgent);
lpwai->agent = heap_strdupW(lpszAgent);
if(dwAccessType == INTERNET_OPEN_TYPE_PRECONFIG)
INTERNET_ConfigureProxy( lpwai );
else
lpwai->lpszProxy = heap_strdupW(lpszProxy);
lpwai->lpszProxyBypass = heap_strdupW(lpszProxyBypass);
lend:
if( lpwai )
WININET_Release( &lpwai->hdr );
lpwai->proxy = heap_strdupW(lpszProxy);
lpwai->proxyBypass = heap_strdupW(lpszProxyBypass);
TRACE("returning %p\n", lpwai);
return handle;
return lpwai->hdr.hInternet;
}
@ -1097,7 +1085,7 @@ BOOL WINAPI InternetGetConnectedStateExA(LPDWORD lpdwStatus, LPSTR lpszConnectio
TRACE("(%p, %p, %d, 0x%08x)\n", lpdwStatus, lpszConnectionName, dwNameLen, dwReserved);
if (lpszConnectionName && dwNameLen > 0)
lpwszConnectionName= HeapAlloc(GetProcessHeap(), 0, dwNameLen * sizeof(WCHAR));
lpwszConnectionName = heap_alloc(dwNameLen * sizeof(WCHAR));
rc = InternetGetConnectedStateExW(lpdwStatus,lpwszConnectionName, dwNameLen,
dwReserved);
@ -1142,7 +1130,7 @@ HINTERNET WINAPI InternetConnectW(HINTERNET hInternet,
return NULL;
}
hIC = (appinfo_t*)WININET_GetObject( hInternet );
hIC = (appinfo_t*)get_handle_object( hInternet );
if ( (hIC == NULL) || (hIC->hdr.htype != WH_HINIT) )
{
res = ERROR_INVALID_HANDLE;
@ -1249,7 +1237,7 @@ BOOL WINAPI InternetFindNextFileW(HINTERNET hFind, LPVOID lpvFindData)
TRACE("\n");
hdr = WININET_GetObject(hFind);
hdr = get_handle_object(hFind);
if(!hdr) {
WARN("Invalid handle\n");
SetLastError(ERROR_INVALID_HANDLE);
@ -1282,19 +1270,18 @@ BOOL WINAPI InternetFindNextFileW(HINTERNET hFind, LPVOID lpvFindData)
*/
BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
{
object_header_t *lpwh;
object_header_t *obj;
TRACE("%p\n",hInternet);
TRACE("%p\n", hInternet);
lpwh = WININET_GetObject( hInternet );
if (NULL == lpwh)
{
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
obj = get_handle_object( hInternet );
if (!obj) {
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
WININET_Release( lpwh );
WININET_FreeHandle( hInternet );
invalidate_handle(obj);
WININET_Release(obj);
return TRUE;
}
@ -1370,7 +1357,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
InternetCrackUrlW should not include it */
if (dwUrlLength == -1) nLength--;
lpwszUrl = HeapAlloc(GetProcessHeap(), 0, (nLength + 1) * sizeof(WCHAR));
lpwszUrl = heap_alloc((nLength + 1) * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,lpwszUrl,nLength + 1);
lpwszUrl[nLength] = '\0';
@ -1381,7 +1368,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
UCW.dwHostNameLength = lpUrlComponents->dwHostNameLength;
if (lpUrlComponents->lpszHostName)
{
hostname = HeapAlloc(GetProcessHeap(), 0, UCW.dwHostNameLength * sizeof(WCHAR));
hostname = heap_alloc(UCW.dwHostNameLength * sizeof(WCHAR));
UCW.lpszHostName = hostname;
}
}
@ -1390,7 +1377,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
UCW.dwUserNameLength = lpUrlComponents->dwUserNameLength;
if (lpUrlComponents->lpszUserName)
{
username = HeapAlloc(GetProcessHeap(), 0, UCW.dwUserNameLength * sizeof(WCHAR));
username = heap_alloc(UCW.dwUserNameLength * sizeof(WCHAR));
UCW.lpszUserName = username;
}
}
@ -1399,7 +1386,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
UCW.dwPasswordLength = lpUrlComponents->dwPasswordLength;
if (lpUrlComponents->lpszPassword)
{
password = HeapAlloc(GetProcessHeap(), 0, UCW.dwPasswordLength * sizeof(WCHAR));
password = heap_alloc(UCW.dwPasswordLength * sizeof(WCHAR));
UCW.lpszPassword = password;
}
}
@ -1408,7 +1395,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
UCW.dwUrlPathLength = lpUrlComponents->dwUrlPathLength;
if (lpUrlComponents->lpszUrlPath)
{
path = HeapAlloc(GetProcessHeap(), 0, UCW.dwUrlPathLength * sizeof(WCHAR));
path = heap_alloc(UCW.dwUrlPathLength * sizeof(WCHAR));
UCW.lpszUrlPath = path;
}
}
@ -1417,7 +1404,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
UCW.dwSchemeLength = lpUrlComponents->dwSchemeLength;
if (lpUrlComponents->lpszScheme)
{
scheme = HeapAlloc(GetProcessHeap(), 0, UCW.dwSchemeLength * sizeof(WCHAR));
scheme = heap_alloc(UCW.dwSchemeLength * sizeof(WCHAR));
UCW.lpszScheme = scheme;
}
}
@ -1426,7 +1413,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
UCW.dwExtraInfoLength = lpUrlComponents->dwExtraInfoLength;
if (lpUrlComponents->lpszExtraInfo)
{
extra = HeapAlloc(GetProcessHeap(), 0, UCW.dwExtraInfoLength * sizeof(WCHAR));
extra = heap_alloc(UCW.dwExtraInfoLength * sizeof(WCHAR));
UCW.lpszExtraInfo = extra;
}
}
@ -1585,14 +1572,14 @@ BOOL WINAPI InternetCrackUrlW(LPCWSTR lpszUrl_orig, DWORD dwUrlLength_orig, DWOR
WCHAR *url_tmp;
DWORD len = dwUrlLength + 1;
if (!(url_tmp = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
if (!(url_tmp = heap_alloc(len * sizeof(WCHAR))))
{
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
}
memcpy(url_tmp, lpszUrl_orig, dwUrlLength * sizeof(WCHAR));
url_tmp[dwUrlLength] = 0;
if (!(lpszUrl_decode = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
if (!(lpszUrl_decode = heap_alloc(len * sizeof(WCHAR))))
{
HeapFree(GetProcessHeap(), 0, url_tmp);
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
@ -2023,7 +2010,7 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackA(
TRACE("%p\n", hInternet);
if (!(lpwh = WININET_GetObject(hInternet)))
if (!(lpwh = get_handle_object(hInternet)))
return INTERNET_INVALID_STATUS_CALLBACK;
retVal = set_status_callback(lpwh, lpfnIntCB, FALSE);
@ -2051,7 +2038,7 @@ INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallbackW(
TRACE("%p\n", hInternet);
if (!(lpwh = WININET_GetObject(hInternet)))
if (!(lpwh = get_handle_object(hInternet)))
return INTERNET_INVALID_STATUS_CALLBACK;
retVal = set_status_callback(lpwh, lpfnIntCB, TRUE);
@ -2088,7 +2075,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer,
TRACE("(%p %p %d %p)\n", hFile, lpBuffer, dwNumOfBytesToWrite, lpdwNumOfBytesWritten);
lpwh = WININET_GetObject( hFile );
lpwh = get_handle_object( hFile );
if (!lpwh) {
WARN("Invalid handle\n");
SetLastError(ERROR_INVALID_HANDLE);
@ -2128,7 +2115,7 @@ BOOL WINAPI InternetReadFile(HINTERNET hFile, LPVOID lpBuffer,
TRACE("%p %p %d %p\n", hFile, lpBuffer, dwNumOfBytesToRead, pdwNumOfBytesRead);
hdr = WININET_GetObject(hFile);
hdr = get_handle_object(hFile);
if (!hdr) {
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
@ -2182,7 +2169,7 @@ BOOL WINAPI InternetReadFileExA(HINTERNET hFile, LPINTERNET_BUFFERSA lpBuffersOu
TRACE("(%p %p 0x%x 0x%lx)\n", hFile, lpBuffersOut, dwFlags, dwContext);
hdr = WININET_GetObject(hFile);
hdr = get_handle_object(hFile);
if (!hdr) {
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
@ -2214,7 +2201,7 @@ BOOL WINAPI InternetReadFileExW(HINTERNET hFile, LPINTERNET_BUFFERSW lpBuffer,
TRACE("(%p %p 0x%x 0x%lx)\n", hFile, lpBuffer, dwFlags, dwContext);
hdr = WININET_GetObject(hFile);
hdr = get_handle_object(hFile);
if (!hdr) {
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
@ -2305,7 +2292,7 @@ DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *
if (*size < sizeof(ULONG))
return ERROR_INSUFFICIENT_BUFFER;
*(ULONG*)size = 4;
*(ULONG*)buffer = 4;
*size = sizeof(ULONG);
return ERROR_SUCCESS;
@ -2347,27 +2334,27 @@ DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *
}
for (i = 0; i < con->dwOptionCount; i++) {
INTERNET_PER_CONN_OPTIONW *option = con->pOptions + i;
INTERNET_PER_CONN_OPTIONW *optionW = con->pOptions + i;
INTERNET_PER_CONN_OPTIONA *optionA = conA->pOptions + i;
switch (option->dwOption) {
switch (optionW->dwOption) {
case INTERNET_PER_CONN_FLAGS:
if(pi.dwProxyEnabled)
option->Value.dwValue = PROXY_TYPE_PROXY;
optionW->Value.dwValue = PROXY_TYPE_PROXY;
else
option->Value.dwValue = PROXY_TYPE_DIRECT;
optionW->Value.dwValue = PROXY_TYPE_DIRECT;
break;
case INTERNET_PER_CONN_PROXY_SERVER:
if (unicode)
option->Value.pszValue = heap_strdupW(pi.lpszProxyServer);
optionW->Value.pszValue = heap_strdupW(pi.lpszProxyServer);
else
optionA->Value.pszValue = heap_strdupWtoA(pi.lpszProxyServer);
break;
case INTERNET_PER_CONN_PROXY_BYPASS:
if (unicode)
option->Value.pszValue = heap_strdupW(pi.lpszProxyBypass);
optionW->Value.pszValue = heap_strdupW(pi.lpszProxyBypass);
else
optionA->Value.pszValue = heap_strdupWtoA(pi.lpszProxyBypass);
break;
@ -2378,12 +2365,12 @@ DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *
case INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS:
case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME:
case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL:
FIXME("Unhandled dwOption %d\n", option->dwOption);
memset(&option->Value, 0, sizeof(option->Value));
FIXME("Unhandled dwOption %d\n", optionW->dwOption);
memset(&optionW->Value, 0, sizeof(optionW->Value));
break;
default:
FIXME("Unknown dwOption %d\n", option->dwOption);
FIXME("Unknown dwOption %d\n", optionW->dwOption);
res = ERROR_INVALID_PARAMETER;
break;
}
@ -2440,7 +2427,7 @@ BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption,
TRACE("%p %d %p %p\n", hInternet, dwOption, lpBuffer, lpdwBufferLength);
if(hInternet) {
hdr = WININET_GetObject(hInternet);
hdr = get_handle_object(hInternet);
if (hdr) {
res = hdr->vtbl->QueryOption(hdr, dwOption, lpBuffer, lpdwBufferLength, TRUE);
WININET_Release(hdr);
@ -2473,7 +2460,7 @@ BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption,
TRACE("%p %d %p %p\n", hInternet, dwOption, lpBuffer, lpdwBufferLength);
if(hInternet) {
hdr = WININET_GetObject(hInternet);
hdr = get_handle_object(hInternet);
if (hdr) {
res = hdr->vtbl->QueryOption(hdr, dwOption, lpBuffer, lpdwBufferLength, FALSE);
WININET_Release(hdr);
@ -2506,7 +2493,7 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
TRACE("(%p %d %p %d)\n", hInternet, dwOption, lpBuffer, dwBufferLength);
lpwhh = (object_header_t*) WININET_GetObject( hInternet );
lpwhh = (object_header_t*) get_handle_object( hInternet );
if(lpwhh && lpwhh->vtbl->SetOption) {
DWORD res;
@ -2607,9 +2594,10 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
break;
case INTERNET_OPTION_SEND_TIMEOUT:
case INTERNET_OPTION_RECEIVE_TIMEOUT:
case INTERNET_OPTION_DATA_SEND_TIMEOUT:
{
ULONG timeout = *(ULONG *)lpBuffer;
FIXME("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT %d\n", timeout);
FIXME("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT/DATA_SEND_TIMEOUT %d\n", timeout);
break;
}
case INTERNET_OPTION_CONNECT_RETRIES:
@ -2764,7 +2752,7 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
{
object_header_t *lpwh;
if (!(lpwh = WININET_GetObject(hInternet)))
if (!(lpwh = get_handle_object(hInternet)))
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
return FALSE;
@ -2783,7 +2771,7 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
proxlen = MultiByteToWideChar( CP_ACP, 0, pi->lpszProxy, -1, NULL, 0);
prbylen= MultiByteToWideChar( CP_ACP, 0, pi->lpszProxyBypass, -1, NULL, 0);
wlen = sizeof(*piw) + proxlen + prbylen;
wbuffer = HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(WCHAR) );
wbuffer = heap_alloc(wlen*sizeof(WCHAR) );
piw = (LPINTERNET_PROXY_INFOW) wbuffer;
piw->dwAccessType = pi->dwAccessType;
prox = (LPWSTR) &piw[1];
@ -2799,7 +2787,7 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
case INTERNET_OPTION_PASSWORD:
wlen = MultiByteToWideChar( CP_ACP, 0, lpBuffer, dwBufferLength,
NULL, 0 );
wbuffer = HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(WCHAR) );
wbuffer = heap_alloc(wlen*sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, lpBuffer, dwBufferLength,
wbuffer, wlen );
break;
@ -2808,21 +2796,21 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
INTERNET_PER_CONN_OPTION_LISTW *listW;
INTERNET_PER_CONN_OPTION_LISTA *listA = lpBuffer;
wlen = sizeof(INTERNET_PER_CONN_OPTION_LISTW);
wbuffer = HeapAlloc( GetProcessHeap(), 0, wlen );
wbuffer = heap_alloc(wlen);
listW = wbuffer;
listW->dwSize = sizeof(INTERNET_PER_CONN_OPTION_LISTW);
if (listA->pszConnection)
{
wlen = MultiByteToWideChar( CP_ACP, 0, listA->pszConnection, -1, NULL, 0 );
listW->pszConnection = HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(WCHAR) );
listW->pszConnection = heap_alloc(wlen*sizeof(WCHAR));
MultiByteToWideChar( CP_ACP, 0, listA->pszConnection, -1, listW->pszConnection, wlen );
}
else
listW->pszConnection = NULL;
listW->dwOptionCount = listA->dwOptionCount;
listW->dwOptionError = listA->dwOptionError;
listW->pOptions = HeapAlloc( GetProcessHeap(), 0, sizeof(INTERNET_PER_CONN_OPTIONW) * listA->dwOptionCount );
listW->pOptions = heap_alloc(sizeof(INTERNET_PER_CONN_OPTIONW) * listA->dwOptionCount);
for (i = 0; i < listA->dwOptionCount; ++i) {
INTERNET_PER_CONN_OPTIONA *optA = listA->pOptions + i;
@ -2839,7 +2827,7 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
if (optA->Value.pszValue)
{
wlen = MultiByteToWideChar( CP_ACP, 0, optA->Value.pszValue, -1, NULL, 0 );
optW->Value.pszValue = HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(WCHAR) );
optW->Value.pszValue = heap_alloc(wlen*sizeof(WCHAR));
MultiByteToWideChar( CP_ACP, 0, optA->Value.pszValue, -1, optW->Value.pszValue, wlen );
}
else
@ -2852,6 +2840,7 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
break;
case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME:
optW->Value.ftValue = optA->Value.ftValue;
break;
default:
WARN("Unknown PER_CONN dwOption: %d, guessing at conversion to Wide\n", optA->dwOption);
optW->Value.dwValue = optA->Value.dwValue;
@ -3173,7 +3162,7 @@ BOOL WINAPI InternetCheckConnectionW( LPCWSTR lpszUrl, DWORD dwFlags, DWORD dwRe
* Build our ping command
*/
len = WideCharToMultiByte(CP_UNIXCP, 0, hostW, -1, NULL, 0, NULL, NULL);
command = HeapAlloc( GetProcessHeap(), 0, strlen(ping)+len+strlen(redirect) );
command = heap_alloc(strlen(ping)+len+strlen(redirect));
strcpy(command,ping);
WideCharToMultiByte(CP_UNIXCP, 0, hostW, -1, command+strlen(ping), len, NULL, NULL);
strcat(command,redirect);
@ -3301,7 +3290,7 @@ static HINTERNET INTERNET_InternetOpenUrlW(appinfo_t *hIC, LPCWSTR lpszUrl,
WCHAR *path_extra;
DWORD len = urlComponents.dwUrlPathLength + urlComponents.dwExtraInfoLength + 1;
if (!(path_extra = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
if (!(path_extra = heap_alloc(len * sizeof(WCHAR))))
{
InternetCloseHandle(client);
break;
@ -3379,7 +3368,7 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
goto lend;
}
hIC = (appinfo_t*)WININET_GetObject( hInternet );
hIC = (appinfo_t*)get_handle_object( hInternet );
if (NULL == hIC || hIC->hdr.htype != WH_HINIT) {
SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
goto lend;
@ -3441,7 +3430,7 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
if(lpszHeaders) {
lenHeaders = MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, NULL, 0 );
szHeaders = HeapAlloc(GetProcessHeap(), 0, lenHeaders*sizeof(WCHAR));
szHeaders = heap_alloc(lenHeaders*sizeof(WCHAR));
if(!szHeaders) {
HeapFree(GetProcessHeap(), 0, szUrl);
return NULL;
@ -3461,7 +3450,7 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
static LPWITHREADERROR INTERNET_AllocThreadError(void)
{
LPWITHREADERROR lpwite = HeapAlloc(GetProcessHeap(), 0, sizeof(*lpwite));
LPWITHREADERROR lpwite = heap_alloc(sizeof(*lpwite));
if (lpwite)
{
@ -3563,7 +3552,7 @@ DWORD INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest)
TRACE("\n");
lpNewRequest = HeapAlloc(GetProcessHeap(), 0, sizeof(WORKREQUEST));
lpNewRequest = heap_alloc(sizeof(WORKREQUEST));
if (!lpNewRequest)
return ERROR_OUTOFMEMORY;
@ -3682,7 +3671,7 @@ BOOL WINAPI InternetQueryDataAvailable( HINTERNET hFile,
TRACE("(%p %p %x %lx)\n", hFile, lpdwNumberOfBytesAvailble, dwFlags, dwContext);
hdr = WININET_GetObject( hFile );
hdr = get_handle_object( hFile );
if (!hdr) {
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
@ -3960,7 +3949,7 @@ static void convert_urlcomp_atow(LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPON
if (lpUrlComponents->lpszScheme)
{
len = URL_GET_COMP_LENGTHA(lpUrlComponents, Scheme) + 1;
urlCompW->lpszScheme = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
urlCompW->lpszScheme = heap_alloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszScheme,
-1, urlCompW->lpszScheme, len);
}
@ -3968,7 +3957,7 @@ static void convert_urlcomp_atow(LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPON
if (lpUrlComponents->lpszHostName)
{
len = URL_GET_COMP_LENGTHA(lpUrlComponents, HostName) + 1;
urlCompW->lpszHostName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
urlCompW->lpszHostName = heap_alloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszHostName,
-1, urlCompW->lpszHostName, len);
}
@ -3976,7 +3965,7 @@ static void convert_urlcomp_atow(LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPON
if (lpUrlComponents->lpszUserName)
{
len = URL_GET_COMP_LENGTHA(lpUrlComponents, UserName) + 1;
urlCompW->lpszUserName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
urlCompW->lpszUserName = heap_alloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszUserName,
-1, urlCompW->lpszUserName, len);
}
@ -3984,7 +3973,7 @@ static void convert_urlcomp_atow(LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPON
if (lpUrlComponents->lpszPassword)
{
len = URL_GET_COMP_LENGTHA(lpUrlComponents, Password) + 1;
urlCompW->lpszPassword = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
urlCompW->lpszPassword = heap_alloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszPassword,
-1, urlCompW->lpszPassword, len);
}
@ -3992,7 +3981,7 @@ static void convert_urlcomp_atow(LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPON
if (lpUrlComponents->lpszUrlPath)
{
len = URL_GET_COMP_LENGTHA(lpUrlComponents, UrlPath) + 1;
urlCompW->lpszUrlPath = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
urlCompW->lpszUrlPath = heap_alloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszUrlPath,
-1, urlCompW->lpszUrlPath, len);
}
@ -4000,7 +3989,7 @@ static void convert_urlcomp_atow(LPURL_COMPONENTSA lpUrlComponents, LPURL_COMPON
if (lpUrlComponents->lpszExtraInfo)
{
len = URL_GET_COMP_LENGTHA(lpUrlComponents, ExtraInfo) + 1;
urlCompW->lpszExtraInfo = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
urlCompW->lpszExtraInfo = heap_alloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpUrlComponents->lpszExtraInfo,
-1, urlCompW->lpszExtraInfo, len);
}
@ -4029,7 +4018,7 @@ BOOL WINAPI InternetCreateUrlA(LPURL_COMPONENTSA lpUrlComponents, DWORD dwFlags,
convert_urlcomp_atow(lpUrlComponents, &urlCompW);
if (lpszUrl)
urlW = HeapAlloc(GetProcessHeap(), 0, *lpdwUrlLength * sizeof(WCHAR));
urlW = heap_alloc(*lpdwUrlLength * sizeof(WCHAR));
ret = InternetCreateUrlW(&urlCompW, dwFlags, urlW, lpdwUrlLength);
@ -4083,7 +4072,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
INTERNET_SCHEME nScheme;
static const WCHAR slashSlashW[] = {'/','/'};
static const WCHAR percentD[] = {'%','d',0};
static const WCHAR fmtW[] = {'%','u',0};
TRACE("(%p,%d,%p,%p)\n", lpUrlComponents, dwFlags, lpszUrl, lpdwUrlLength);
@ -4170,7 +4159,7 @@ BOOL WINAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents, DWORD dwFlags,
{
WCHAR szPort[MAX_WORD_DIGITS+1];
sprintfW(szPort, percentD, lpUrlComponents->nPort);
sprintfW(szPort, fmtW, lpUrlComponents->nPort);
*lpszUrl = ':';
lpszUrl++;
dwLen = strlenW(szPort);

View file

@ -47,14 +47,68 @@
#define ioctlsocket ioctl
#endif /* __MINGW32__ */
extern HMODULE WININET_hModule DECLSPEC_HIDDEN;
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN 46
#endif
typedef struct {
WCHAR *name;
INTERNET_PORT port;
struct sockaddr_storage addr;
socklen_t addr_len;
char addr_str[INET6_ADDRSTRLEN];
LONG ref;
DWORD64 keep_until;
struct list entry;
struct list conn_pool;
} server_t;
void server_addref(server_t*) DECLSPEC_HIDDEN;
void server_release(server_t*) DECLSPEC_HIDDEN;
BOOL collect_connections(BOOL) DECLSPEC_HIDDEN;
/* used for netconnection.c stuff */
typedef struct
{
BOOL useSSL;
int socketFD;
void *ssl_s;
server_t *server;
DWORD security_flags;
} WININET_NETCONNECTION;
BOOL keep_alive;
DWORD64 keep_until;
struct list pool_entry;
} netconn_t;
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
{
return HeapAlloc(GetProcessHeap(), 0, len);
}
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
}
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len)
{
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
}
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len)
{
return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
}
static inline BOOL heap_free(void *mem)
{
return HeapFree(GetProcessHeap(), 0, mem);
}
static inline LPWSTR heap_strdupW(LPCWSTR str)
{
@ -64,7 +118,7 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
DWORD size;
size = (strlenW(str)+1)*sizeof(WCHAR);
ret = HeapAlloc(GetProcessHeap(), 0, size);
ret = heap_alloc(size);
if(ret)
memcpy(ret, str, size);
}
@ -84,7 +138,7 @@ static inline LPWSTR heap_strndupW(LPCWSTR str, UINT max_len)
if(str[len] == '\0')
break;
ret = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(len+1));
ret = heap_alloc(sizeof(WCHAR)*(len+1));
if(ret) {
memcpy(ret, str, sizeof(WCHAR)*len);
ret[len] = '\0';
@ -101,7 +155,7 @@ static inline WCHAR *heap_strdupAtoW(const char *str)
DWORD len;
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
ret = heap_alloc(len*sizeof(WCHAR));
if(ret)
MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
}
@ -115,7 +169,7 @@ static inline char *heap_strdupWtoA(LPCWSTR str)
if(str) {
DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
ret = HeapAlloc(GetProcessHeap(), 0, size);
ret = heap_alloc(size);
if(ret)
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
}
@ -177,6 +231,7 @@ struct _object_header_t
WH_TYPE htype;
const object_vtbl_t *vtbl;
HINTERNET hInternet;
BOOL valid_handle;
DWORD dwFlags;
DWORD_PTR dwContext;
DWORD dwError;
@ -192,27 +247,24 @@ struct _object_header_t
typedef struct
{
object_header_t hdr;
LPWSTR lpszAgent;
LPWSTR lpszProxy;
LPWSTR lpszProxyBypass;
LPWSTR lpszProxyUsername;
LPWSTR lpszProxyPassword;
DWORD dwAccessType;
LPWSTR agent;
LPWSTR proxy;
LPWSTR proxyBypass;
LPWSTR proxyUsername;
LPWSTR proxyPassword;
DWORD accessType;
} appinfo_t;
typedef struct
{
object_header_t hdr;
appinfo_t *lpAppInfo;
LPWSTR lpszHostName; /* the final destination of the request */
LPWSTR lpszServerName; /* the name of the server we directly connect to */
LPWSTR lpszUserName;
LPWSTR lpszPassword;
INTERNET_PORT nHostPort; /* the final destination port of the request */
INTERNET_PORT nServerPort; /* the port of the server we directly connect to */
struct sockaddr_storage socketAddress;
socklen_t sa_len;
appinfo_t *appInfo;
LPWSTR hostName; /* the final destination of the request */
LPWSTR serverName; /* the name of the server we directly connect to */
LPWSTR userName;
LPWSTR password;
INTERNET_PORT hostPort; /* the final destination port of the request */
INTERNET_PORT serverPort; /* the port of the server we directly connect to */
} http_session_t;
#define HDR_ISREQUEST 0x0001
@ -230,37 +282,53 @@ typedef struct
struct HttpAuthInfo;
typedef struct gzip_stream_t gzip_stream_t;
typedef struct data_stream_vtbl_t data_stream_vtbl_t;
typedef struct {
const data_stream_vtbl_t *vtbl;
} data_stream_t;
typedef struct {
data_stream_t data_stream;
DWORD content_length;
DWORD content_read;
} netconn_stream_t;
#define READ_BUFFER_SIZE 8192
typedef struct
{
object_header_t hdr;
http_session_t *lpHttpSession;
LPWSTR lpszPath;
LPWSTR lpszVerb;
LPWSTR lpszRawHeaders;
WININET_NETCONNECTION netConnection;
LPWSTR lpszVersion;
LPWSTR lpszStatusText;
DWORD dwBytesToWrite;
DWORD dwBytesWritten;
HTTPHEADERW *pCustHeaders;
http_session_t *session;
LPWSTR path;
LPWSTR verb;
LPWSTR rawHeaders;
netconn_t *netconn;
DWORD security_flags;
LPWSTR version;
LPWSTR statusText;
DWORD bytesToWrite;
DWORD bytesWritten;
HTTPHEADERW *custHeaders;
DWORD nCustHeaders;
FILETIME last_modified;
HANDLE hCacheFile;
LPWSTR lpszCacheFile;
struct HttpAuthInfo *pAuthInfo;
struct HttpAuthInfo *pProxyAuthInfo;
LPWSTR cacheFile;
FILETIME expires;
struct HttpAuthInfo *authInfo;
struct HttpAuthInfo *proxyAuthInfo;
CRITICAL_SECTION read_section; /* section to protect the following fields */
DWORD dwContentLength; /* total number of bytes to be read */
DWORD dwContentRead; /* bytes of the content read so far */
DWORD contentLength; /* total number of bytes to be read */
BOOL read_chunked; /* are we reading in chunked mode? */
BOOL read_gzip; /* are we reading in gzip mode? */
DWORD read_pos; /* current read position in read_buf */
DWORD read_size; /* valid data size in read_buf */
BYTE read_buf[4096]; /* buffer for already read but not returned data */
BYTE read_buf[READ_BUFFER_SIZE]; /* buffer for already read but not returned data */
BOOL decoding;
gzip_stream_t *gzip_stream;
data_stream_t *data_stream;
netconn_stream_t netconn_stream;
} http_request_t;
@ -407,65 +475,63 @@ typedef struct WORKREQ
} WORKREQUEST, *LPWORKREQUEST;
HINTERNET WININET_AllocHandle( object_header_t *info );
object_header_t *WININET_GetObject( HINTERNET hinternet );
object_header_t *WININET_AddRef( object_header_t *info );
BOOL WININET_Release( object_header_t *info );
BOOL WININET_FreeHandle( HINTERNET hinternet );
void *alloc_object(object_header_t*,const object_vtbl_t*,size_t) DECLSPEC_HIDDEN;
object_header_t *get_handle_object( HINTERNET hinternet ) DECLSPEC_HIDDEN;
object_header_t *WININET_AddRef( object_header_t *info ) DECLSPEC_HIDDEN;
BOOL WININET_Release( object_header_t *info ) DECLSPEC_HIDDEN;
DWORD INET_QueryOption( object_header_t *, DWORD, void *, DWORD *, BOOL );
DWORD INET_QueryOption( object_header_t *, DWORD, void *, DWORD *, BOOL ) DECLSPEC_HIDDEN;
time_t ConvertTimeString(LPCWSTR asctime);
time_t ConvertTimeString(LPCWSTR asctime) DECLSPEC_HIDDEN;
HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
INTERNET_PORT nServerPort, LPCWSTR lpszUserName,
LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext,
DWORD dwInternalFlags);
DWORD dwInternalFlags) DECLSPEC_HIDDEN;
DWORD HTTP_Connect(appinfo_t*,LPCWSTR,
INTERNET_PORT nServerPort, LPCWSTR lpszUserName,
LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext,
DWORD dwInternalFlags, HINTERNET*);
DWORD dwInternalFlags, HINTERNET*) DECLSPEC_HIDDEN;
BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
struct sockaddr *psa, socklen_t *sa_len);
struct sockaddr *psa, socklen_t *sa_len) DECLSPEC_HIDDEN;
void INTERNET_SetLastError(DWORD dwError);
DWORD INTERNET_GetLastError(void);
DWORD INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest);
LPSTR INTERNET_GetResponseBuffer(void);
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen);
BOOL get_cookie(const WCHAR*,const WCHAR*,WCHAR*,DWORD*) DECLSPEC_HIDDEN;
BOOL set_cookie(const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN;
void INTERNET_SetLastError(DWORD dwError) DECLSPEC_HIDDEN;
DWORD INTERNET_GetLastError(void) DECLSPEC_HIDDEN;
DWORD INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest) DECLSPEC_HIDDEN;
LPSTR INTERNET_GetResponseBuffer(void) DECLSPEC_HIDDEN;
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen) DECLSPEC_HIDDEN;
VOID SendAsyncCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInfo,
DWORD dwStatusInfoLength);
DWORD dwStatusInfoLength) DECLSPEC_HIDDEN;
VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInfo,
DWORD dwStatusInfoLength);
BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen);
DWORD dwStatusInfoLength) DECLSPEC_HIDDEN;
BOOL INTERNET_FindProxyForProtocol(LPCWSTR szProxy, LPCWSTR proto, WCHAR *foundProxy, DWORD *foundProxyLen) DECLSPEC_HIDDEN;
BOOL NETCON_connected(WININET_NETCONNECTION *connection);
DWORD NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
void NETCON_unload(void);
DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
int type, int protocol);
DWORD NETCON_close(WININET_NETCONNECTION *connection);
DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
unsigned int addrlen);
DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPWSTR hostname);
DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags,
int *sent /* out */);
DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags,
int *recvd /* out */);
BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *available);
LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection);
int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection);
DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
DWORD create_netconn(BOOL,server_t*,DWORD,netconn_t**) DECLSPEC_HIDDEN;
void free_netconn(netconn_t*) DECLSPEC_HIDDEN;
void NETCON_unload(void) DECLSPEC_HIDDEN;
DWORD NETCON_secure_connect(netconn_t *connection, LPWSTR hostname) DECLSPEC_HIDDEN;
DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags,
int *sent /* out */) DECLSPEC_HIDDEN;
DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, int flags,
int *recvd /* out */) DECLSPEC_HIDDEN;
BOOL NETCON_query_data_available(netconn_t *connection, DWORD *available) DECLSPEC_HIDDEN;
BOOL NETCON_is_alive(netconn_t*) DECLSPEC_HIDDEN;
LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN;
int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN;
DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, int value) DECLSPEC_HIDDEN;
#define sock_get_error(x) WSAGetLastError()
extern void URLCacheContainers_CreateDefaults(void);
extern void URLCacheContainers_DeleteAll(void);
extern void URLCacheContainers_CreateDefaults(void) DECLSPEC_HIDDEN;
extern void URLCacheContainers_DeleteAll(void) DECLSPEC_HIDDEN;
#define MAX_REPLY_LEN 0x5B4

View file

@ -58,6 +58,9 @@
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_TCP_H
# include <netinet/tcp.h>
#endif
#ifdef HAVE_OPENSSL_SSL_H
# include <openssl/ssl.h>
# include <openssl/opensslv.h>
@ -70,6 +73,7 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include "wine/library.h"
#include "windef.h"
@ -101,16 +105,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet);
#include <openssl/err.h>
static CRITICAL_SECTION init_ssl_cs;
static CRITICAL_SECTION_DEBUG init_ssl_cs_debug =
{
0, 0, &init_ssl_cs,
{ &init_ssl_cs_debug.ProcessLocksList,
&init_ssl_cs_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": init_ssl_cs") }
};
static CRITICAL_SECTION init_ssl_cs = { &init_ssl_cs_debug, -1, 0, 0, 0, 0 };
static void *OpenSSL_ssl_handle;
static void *OpenSSL_crypto_handle;
@ -162,6 +156,7 @@ MAKE_FUNCPTR(ERR_free_strings);
MAKE_FUNCPTR(ERR_get_error);
MAKE_FUNCPTR(ERR_error_string);
MAKE_FUNCPTR(X509_STORE_CTX_get_ex_data);
MAKE_FUNCPTR(X509_STORE_CTX_get_chain);
MAKE_FUNCPTR(i2d_X509);
MAKE_FUNCPTR(sk_num);
MAKE_FUNCPTR(sk_value);
@ -200,7 +195,7 @@ static PCCERT_CONTEXT X509_to_cert_context(X509 *cert)
*/
if (!p)
{
buffer = HeapAlloc(GetProcessHeap(),0,len);
buffer = heap_alloc(len);
p = buffer;
len = pi2d_X509(cert,&p);
}
@ -248,7 +243,8 @@ static DWORD netconn_verify_cert(PCCERT_CONTEXT cert, HCERTSTORE store,
CERT_TRUST_IS_REVOKED |
CERT_TRUST_IS_NOT_VALID_FOR_USAGE;
if (chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_TIME_VALID)
if (chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_TIME_VALID &&
!(security_flags & SECURITY_FLAG_IGNORE_CERT_DATE_INVALID))
err = ERROR_INTERNET_SEC_CERT_DATE_INVALID;
else if (chain->TrustStatus.dwErrorStatus &
CERT_TRUST_IS_UNTRUSTED_ROOT &&
@ -316,7 +312,7 @@ static int netconn_secure_verify(int preverify_ok, X509_STORE_CTX *ctx)
BOOL ret = FALSE;
HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
WININET_NETCONNECTION *conn;
netconn_t *conn;
ssl = pX509_STORE_CTX_get_ex_data(ctx,
pSSL_get_ex_data_X509_STORE_CTX_idx());
@ -327,13 +323,14 @@ static int netconn_secure_verify(int preverify_ok, X509_STORE_CTX *ctx)
X509 *cert;
int i;
PCCERT_CONTEXT endCert = NULL;
struct stack_st *chain = (struct stack_st *)pX509_STORE_CTX_get_chain( ctx );
ret = TRUE;
for (i = 0; ret && i < psk_num((struct stack_st *)ctx->chain); i++)
for (i = 0; ret && i < psk_num(chain); i++)
{
PCCERT_CONTEXT context;
cert = (X509 *)psk_value((struct stack_st *)ctx->chain, i);
cert = (X509 *)psk_value(chain, i);
if ((context = X509_to_cert_context(cert)))
{
if (i == 0)
@ -365,157 +362,206 @@ static int netconn_secure_verify(int preverify_ok, X509_STORE_CTX *ctx)
#endif
DWORD NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
static CRITICAL_SECTION init_ssl_cs;
static CRITICAL_SECTION_DEBUG init_ssl_cs_debug =
{
0, 0, &init_ssl_cs,
{ &init_ssl_cs_debug.ProcessLocksList,
&init_ssl_cs_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": init_ssl_cs") }
};
static CRITICAL_SECTION init_ssl_cs = { &init_ssl_cs_debug, -1, 0, 0, 0, 0 };
static DWORD init_openssl(void)
{
connection->useSSL = FALSE;
connection->socketFD = -1;
if (useSSL)
{
#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO)
int i;
int i;
TRACE("using SSL connection\n");
EnterCriticalSection(&init_ssl_cs);
if (OpenSSL_ssl_handle) /* already initialized everything */
{
LeaveCriticalSection(&init_ssl_cs);
return ERROR_SUCCESS;
}
OpenSSL_ssl_handle = wine_dlopen(SONAME_LIBSSL, RTLD_NOW, NULL, 0);
if (!OpenSSL_ssl_handle)
{
ERR("trying to use a SSL connection, but couldn't load %s. Expect trouble.\n",
SONAME_LIBSSL);
LeaveCriticalSection(&init_ssl_cs);
return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
}
OpenSSL_crypto_handle = wine_dlopen(SONAME_LIBCRYPTO, RTLD_NOW, NULL, 0);
if (!OpenSSL_crypto_handle)
{
ERR("trying to use a SSL connection, but couldn't load %s. Expect trouble.\n",
SONAME_LIBCRYPTO);
LeaveCriticalSection(&init_ssl_cs);
return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
}
if(OpenSSL_ssl_handle)
return ERROR_SUCCESS;
/* mmm nice ugly macroness */
OpenSSL_ssl_handle = wine_dlopen(SONAME_LIBSSL, RTLD_NOW, NULL, 0);
if(!OpenSSL_ssl_handle) {
ERR("trying to use a SSL connection, but couldn't load %s. Expect trouble.\n", SONAME_LIBSSL);
return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
}
OpenSSL_crypto_handle = wine_dlopen(SONAME_LIBCRYPTO, RTLD_NOW, NULL, 0);
if(!OpenSSL_crypto_handle) {
ERR("trying to use a SSL connection, but couldn't load %s. Expect trouble.\n", SONAME_LIBCRYPTO);
return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
}
/* mmm nice ugly macroness */
#define DYNSSL(x) \
p##x = wine_dlsym(OpenSSL_ssl_handle, #x, NULL, 0); \
if (!p##x) \
{ \
if (!p##x) { \
ERR("failed to load symbol %s\n", #x); \
LeaveCriticalSection(&init_ssl_cs); \
return ERROR_INTERNET_SECURITY_CHANNEL_ERROR; \
}
DYNSSL(SSL_library_init);
DYNSSL(SSL_load_error_strings);
DYNSSL(SSLv23_method);
DYNSSL(SSL_CTX_free);
DYNSSL(SSL_CTX_new);
DYNSSL(SSL_new);
DYNSSL(SSL_free);
DYNSSL(SSL_set_fd);
DYNSSL(SSL_connect);
DYNSSL(SSL_shutdown);
DYNSSL(SSL_write);
DYNSSL(SSL_read);
DYNSSL(SSL_pending);
DYNSSL(SSL_get_error);
DYNSSL(SSL_get_ex_new_index);
DYNSSL(SSL_get_ex_data);
DYNSSL(SSL_set_ex_data);
DYNSSL(SSL_get_ex_data_X509_STORE_CTX_idx);
DYNSSL(SSL_get_peer_certificate);
DYNSSL(SSL_CTX_get_timeout);
DYNSSL(SSL_CTX_set_timeout);
DYNSSL(SSL_CTX_set_default_verify_paths);
DYNSSL(SSL_CTX_set_verify);
DYNSSL(SSL_get_current_cipher);
DYNSSL(SSL_CIPHER_get_bits);
DYNSSL(SSL_library_init);
DYNSSL(SSL_load_error_strings);
DYNSSL(SSLv23_method);
DYNSSL(SSL_CTX_free);
DYNSSL(SSL_CTX_new);
DYNSSL(SSL_new);
DYNSSL(SSL_free);
DYNSSL(SSL_set_fd);
DYNSSL(SSL_connect);
DYNSSL(SSL_shutdown);
DYNSSL(SSL_write);
DYNSSL(SSL_read);
DYNSSL(SSL_pending);
DYNSSL(SSL_get_error);
DYNSSL(SSL_get_ex_new_index);
DYNSSL(SSL_get_ex_data);
DYNSSL(SSL_set_ex_data);
DYNSSL(SSL_get_ex_data_X509_STORE_CTX_idx);
DYNSSL(SSL_get_peer_certificate);
DYNSSL(SSL_CTX_get_timeout);
DYNSSL(SSL_CTX_set_timeout);
DYNSSL(SSL_CTX_set_default_verify_paths);
DYNSSL(SSL_CTX_set_verify);
DYNSSL(SSL_get_current_cipher);
DYNSSL(SSL_CIPHER_get_bits);
#undef DYNSSL
#define DYNCRYPTO(x) \
p##x = wine_dlsym(OpenSSL_crypto_handle, #x, NULL, 0); \
if (!p##x) \
{ \
if (!p##x) { \
ERR("failed to load symbol %s\n", #x); \
LeaveCriticalSection(&init_ssl_cs); \
return ERROR_INTERNET_SECURITY_CHANNEL_ERROR; \
}
DYNCRYPTO(BIO_new_fp);
DYNCRYPTO(CRYPTO_num_locks);
DYNCRYPTO(CRYPTO_set_id_callback);
DYNCRYPTO(CRYPTO_set_locking_callback);
DYNCRYPTO(ERR_free_strings);
DYNCRYPTO(ERR_get_error);
DYNCRYPTO(ERR_error_string);
DYNCRYPTO(X509_STORE_CTX_get_ex_data);
DYNCRYPTO(i2d_X509);
DYNCRYPTO(sk_num);
DYNCRYPTO(sk_value);
DYNCRYPTO(BIO_new_fp);
DYNCRYPTO(CRYPTO_num_locks);
DYNCRYPTO(CRYPTO_set_id_callback);
DYNCRYPTO(CRYPTO_set_locking_callback);
DYNCRYPTO(ERR_free_strings);
DYNCRYPTO(ERR_get_error);
DYNCRYPTO(ERR_error_string);
DYNCRYPTO(X509_STORE_CTX_get_ex_data);
DYNCRYPTO(X509_STORE_CTX_get_chain);
DYNCRYPTO(i2d_X509);
DYNCRYPTO(sk_num);
DYNCRYPTO(sk_value);
#undef DYNCRYPTO
pSSL_library_init();
pSSL_load_error_strings();
pBIO_new_fp(stderr, BIO_NOCLOSE); /* FIXME: should use winedebug stuff */
pSSL_library_init();
pSSL_load_error_strings();
pBIO_new_fp(stderr, BIO_NOCLOSE); /* FIXME: should use winedebug stuff */
meth = pSSLv23_method();
ctx = pSSL_CTX_new(meth);
if (!pSSL_CTX_set_default_verify_paths(ctx))
{
ERR("SSL_CTX_set_default_verify_paths failed: %s\n",
pERR_error_string(pERR_get_error(), 0));
LeaveCriticalSection(&init_ssl_cs);
return ERROR_OUTOFMEMORY;
}
hostname_idx = pSSL_get_ex_new_index(0, (void *)"hostname index",
NULL, NULL, NULL);
if (hostname_idx == -1)
{
ERR("SSL_get_ex_new_index failed; %s\n",
pERR_error_string(pERR_get_error(), 0));
LeaveCriticalSection(&init_ssl_cs);
return ERROR_OUTOFMEMORY;
}
error_idx = pSSL_get_ex_new_index(0, (void *)"error index",
NULL, NULL, NULL);
if (error_idx == -1)
{
ERR("SSL_get_ex_new_index failed; %s\n",
pERR_error_string(pERR_get_error(), 0));
LeaveCriticalSection(&init_ssl_cs);
return ERROR_OUTOFMEMORY;
}
conn_idx = pSSL_get_ex_new_index(0, (void *)"netconn index",
NULL, NULL, NULL);
if (conn_idx == -1)
{
ERR("SSL_get_ex_new_index failed; %s\n",
pERR_error_string(pERR_get_error(), 0));
LeaveCriticalSection(&init_ssl_cs);
return ERROR_OUTOFMEMORY;
}
pSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, netconn_secure_verify);
pCRYPTO_set_id_callback(ssl_thread_id);
num_ssl_locks = pCRYPTO_num_locks();
ssl_locks = HeapAlloc(GetProcessHeap(), 0, num_ssl_locks * sizeof(CRITICAL_SECTION));
if (!ssl_locks)
{
LeaveCriticalSection(&init_ssl_cs);
return ERROR_OUTOFMEMORY;
}
for (i = 0; i < num_ssl_locks; i++)
InitializeCriticalSection(&ssl_locks[i]);
pCRYPTO_set_locking_callback(ssl_lock_callback);
LeaveCriticalSection(&init_ssl_cs);
#else
FIXME("can't use SSL, not compiled in.\n");
return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
#endif
meth = pSSLv23_method();
ctx = pSSL_CTX_new(meth);
if(!pSSL_CTX_set_default_verify_paths(ctx)) {
ERR("SSL_CTX_set_default_verify_paths failed: %s\n",
pERR_error_string(pERR_get_error(), 0));
return ERROR_OUTOFMEMORY;
}
hostname_idx = pSSL_get_ex_new_index(0, (void *)"hostname index", NULL, NULL, NULL);
if(hostname_idx == -1) {
ERR("SSL_get_ex_new_index failed; %s\n", pERR_error_string(pERR_get_error(), 0));
return ERROR_OUTOFMEMORY;
}
error_idx = pSSL_get_ex_new_index(0, (void *)"error index", NULL, NULL, NULL);
if(error_idx == -1) {
ERR("SSL_get_ex_new_index failed; %s\n", pERR_error_string(pERR_get_error(), 0));
return ERROR_OUTOFMEMORY;
}
conn_idx = pSSL_get_ex_new_index(0, (void *)"netconn index", NULL, NULL, NULL);
if(conn_idx == -1) {
ERR("SSL_get_ex_new_index failed; %s\n", pERR_error_string(pERR_get_error(), 0));
return ERROR_OUTOFMEMORY;
}
pSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, netconn_secure_verify);
pCRYPTO_set_id_callback(ssl_thread_id);
num_ssl_locks = pCRYPTO_num_locks();
ssl_locks = HeapAlloc(GetProcessHeap(), 0, num_ssl_locks * sizeof(CRITICAL_SECTION));
if(!ssl_locks)
return ERROR_OUTOFMEMORY;
for(i = 0; i < num_ssl_locks; i++)
InitializeCriticalSection(&ssl_locks[i]);
pCRYPTO_set_locking_callback(ssl_lock_callback);
return ERROR_SUCCESS;
#else
FIXME("can't use SSL, not compiled in.\n");
return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
#endif
}
DWORD create_netconn(BOOL useSSL, server_t *server, DWORD security_flags, netconn_t **ret)
{
netconn_t *netconn;
int result, flag;
if(useSSL) {
DWORD res;
TRACE("using SSL connection\n");
EnterCriticalSection(&init_ssl_cs);
res = init_openssl();
LeaveCriticalSection(&init_ssl_cs);
if(res != ERROR_SUCCESS)
return res;
}
netconn = heap_alloc_zero(sizeof(*netconn));
if(!netconn)
return ERROR_OUTOFMEMORY;
netconn->useSSL = useSSL;
netconn->socketFD = -1;
netconn->security_flags = security_flags;
list_init(&netconn->pool_entry);
assert(server->addr_len);
result = netconn->socketFD = socket(server->addr.ss_family, SOCK_STREAM, 0);
if(result != -1) {
result = connect(netconn->socketFD, (struct sockaddr*)&server->addr, server->addr_len);
if(result == -1)
closesocket(netconn->socketFD);
}
if(result == -1) {
heap_free(netconn);
return sock_get_error(errno);
}
#ifdef TCP_NODELAY
flag = 1;
result = setsockopt(netconn->socketFD, IPPROTO_TCP, TCP_NODELAY, (void*)&flag, sizeof(flag));
if(result < 0)
WARN("setsockopt(TCP_NODELAY) failed\n");
#endif
server_addref(server);
netconn->server = server;
*ret = netconn;
return ERROR_SUCCESS;
}
void free_netconn(netconn_t *netconn)
{
server_release(netconn->server);
#ifdef SONAME_LIBSSL
if (netconn->ssl_s) {
pSSL_shutdown(netconn->ssl_s);
pSSL_free(netconn->ssl_s);
}
#endif
closesocket(netconn->socketFD);
heap_free(netconn);
}
void NETCON_unload(void)
@ -541,14 +587,6 @@ void NETCON_unload(void)
#endif
}
BOOL NETCON_connected(WININET_NETCONNECTION *connection)
{
if (connection->socketFD == -1)
return FALSE;
else
return TRUE;
}
#if 0
/* translate a unix error code into a winsock one */
int sock_get_error( int err )
@ -618,80 +656,32 @@ int sock_get_error( int err )
}
#endif
/******************************************************************************
* NETCON_create
* Basically calls 'socket()'
*/
DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
int type, int protocol)
{
#ifdef SONAME_LIBSSL
if (connection->useSSL)
return ERROR_NOT_SUPPORTED;
#endif
connection->socketFD = socket(domain, type, protocol);
if (connection->socketFD == -1)
return sock_get_error(errno);
return ERROR_SUCCESS;
}
/******************************************************************************
* NETCON_close
* Basically calls 'close()' unless we should use SSL
*/
DWORD NETCON_close(WININET_NETCONNECTION *connection)
{
int result;
if (!NETCON_connected(connection)) return ERROR_SUCCESS;
#ifdef SONAME_LIBSSL
if (connection->useSSL)
{
pSSL_shutdown(connection->ssl_s);
pSSL_free(connection->ssl_s);
connection->ssl_s = NULL;
connection->useSSL = FALSE;
}
#endif
result = closesocket(connection->socketFD);
connection->socketFD = -1;
if (result == -1)
return sock_get_error(errno);
return ERROR_SUCCESS;
}
/******************************************************************************
* NETCON_secure_connect
* Initiates a secure connection over an existing plaintext connection.
*/
DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPWSTR hostname)
DWORD NETCON_secure_connect(netconn_t *connection, LPWSTR hostname)
{
void *ssl_s;
DWORD res = ERROR_NOT_SUPPORTED;
#ifdef SONAME_LIBSSL
/* can't connect if we are already connected */
if (connection->useSSL)
if (connection->ssl_s)
{
ERR("already connected\n");
return ERROR_INTERNET_CANNOT_CONNECT;
}
connection->ssl_s = pSSL_new(ctx);
if (!connection->ssl_s)
ssl_s = pSSL_new(ctx);
if (!ssl_s)
{
ERR("SSL_new failed: %s\n",
pERR_error_string(pERR_get_error(), 0));
res = ERROR_OUTOFMEMORY;
goto fail;
return ERROR_OUTOFMEMORY;
}
if (!pSSL_set_fd(connection->ssl_s, connection->socketFD))
if (!pSSL_set_fd(ssl_s, connection->socketFD))
{
ERR("SSL_set_fd failed: %s\n",
pERR_error_string(pERR_get_error(), 0));
@ -699,74 +689,50 @@ DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPWSTR hostname)
goto fail;
}
if (!pSSL_set_ex_data(connection->ssl_s, hostname_idx, hostname))
if (!pSSL_set_ex_data(ssl_s, hostname_idx, hostname))
{
ERR("SSL_set_ex_data failed: %s\n",
pERR_error_string(pERR_get_error(), 0));
res = ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
goto fail;
}
if (!pSSL_set_ex_data(connection->ssl_s, conn_idx, connection))
if (!pSSL_set_ex_data(ssl_s, conn_idx, connection))
{
ERR("SSL_set_ex_data failed: %s\n",
pERR_error_string(pERR_get_error(), 0));
res = ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
goto fail;
}
if (pSSL_connect(connection->ssl_s) <= 0)
if (pSSL_connect(ssl_s) <= 0)
{
res = (DWORD_PTR)pSSL_get_ex_data(connection->ssl_s, error_idx);
res = (DWORD_PTR)pSSL_get_ex_data(ssl_s, error_idx);
if (!res)
res = ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
ERR("SSL_connect failed: %d\n", res);
goto fail;
}
connection->useSSL = TRUE;
connection->ssl_s = ssl_s;
return ERROR_SUCCESS;
fail:
if (connection->ssl_s)
if (ssl_s)
{
pSSL_shutdown(connection->ssl_s);
pSSL_free(connection->ssl_s);
connection->ssl_s = NULL;
pSSL_shutdown(ssl_s);
pSSL_free(ssl_s);
}
#endif
return res;
}
/******************************************************************************
* NETCON_connect
* Connects to the specified address.
*/
DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
unsigned int addrlen)
{
int result;
result = connect(connection->socketFD, serv_addr, addrlen);
if (result == -1)
{
WARN("Unable to connect to host (%s)\n", strerror(errno));
closesocket(connection->socketFD);
connection->socketFD = -1;
return sock_get_error(errno);
}
return ERROR_SUCCESS;
}
/******************************************************************************
* NETCON_send
* Basically calls 'send()' unless we should use SSL
* number of chars send is put in *sent
*/
DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags,
DWORD NETCON_send(netconn_t *connection, const void *msg, size_t len, int flags,
int *sent /* out */)
{
if (!NETCON_connected(connection)) return ERROR_INTERNET_CONNECTION_ABORTED;
if (!connection->useSSL)
{
*sent = send(connection->socketFD, msg, len, flags);
@ -777,6 +743,10 @@ DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len
else
{
#ifdef SONAME_LIBSSL
if(!connection->ssl_s) {
FIXME("not connected\n");
return ERROR_NOT_SUPPORTED;
}
if (flags)
FIXME("SSL_write doesn't support any flags (%08x)\n", flags);
*sent = pSSL_write(connection->ssl_s, msg, len);
@ -794,31 +764,30 @@ DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len
* Basically calls 'recv()' unless we should use SSL
* number of chars received is put in *recvd
*/
DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags,
DWORD NETCON_recv(netconn_t *connection, void *buf, size_t len, int flags,
int *recvd /* out */)
{
*recvd = 0;
if (!NETCON_connected(connection)) return ERROR_INTERNET_CONNECTION_ABORTED;
if (!len)
return ERROR_SUCCESS;
if (!connection->useSSL)
{
*recvd = recv(connection->socketFD, buf, len, flags);
if(!*recvd)
NETCON_close(connection);
return *recvd == -1 ? sock_get_error(errno) : ERROR_SUCCESS;
}
else
{
#ifdef SONAME_LIBSSL
if(!connection->ssl_s) {
FIXME("not connected\n");
return ERROR_NOT_SUPPORTED;
}
*recvd = pSSL_read(connection->ssl_s, buf, len);
/* Check if EOF was received */
if(!*recvd && (pSSL_get_error(connection->ssl_s, *recvd)==SSL_ERROR_ZERO_RETURN
|| pSSL_get_error(connection->ssl_s, *recvd)==SSL_ERROR_SYSCALL)) {
NETCON_close(connection);
|| pSSL_get_error(connection->ssl_s, *recvd)==SSL_ERROR_SYSCALL))
return ERROR_SUCCESS;
}
return *recvd > 0 ? ERROR_SUCCESS : ERROR_INTERNET_CONNECTION_ABORTED;
#else
@ -832,11 +801,9 @@ DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int
* Returns the number of bytes of peeked data plus the number of bytes of
* queued, but unread data.
*/
BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *available)
BOOL NETCON_query_data_available(netconn_t *connection, DWORD *available)
{
*available = 0;
if (!NETCON_connected(connection))
return FALSE;
if (!connection->useSSL)
{
@ -853,19 +820,49 @@ BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *avail
else
{
#ifdef SONAME_LIBSSL
*available = pSSL_pending(connection->ssl_s);
*available = connection->ssl_s ? pSSL_pending(connection->ssl_s) : 0;
#endif
}
return TRUE;
}
LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection)
BOOL NETCON_is_alive(netconn_t *netconn)
{
#ifdef MSG_DONTWAIT
ssize_t len;
BYTE b;
len = recv(netconn->socketFD, &b, 1, MSG_PEEK|MSG_DONTWAIT);
return len == 1 || (len == -1 && errno == EWOULDBLOCK);
#elif defined(__MINGW32__) || defined(_MSC_VER)
ULONG mode;
int len;
char b;
mode = 1;
if(!ioctlsocket(netconn->socketFD, FIONBIO, &mode))
return FALSE;
len = recv(netconn->socketFD, &b, 1, MSG_PEEK);
mode = 0;
if(!ioctlsocket(netconn->socketFD, FIONBIO, &mode))
return FALSE;
return len == 1 || (len == -1 && errno == WSAEWOULDBLOCK);
#else
FIXME("not supported on this platform\n");
return TRUE;
#endif
}
LPCVOID NETCON_GetCert(netconn_t *connection)
{
#ifdef SONAME_LIBSSL
X509* cert;
LPCVOID r = NULL;
if (!connection->useSSL)
if (!connection->ssl_s)
return NULL;
cert = pSSL_get_peer_certificate(connection->ssl_s);
@ -876,7 +873,7 @@ LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection)
#endif
}
int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection)
int NETCON_GetCipherStrength(netconn_t *connection)
{
#ifdef SONAME_LIBSSL
#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x0090707f)
@ -886,7 +883,7 @@ int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection)
#endif
int bits = 0;
if (!connection->useSSL)
if (!connection->ssl_s)
return 0;
cipher = pSSL_get_current_cipher(connection->ssl_s);
if (!cipher)
@ -898,16 +895,11 @@ int NETCON_GetCipherStrength(WININET_NETCONNECTION *connection)
#endif
}
DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value)
DWORD NETCON_set_timeout(netconn_t *connection, BOOL send, int value)
{
int result;
struct timeval tv;
/* FIXME: we should probably store the timeout in the connection to set
* when we do connect */
if (!NETCON_connected(connection))
return ERROR_SUCCESS;
/* value is in milliseconds, convert to struct timeval */
tv.tv_sec = value / 1000;
tv.tv_usec = (value % 1000) * 1000;

View file

@ -21,6 +21,7 @@
#include <windef.h>
#include <winuser.h>
#define IDD_INVCERTDLG 0x398
#define IDD_AUTHDLG 0x399
#define IDD_PROXYDLG 0x400
@ -30,5 +31,10 @@
#define IDC_PASSWORD 0x404
#define IDC_SAVEPASSWORD 0x405
#define IDC_SERVER 0x406
#define IDC_CERT_ERROR 0x407
#define IDS_LANCONNECTION 0x500
#define IDS_CERT_CA_INVALID 0x501
#define IDS_CERT_DATE_INVALID 0x502
#define IDS_CERT_CN_INVALID 0x503
#define IDS_CERT_ERRORS 0x504

View file

@ -45,12 +45,15 @@
#include "wininet_Da.rc"
#include "wininet_En.rc"
#include "wininet_Es.rc"
#include "wininet_Eo.rc"
#include "wininet_Fi.rc"
#include "wininet_He.rc"
#include "wininet_Hu.rc"
#include "wininet_It.rc"
#include "wininet_Ko.rc"
#include "wininet_Nl.rc"
#include "wininet_Pl.rc"
#include "wininet_Sr.rc"
#include "wininet_Sv.rc"
#include "wininet_Uk.rc"
#include "wininet_Tr.rc"

View file

@ -48,10 +48,12 @@
#include "wininet.h"
#include "winineti.h"
#include "winerror.h"
#include "internet.h"
#include "winreg.h"
#include "shlwapi.h"
#include "shlobj.h"
#include "shellapi.h"
#include "internet.h"
#include "wine/unicode.h"
#include "wine/debug.h"
@ -96,8 +98,7 @@ typedef struct _URL_CACHEFILE_ENTRY
WORD wExpiredDate; /* expire date in dos format */
WORD wExpiredTime; /* expire time in dos format */
DWORD dwUnknown1; /* usually zero */
DWORD dwSizeLow; /* see INTERNET_CACHE_ENTRY_INFO::dwSizeLow */
DWORD dwSizeHigh; /* see INTERNET_CACHE_ENTRY_INFO::dwSizeHigh */
ULARGE_INTEGER size; /* see INTERNET_CACHE_ENTRY_INFO::dwSizeLow/High */
DWORD dwUnknown2; /* usually zero */
DWORD dwExemptDelta; /* see INTERNET_CACHE_ENTRY_INFO::dwExemptDelta */
DWORD dwUnknown3; /* usually 0x60 */
@ -142,7 +143,7 @@ typedef struct _HASH_CACHEFILE_ENTRY
typedef struct _DIRECTORY_DATA
{
DWORD dwUnknown;
DWORD dwNumFiles;
char filename[DIR_LENGTH];
} DIRECTORY_DATA;
@ -154,14 +155,10 @@ typedef struct _URLCACHE_HEADER
DWORD dwIndexCapacityInBlocks;
DWORD dwBlocksInUse;
DWORD dwUnknown1;
DWORD dwCacheLimitLow; /* disk space limit for cache */
DWORD dwCacheLimitHigh; /* disk space limit for cache */
DWORD dwUnknown4; /* current disk space usage for cache */
DWORD dwUnknown5; /* current disk space usage for cache */
DWORD dwUnknown6; /* possibly a flag? */
DWORD dwUnknown7;
BYTE DirectoryCount; /* number of directory_data's */
BYTE Unknown8[3]; /* just padding? */
ULARGE_INTEGER CacheLimit;
ULARGE_INTEGER CacheUsage;
ULARGE_INTEGER ExemptUsage;
DWORD DirectoryCount; /* number of directory_data's */
DIRECTORY_DATA directory_data[1]; /* first directory entry */
} URLCACHE_HEADER, *LPURLCACHE_HEADER;
typedef const URLCACHE_HEADER *LPCURLCACHE_HEADER;
@ -227,8 +224,12 @@ static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
static const WCHAR wszIndex[] = {'i','n','d','e','x','.','d','a','t',0};
static const WCHAR wszMappingFormat[] = {'%','s','%','s','_','%','l','u',0};
if (pContainer->hMapping)
WaitForSingleObject(pContainer->hMutex, INFINITE);
if (pContainer->hMapping) {
ReleaseMutex(pContainer->hMutex);
return ERROR_SUCCESS;
}
strcpyW(wszFilePath, pContainer->path);
strcatW(wszFilePath, wszIndex);
@ -243,14 +244,10 @@ static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
if (hFile == INVALID_HANDLE_VALUE)
{
TRACE("Could not open or create cache index file \"%s\"\n", debugstr_w(wszFilePath));
ReleaseMutex(pContainer->hMutex);
return GetLastError();
}
/* At this stage we need the mutex because we may be about to create the
* file.
*/
WaitForSingleObject(pContainer->hMutex, INFINITE);
dwFileSize = GetFileSize(hFile, NULL);
if (dwFileSize == INVALID_FILE_SIZE)
{
@ -313,8 +310,7 @@ static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
pHeader->dwFileSize = dwFileSize;
pHeader->dwIndexCapacityInBlocks = NEWFILE_NUM_BLOCKS;
/* 127MB - taken from default for Windows 2000 */
pHeader->dwCacheLimitHigh = 0;
pHeader->dwCacheLimitLow = 0x07ff5400;
pHeader->CacheLimit.QuadPart = 0x07ff5400;
/* Copied from a Windows 2000 cache index */
pHeader->DirectoryCount = 4;
@ -329,8 +325,7 @@ static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
(BYTE *) &dw, &len) == ERROR_SUCCESS &&
keytype == REG_DWORD)
{
pHeader->dwCacheLimitHigh = (dw >> 22);
pHeader->dwCacheLimitLow = dw << 10;
pHeader->CacheLimit.QuadPart = (ULONGLONG)dw * 1024;
}
RegCloseKey(key);
}
@ -347,12 +342,7 @@ static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
for (i = 0; !dwError && i < pHeader->DirectoryCount; ++i)
{
/* The following values were copied from a Windows index.
* I don't know what the values are supposed to mean but
* have made them the same in the hope that this will
* be better for compatibility
*/
pHeader->directory_data[i].dwUnknown = (i > 1) ? 0xfe : 0xff;
pHeader->directory_data[i].dwNumFiles = 0;
for (j = 0;; ++j)
{
int k;
@ -430,8 +420,6 @@ static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
}
ReleaseMutex(pContainer->hMutex);
wsprintfW(wszFilePath, wszMappingFormat, pContainer->path, wszIndex, dwFileSize);
URLCache_PathToObjectName(wszFilePath, '_');
pContainer->hMapping = OpenFileMappingW(FILE_MAP_WRITE, FALSE, wszFilePath);
@ -441,9 +429,12 @@ static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer)
if (!pContainer->hMapping)
{
ERR("Couldn't create file mapping (error is %d)\n", GetLastError());
ReleaseMutex(pContainer->hMutex);
return GetLastError();
}
ReleaseMutex(pContainer->hMutex);
return ERROR_SUCCESS;
}
@ -464,7 +455,7 @@ static void URLCacheContainer_CloseIndex(URLCACHECONTAINER * pContainer)
static BOOL URLCacheContainers_AddContainer(LPCWSTR cache_prefix, LPCWSTR path, LPWSTR mutex_name)
{
URLCACHECONTAINER * pContainer = HeapAlloc(GetProcessHeap(), 0, sizeof(URLCACHECONTAINER));
URLCACHECONTAINER * pContainer = heap_alloc(sizeof(URLCACHECONTAINER));
int cache_prefix_len = strlenW(cache_prefix);
if (!pContainer)
@ -482,7 +473,7 @@ static BOOL URLCacheContainers_AddContainer(LPCWSTR cache_prefix, LPCWSTR path,
return FALSE;
}
pContainer->cache_prefix = HeapAlloc(GetProcessHeap(), 0, (cache_prefix_len + 1) * sizeof(WCHAR));
pContainer->cache_prefix = heap_alloc((cache_prefix_len + 1) * sizeof(WCHAR));
if (!pContainer->cache_prefix)
{
HeapFree(GetProcessHeap(), 0, pContainer->path);
@ -884,7 +875,7 @@ static BOOL URLCache_LocalFileNameToPathW(
}
nRequired = (path_len + DIR_LENGTH + file_name_len + 1) * sizeof(WCHAR);
if (nRequired < *lpBufferSize)
if (nRequired <= *lpBufferSize)
{
int dir_len;
@ -946,6 +937,18 @@ static BOOL URLCache_LocalFileNameToPathA(
return FALSE;
}
/* Just like DosDateTimeToFileTime, except that it also maps the special
* case of a DOS date/time of (0,0) to a filetime of (0,0).
*/
static void URLCache_DosDateTimeToFileTime(WORD fatdate, WORD fattime,
FILETIME *ft)
{
if (!fatdate && !fattime)
ft->dwLowDateTime = ft->dwHighDateTime = 0;
else
DosDateTimeToFileTime(fatdate, fattime, ft);
}
/***********************************************************************
* URLCache_CopyEntry (Internal)
*
@ -977,16 +980,16 @@ static DWORD URLCache_CopyEntry(
lpCacheEntryInfo->u.dwExemptDelta = pUrlEntry->dwExemptDelta;
lpCacheEntryInfo->dwHeaderInfoSize = pUrlEntry->dwHeaderInfoSize;
lpCacheEntryInfo->dwHitRate = pUrlEntry->dwHitRate;
lpCacheEntryInfo->dwSizeHigh = pUrlEntry->dwSizeHigh;
lpCacheEntryInfo->dwSizeLow = pUrlEntry->dwSizeLow;
lpCacheEntryInfo->dwSizeHigh = pUrlEntry->size.u.HighPart;
lpCacheEntryInfo->dwSizeLow = pUrlEntry->size.u.LowPart;
lpCacheEntryInfo->dwStructSize = sizeof(*lpCacheEntryInfo);
lpCacheEntryInfo->dwUseCount = pUrlEntry->dwUseCount;
DosDateTimeToFileTime(pUrlEntry->wExpiredDate, pUrlEntry->wExpiredTime, &lpCacheEntryInfo->ExpireTime);
URLCache_DosDateTimeToFileTime(pUrlEntry->wExpiredDate, pUrlEntry->wExpiredTime, &lpCacheEntryInfo->ExpireTime);
lpCacheEntryInfo->LastAccessTime.dwHighDateTime = pUrlEntry->LastAccessTime.dwHighDateTime;
lpCacheEntryInfo->LastAccessTime.dwLowDateTime = pUrlEntry->LastAccessTime.dwLowDateTime;
lpCacheEntryInfo->LastModifiedTime.dwHighDateTime = pUrlEntry->LastModifiedTime.dwHighDateTime;
lpCacheEntryInfo->LastModifiedTime.dwLowDateTime = pUrlEntry->LastModifiedTime.dwLowDateTime;
DosDateTimeToFileTime(pUrlEntry->wLastSyncDate, pUrlEntry->wLastSyncTime, &lpCacheEntryInfo->LastSyncTime);
URLCache_DosDateTimeToFileTime(pUrlEntry->wLastSyncDate, pUrlEntry->wLastSyncTime, &lpCacheEntryInfo->LastSyncTime);
}
if ((dwRequiredSize % 4) && (dwRequiredSize < *lpdwBufferSize))
@ -1076,6 +1079,17 @@ static DWORD URLCache_CopyEntry(
return ERROR_SUCCESS;
}
/* Just like FileTimeToDosDateTime, except that it also maps the special
* case of a filetime of (0,0) to a DOS date/time of (0,0).
*/
static void URLCache_FileTimeToDosDateTime(const FILETIME *ft, WORD *fatdate,
WORD *fattime)
{
if (!ft->dwLowDateTime && !ft->dwHighDateTime)
*fatdate = *fattime = 0;
else
FileTimeToDosDateTime(ft, fatdate, fattime);
}
/***********************************************************************
* URLCache_SetEntryInfo (Internal)
@ -1097,7 +1111,7 @@ static DWORD URLCache_SetEntryInfo(URL_CACHEFILE_ENTRY * pUrlEntry, const INTERN
if (dwFieldControl & CACHE_ENTRY_EXEMPT_DELTA_FC)
pUrlEntry->dwExemptDelta = lpCacheEntryInfo->u.dwExemptDelta;
if (dwFieldControl & CACHE_ENTRY_EXPTIME_FC)
FIXME("CACHE_ENTRY_EXPTIME_FC unimplemented\n");
URLCache_FileTimeToDosDateTime(&lpCacheEntryInfo->ExpireTime, &pUrlEntry->wExpiredDate, &pUrlEntry->wExpiredTime);
if (dwFieldControl & CACHE_ENTRY_HEADERINFO_FC)
FIXME("CACHE_ENTRY_HEADERINFO_FC unimplemented\n");
if (dwFieldControl & CACHE_ENTRY_HITRATE_FC)
@ -1105,7 +1119,7 @@ static DWORD URLCache_SetEntryInfo(URL_CACHEFILE_ENTRY * pUrlEntry, const INTERN
if (dwFieldControl & CACHE_ENTRY_MODTIME_FC)
pUrlEntry->LastModifiedTime = lpCacheEntryInfo->LastModifiedTime;
if (dwFieldControl & CACHE_ENTRY_SYNCTIME_FC)
FileTimeToDosDateTime(&lpCacheEntryInfo->LastAccessTime, &pUrlEntry->wLastSyncDate, &pUrlEntry->wLastSyncTime);
URLCache_FileTimeToDosDateTime(&lpCacheEntryInfo->LastAccessTime, &pUrlEntry->wLastSyncDate, &pUrlEntry->wLastSyncTime);
return ERROR_SUCCESS;
}
@ -1456,25 +1470,102 @@ static BOOL URLCache_EnumHashTableEntries(LPCURLCACHE_HEADER pHeader, const HASH
}
/***********************************************************************
* FreeUrlCacheSpaceA (WININET.@)
* URLCache_DeleteCacheDirectory (Internal)
*
* Erase a directory containing an URL cache.
*
* RETURNS
* TRUE success, FALSE failure/aborted.
*
*/
BOOL WINAPI FreeUrlCacheSpaceA(LPCSTR lpszCachePath, DWORD dwSize, DWORD dwFilter)
static BOOL URLCache_DeleteCacheDirectory(LPCWSTR lpszPath)
{
FIXME("stub!\n");
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
DWORD path_len;
WCHAR path[MAX_PATH + 1];
SHFILEOPSTRUCTW shfos;
int ret;
path_len = strlenW(lpszPath);
if (path_len >= MAX_PATH)
return FALSE;
strcpyW(path, lpszPath);
path[path_len + 1] = 0; /* double-NUL-terminate path */
shfos.hwnd = NULL;
shfos.wFunc = FO_DELETE;
shfos.pFrom = path;
shfos.pTo = NULL;
shfos.fFlags = 0;
shfos.fAnyOperationsAborted = FALSE;
ret = SHFileOperationW(&shfos);
if (ret)
ERR("SHFileOperationW on %s returned %i\n", debugstr_w(path), ret);
return !(ret || shfos.fAnyOperationsAborted);
}
/***********************************************************************
* FreeUrlCacheSpaceW (WININET.@)
*
* Frees up some cache.
*
* PARAMETERS
* lpszCachePath [I] Which volume to free up from, or NULL if you don't care.
* dwSize [I] How much space to free up.
* dwSizeType [I] How to interpret dwSize.
*
* RETURNS
* TRUE success. FALSE failure.
*
* IMPLEMENTATION
* This implementation just retrieves the path of the cache directory, and
* deletes its contents from the filesystem. The correct approach would
* probably be to implement and use {FindFirst,FindNext,Delete}UrlCacheGroup().
*/
BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR lpszCachePath, DWORD dwSize, DWORD dwSizeType)
{
URLCACHECONTAINER * pContainer;
if (lpszCachePath != NULL || dwSize != 100 || dwSizeType != FCS_PERCENT_CACHE_SPACE)
{
FIXME("(%s, %x, %x): partial stub!\n", debugstr_w(lpszCachePath), dwSize, dwSizeType);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{
/* The URL cache has prefix L"" (unlike Cookies and History) */
if (pContainer->cache_prefix[0] == 0)
{
BOOL ret_del;
DWORD ret_open;
WaitForSingleObject(pContainer->hMutex, INFINITE);
/* unlock, delete, recreate and lock cache */
URLCacheContainer_CloseIndex(pContainer);
ret_del = URLCache_DeleteCacheDirectory(pContainer->path);
ret_open = URLCacheContainer_OpenIndex(pContainer);
ReleaseMutex(pContainer->hMutex);
return ret_del && (ret_open == ERROR_SUCCESS);
}
}
return FALSE;
}
/***********************************************************************
* FreeUrlCacheSpaceW (WININET.@)
/***********************************************************************
* FreeUrlCacheSpaceA (WININET.@)
*
* See FreeUrlCacheSpaceW.
*/
BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR lpszCachePath, DWORD dwSize, DWORD dwFilter)
BOOL WINAPI FreeUrlCacheSpaceA(LPCSTR lpszCachePath, DWORD dwSize, DWORD dwSizeType)
{
FIXME("stub!\n");
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
BOOL ret = FALSE;
LPWSTR path = heap_strdupAtoW(lpszCachePath);
if (lpszCachePath == NULL || path != NULL)
ret = FreeUrlCacheSpaceW(path, dwSize, dwSizeType);
heap_free(path);
return ret;
}
/***********************************************************************
@ -1913,10 +2004,6 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl);
TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo);
pUrlEntry->dwHitRate++;
pUrlEntry->dwUseCount++;
URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount);
error = URLCache_CopyEntry(pContainer, pHeader, lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize, pUrlEntry,
FALSE);
@ -1928,6 +2015,11 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
}
TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName));
pUrlEntry->dwHitRate++;
pUrlEntry->dwUseCount++;
URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount);
GetSystemTimeAsFileTime(&pUrlEntry->LastAccessTime);
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return TRUE;
@ -2009,10 +2101,6 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW(
TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl);
TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo);
pUrlEntry->dwHitRate++;
pUrlEntry->dwUseCount++;
URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount);
error = URLCache_CopyEntry(
pContainer,
pHeader,
@ -2028,11 +2116,57 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW(
}
TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName));
pUrlEntry->dwHitRate++;
pUrlEntry->dwUseCount++;
URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount);
GetSystemTimeAsFileTime(&pUrlEntry->LastAccessTime);
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return TRUE;
}
static BOOL DeleteUrlCacheEntryInternal(LPURLCACHE_HEADER pHeader,
struct _HASH_ENTRY *pHashEntry)
{
CACHEFILE_ENTRY * pEntry;
URL_CACHEFILE_ENTRY * pUrlEntry;
pEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
if (pEntry->dwSignature != URL_SIGNATURE)
{
FIXME("Trying to delete entry of unknown format %s\n",
debugstr_an((LPCSTR)&pEntry->dwSignature, sizeof(DWORD)));
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
if (pUrlEntry->CacheDir < pHeader->DirectoryCount)
{
if (pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles)
pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles--;
}
if (pUrlEntry->CacheEntryType & STICKY_CACHE_ENTRY)
{
if (pUrlEntry->size.QuadPart < pHeader->ExemptUsage.QuadPart)
pHeader->ExemptUsage.QuadPart -= pUrlEntry->size.QuadPart;
else
pHeader->ExemptUsage.QuadPart = 0;
}
else
{
if (pUrlEntry->size.QuadPart < pHeader->CacheUsage.QuadPart)
pHeader->CacheUsage.QuadPart -= pUrlEntry->size.QuadPart;
else
pHeader->CacheUsage.QuadPart = 0;
}
URLCache_DeleteEntry(pHeader, pEntry);
URLCache_DeleteEntryFromHash(pHashEntry);
return TRUE;
}
/***********************************************************************
* UnlockUrlCacheEntryFileA (WININET.@)
*
@ -2450,8 +2584,7 @@ static BOOL CommitUrlCacheEntryInternal(
DWORD dwOffsetLocalFileName = 0;
DWORD dwOffsetHeader = 0;
DWORD dwOffsetFileExtension = 0;
DWORD dwFileSizeLow = 0;
DWORD dwFileSizeHigh = 0;
LARGE_INTEGER file_size;
BYTE cDirectory = 0;
char achFile[MAX_PATH];
LPSTR lpszUrlNameA = NULL;
@ -2468,9 +2601,15 @@ static BOOL CommitUrlCacheEntryInternal(
debugstr_w(lpszFileExtension),
debugstr_w(lpszOriginalUrl));
if (CacheEntryType & STICKY_CACHE_ENTRY && !lpszLocalFileName)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (lpszOriginalUrl)
WARN(": lpszOriginalUrl ignored\n");
file_size.QuadPart = 0;
if (lpszLocalFileName)
{
HANDLE hFile;
@ -2483,8 +2622,7 @@ static BOOL CommitUrlCacheEntryInternal(
}
/* Get file size */
dwFileSizeLow = GetFileSize(hFile, &dwFileSizeHigh);
if ((dwFileSizeLow == INVALID_FILE_SIZE) && (GetLastError() != NO_ERROR))
if (!GetFileSizeEx(hFile, &file_size))
{
ERR("couldn't get file size (error is %d)\n", GetLastError());
CloseHandle(hFile);
@ -2607,20 +2745,24 @@ static BOOL CommitUrlCacheEntryInternal(
pUrlEntry->CacheDir = cDirectory;
pUrlEntry->CacheEntryType = CacheEntryType;
pUrlEntry->dwHeaderInfoSize = dwHeaderSize;
pUrlEntry->dwExemptDelta = 0;
if (CacheEntryType & STICKY_CACHE_ENTRY)
{
/* Sticky entries have a default exempt time of one day */
pUrlEntry->dwExemptDelta = 86400;
}
else
pUrlEntry->dwExemptDelta = 0;
pUrlEntry->dwHitRate = 0;
pUrlEntry->dwOffsetFileExtension = dwOffsetFileExtension;
pUrlEntry->dwOffsetHeaderInfo = dwOffsetHeader;
pUrlEntry->dwOffsetLocalName = dwOffsetLocalFileName;
pUrlEntry->dwOffsetUrl = DWORD_ALIGN(sizeof(*pUrlEntry));
pUrlEntry->dwSizeHigh = 0;
pUrlEntry->dwSizeLow = dwFileSizeLow;
pUrlEntry->dwSizeHigh = dwFileSizeHigh;
pUrlEntry->size.QuadPart = file_size.QuadPart;
pUrlEntry->dwUseCount = 0;
GetSystemTimeAsFileTime(&pUrlEntry->LastAccessTime);
pUrlEntry->LastModifiedTime = LastModifiedTime;
FileTimeToDosDateTime(&pUrlEntry->LastAccessTime, &pUrlEntry->wLastSyncDate, &pUrlEntry->wLastSyncTime);
FileTimeToDosDateTime(&ExpireTime, &pUrlEntry->wExpiredDate, &pUrlEntry->wExpiredTime);
URLCache_FileTimeToDosDateTime(&pUrlEntry->LastAccessTime, &pUrlEntry->wLastSyncDate, &pUrlEntry->wLastSyncTime);
URLCache_FileTimeToDosDateTime(&ExpireTime, &pUrlEntry->wExpiredDate, &pUrlEntry->wExpiredTime);
pUrlEntry->wUnknownDate = pUrlEntry->wLastSyncDate;
pUrlEntry->wUnknownTime = pUrlEntry->wLastSyncTime;
@ -2646,6 +2788,18 @@ static BOOL CommitUrlCacheEntryInternal(
(DWORD)((LPBYTE)pUrlEntry - (LPBYTE)pHeader));
if (error != ERROR_SUCCESS)
URLCache_DeleteEntry(pHeader, &pUrlEntry->CacheFileEntry);
else
{
if (pUrlEntry->CacheDir < pHeader->DirectoryCount)
pHeader->directory_data[pUrlEntry->CacheDir].dwNumFiles++;
if (CacheEntryType & STICKY_CACHE_ENTRY)
pHeader->ExemptUsage.QuadPart += file_size.QuadPart;
else
pHeader->CacheUsage.QuadPart += file_size.QuadPart;
if (pHeader->CacheUsage.QuadPart + pHeader->ExemptUsage.QuadPart >
pHeader->CacheLimit.QuadPart)
FIXME("file of size %s bytes fills cache\n", wine_dbgstr_longlong(file_size.QuadPart));
}
cleanup:
URLCacheContainer_UnlockIndex(pContainer, pHeader);
@ -2855,7 +3009,7 @@ HANDLE WINAPI RetrieveUrlCacheEntryStreamA(
return FALSE;
/* allocate handle storage space */
pStream = HeapAlloc(GetProcessHeap(), 0, sizeof(STREAM_HANDLE) + strlen(lpszUrlName) * sizeof(CHAR));
pStream = heap_alloc(sizeof(STREAM_HANDLE) + strlen(lpszUrlName) * sizeof(CHAR));
if (!pStream)
{
CloseHandle(hFile);
@ -2880,9 +3034,53 @@ HANDLE WINAPI RetrieveUrlCacheEntryStreamW(
IN DWORD dwReserved
)
{
FIXME( "(%s, %p, %p, %x, 0x%08x)\n", debugstr_w(lpszUrlName), lpCacheEntryInfo,
DWORD size;
int url_len;
/* NOTE: this is not the same as the way that the native
* version allocates 'stream' handles. I did it this way
* as it is much easier and no applications should depend
* on this behaviour. (Native version appears to allocate
* indices into a table)
*/
STREAM_HANDLE * pStream;
HANDLE hFile;
TRACE( "(%s, %p, %p, %x, 0x%08x)\n", debugstr_w(lpszUrlName), lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize, fRandomRead, dwReserved );
return NULL;
if (!RetrieveUrlCacheEntryFileW(lpszUrlName,
lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize,
dwReserved))
{
return NULL;
}
hFile = CreateFileW(lpCacheEntryInfo->lpszLocalFileName,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
fRandomRead ? FILE_FLAG_RANDOM_ACCESS : 0,
NULL);
if (hFile == INVALID_HANDLE_VALUE)
return FALSE;
/* allocate handle storage space */
size = sizeof(STREAM_HANDLE);
url_len = WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, NULL, 0, NULL, NULL);
size += url_len;
pStream = heap_alloc(size);
if (!pStream)
{
CloseHandle(hFile);
SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
}
pStream->hFile = hFile;
WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, pStream->lpszUrl, url_len, NULL, NULL);
return pStream;
}
/***********************************************************************
@ -2931,8 +3129,8 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
URLCACHECONTAINER * pContainer;
LPURLCACHE_HEADER pHeader;
struct _HASH_ENTRY * pHashEntry;
CACHEFILE_ENTRY * pEntry;
DWORD error;
BOOL ret;
TRACE("(%s)\n", debugstr_a(lpszUrlName));
@ -2961,14 +3159,11 @@ BOOL WINAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName)
return FALSE;
}
pEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
URLCache_DeleteEntry(pHeader, pEntry);
URLCache_DeleteEntryFromHash(pHashEntry);
ret = DeleteUrlCacheEntryInternal(pHeader, pHashEntry);
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return TRUE;
return ret;
}
/***********************************************************************
@ -2980,9 +3175,9 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
URLCACHECONTAINER * pContainer;
LPURLCACHE_HEADER pHeader;
struct _HASH_ENTRY * pHashEntry;
CACHEFILE_ENTRY * pEntry;
LPSTR urlA;
DWORD error;
BOOL ret;
TRACE("(%s)\n", debugstr_w(lpszUrlName));
@ -3024,15 +3219,12 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
return FALSE;
}
pEntry = (CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
URLCache_DeleteEntry(pHeader, pEntry);
URLCache_DeleteEntryFromHash(pHashEntry);
ret = DeleteUrlCacheEntryInternal(pHeader, pHashEntry);
URLCacheContainer_UnlockIndex(pContainer, pHeader);
HeapFree(GetProcessHeap(), 0, urlA);
return TRUE;
return ret;
}
BOOL WINAPI DeleteUrlCacheContainerA(DWORD d1, DWORD d2)
@ -3165,7 +3357,7 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryA(LPCSTR lpszUrlSearchPattern,
TRACE("(%s, %p, %p)\n", debugstr_a(lpszUrlSearchPattern), lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize);
pEntryHandle = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEntryHandle));
pEntryHandle = heap_alloc(sizeof(*pEntryHandle));
if (!pEntryHandle)
return NULL;
@ -3204,7 +3396,7 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryW(LPCWSTR lpszUrlSearchPattern,
TRACE("(%s, %p, %p)\n", debugstr_w(lpszUrlSearchPattern), lpFirstCacheEntryInfo, lpdwFirstCacheEntryInfoBufferSize);
pEntryHandle = HeapAlloc(GetProcessHeap(), 0, sizeof(*pEntryHandle));
pEntryHandle = heap_alloc(sizeof(*pEntryHandle));
if (!pEntryHandle)
return NULL;
@ -3232,19 +3424,15 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryW(LPCWSTR lpszUrlSearchPattern,
return pEntryHandle;
}
/***********************************************************************
* FindNextUrlCacheEntryA (WININET.@)
*/
BOOL WINAPI FindNextUrlCacheEntryA(
static BOOL FindNextUrlCacheEntryInternal(
HANDLE hEnumHandle,
LPINTERNET_CACHE_ENTRY_INFOA lpNextCacheEntryInfo,
LPDWORD lpdwNextCacheEntryInfoBufferSize)
LPDWORD lpdwNextCacheEntryInfoBufferSize,
BOOL unicode)
{
URLCacheFindEntryHandle *pEntryHandle = (URLCacheFindEntryHandle *)hEnumHandle;
URLCACHECONTAINER * pContainer;
TRACE("(%p, %p, %p)\n", hEnumHandle, lpNextCacheEntryInfo, lpdwNextCacheEntryInfoBufferSize);
if (pEntryHandle->dwMagic != URLCACHE_FIND_ENTRY_HANDLE_MAGIC)
{
SetLastError(ERROR_INVALID_HANDLE);
@ -3282,8 +3470,10 @@ BOOL WINAPI FindNextUrlCacheEntryA(
continue;
pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry;
TRACE("Found URL: %s\n", (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl);
TRACE("Header info: %s\n", (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo);
TRACE("Found URL: %s\n",
debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetUrl));
TRACE("Header info: %s\n",
debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo));
error = URLCache_CopyEntry(
pContainer,
@ -3291,14 +3481,15 @@ BOOL WINAPI FindNextUrlCacheEntryA(
lpNextCacheEntryInfo,
lpdwNextCacheEntryInfoBufferSize,
pUrlEntry,
FALSE /* not UNICODE */);
unicode);
if (error != ERROR_SUCCESS)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
SetLastError(error);
return FALSE;
}
TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName));
TRACE("Local File Name: %s\n",
debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName));
/* increment the current index so that next time the function
* is called the next entry is returned */
@ -3315,6 +3506,20 @@ BOOL WINAPI FindNextUrlCacheEntryA(
return FALSE;
}
/***********************************************************************
* FindNextUrlCacheEntryA (WININET.@)
*/
BOOL WINAPI FindNextUrlCacheEntryA(
HANDLE hEnumHandle,
LPINTERNET_CACHE_ENTRY_INFOA lpNextCacheEntryInfo,
LPDWORD lpdwNextCacheEntryInfoBufferSize)
{
TRACE("(%p, %p, %p)\n", hEnumHandle, lpNextCacheEntryInfo, lpdwNextCacheEntryInfoBufferSize);
return FindNextUrlCacheEntryInternal(hEnumHandle, lpNextCacheEntryInfo,
lpdwNextCacheEntryInfoBufferSize, FALSE /* not UNICODE */);
}
/***********************************************************************
* FindNextUrlCacheEntryW (WININET.@)
*/
@ -3324,9 +3529,11 @@ BOOL WINAPI FindNextUrlCacheEntryW(
LPDWORD lpdwNextCacheEntryInfoBufferSize
)
{
FIXME("(%p, %p, %p) stub\n", hEnumHandle, lpNextCacheEntryInfo, lpdwNextCacheEntryInfoBufferSize);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
TRACE("(%p, %p, %p)\n", hEnumHandle, lpNextCacheEntryInfo, lpdwNextCacheEntryInfoBufferSize);
return FindNextUrlCacheEntryInternal(hEnumHandle,
(LPINTERNET_CACHE_ENTRY_INFOA)lpNextCacheEntryInfo,
lpdwNextCacheEntryInfoBufferSize, TRUE /* UNICODE */);
}
/***********************************************************************
@ -3456,8 +3663,6 @@ BOOL WINAPI GetUrlCacheConfigInfoW(LPINTERNET_CACHE_CONFIG_INFOW CacheInfo, LPDW
/***********************************************************************
* GetUrlCacheConfigInfoA (WININET.@)
*
* CacheInfo is some CACHE_CONFIG_INFO structure, with no MS info found by google
*/
BOOL WINAPI GetUrlCacheConfigInfoA(LPINTERNET_CACHE_CONFIG_INFOA CacheInfo, LPDWORD size, DWORD bitmask)
{
@ -3531,6 +3736,24 @@ DWORD WINAPI DeleteIE3Cache(HWND hWnd, HINSTANCE hInst, LPSTR lpszCmdLine, int n
return 0;
}
static BOOL IsUrlCacheEntryExpiredInternal(const URL_CACHEFILE_ENTRY *pUrlEntry,
FILETIME *pftLastModified)
{
BOOL ret;
FILETIME now, expired;
*pftLastModified = pUrlEntry->LastModifiedTime;
GetSystemTimeAsFileTime(&now);
URLCache_DosDateTimeToFileTime(pUrlEntry->wExpiredDate,
pUrlEntry->wExpiredTime, &expired);
/* If the expired time is 0, it's interpreted as not expired */
if (!expired.dwLowDateTime && !expired.dwHighDateTime)
ret = FALSE;
else
ret = CompareFileTime(&expired, &now) < 0;
return ret;
}
/***********************************************************************
* IsUrlCacheEntryExpiredA (WININET.@)
*
@ -3546,51 +3769,57 @@ BOOL WINAPI IsUrlCacheEntryExpiredA( LPCSTR url, DWORD dwFlags, FILETIME* pftLas
const CACHEFILE_ENTRY * pEntry;
const URL_CACHEFILE_ENTRY * pUrlEntry;
URLCACHECONTAINER * pContainer;
DWORD error;
BOOL expired;
TRACE("(%s, %08x, %p)\n", debugstr_a(url), dwFlags, pftLastModified);
error = URLCacheContainers_FindContainerA(url, &pContainer);
if (error != ERROR_SUCCESS)
if (!url || !pftLastModified)
return TRUE;
if (dwFlags)
FIXME("unknown flags 0x%08x\n", dwFlags);
/* Any error implies that the URL is expired, i.e. not in the cache */
if (URLCacheContainers_FindContainerA(url, &pContainer))
{
SetLastError(error);
return FALSE;
memset(pftLastModified, 0, sizeof(*pftLastModified));
return TRUE;
}
error = URLCacheContainer_OpenIndex(pContainer);
if (error != ERROR_SUCCESS)
if (URLCacheContainer_OpenIndex(pContainer))
{
SetLastError(error);
return FALSE;
memset(pftLastModified, 0, sizeof(*pftLastModified));
return TRUE;
}
if (!(pHeader = URLCacheContainer_LockIndex(pContainer)))
return FALSE;
{
memset(pftLastModified, 0, sizeof(*pftLastModified));
return TRUE;
}
if (!URLCache_FindHash(pHeader, url, &pHashEntry))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
memset(pftLastModified, 0, sizeof(*pftLastModified));
TRACE("entry %s not found!\n", url);
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
return TRUE;
}
pEntry = (const CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
if (pEntry->dwSignature != URL_SIGNATURE)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
memset(pftLastModified, 0, sizeof(*pftLastModified));
FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPCSTR)&pEntry->dwSignature, sizeof(DWORD)));
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
return TRUE;
}
pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry;
DosDateTimeToFileTime(pUrlEntry->wExpiredDate, pUrlEntry->wExpiredTime, pftLastModified);
expired = IsUrlCacheEntryExpiredInternal(pUrlEntry, pftLastModified);
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return TRUE;
return expired;
}
/***********************************************************************
@ -3608,51 +3837,65 @@ BOOL WINAPI IsUrlCacheEntryExpiredW( LPCWSTR url, DWORD dwFlags, FILETIME* pftLa
const CACHEFILE_ENTRY * pEntry;
const URL_CACHEFILE_ENTRY * pUrlEntry;
URLCACHECONTAINER * pContainer;
DWORD error;
BOOL expired;
TRACE("(%s, %08x, %p)\n", debugstr_w(url), dwFlags, pftLastModified);
error = URLCacheContainers_FindContainerW(url, &pContainer);
if (error != ERROR_SUCCESS)
if (!url || !pftLastModified)
return TRUE;
if (dwFlags)
FIXME("unknown flags 0x%08x\n", dwFlags);
/* Any error implies that the URL is expired, i.e. not in the cache */
if (URLCacheContainers_FindContainerW(url, &pContainer))
{
SetLastError(error);
return FALSE;
memset(pftLastModified, 0, sizeof(*pftLastModified));
return TRUE;
}
error = URLCacheContainer_OpenIndex(pContainer);
if (error != ERROR_SUCCESS)
if (URLCacheContainer_OpenIndex(pContainer))
{
SetLastError(error);
return FALSE;
memset(pftLastModified, 0, sizeof(*pftLastModified));
return TRUE;
}
if (!(pHeader = URLCacheContainer_LockIndex(pContainer)))
return FALSE;
{
memset(pftLastModified, 0, sizeof(*pftLastModified));
return TRUE;
}
if (!URLCache_FindHashW(pHeader, url, &pHashEntry))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
memset(pftLastModified, 0, sizeof(*pftLastModified));
TRACE("entry %s not found!\n", debugstr_w(url));
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
return TRUE;
}
if (!URLCache_FindHashW(pHeader, url, &pHashEntry))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
memset(pftLastModified, 0, sizeof(*pftLastModified));
TRACE("entry %s not found!\n", debugstr_w(url));
return TRUE;
}
pEntry = (const CACHEFILE_ENTRY *)((LPBYTE)pHeader + pHashEntry->dwOffsetEntry);
if (pEntry->dwSignature != URL_SIGNATURE)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
memset(pftLastModified, 0, sizeof(*pftLastModified));
FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPCSTR)&pEntry->dwSignature, sizeof(DWORD)));
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
return TRUE;
}
pUrlEntry = (const URL_CACHEFILE_ENTRY *)pEntry;
DosDateTimeToFileTime(pUrlEntry->wExpiredDate, pUrlEntry->wExpiredTime, pftLastModified);
expired = IsUrlCacheEntryExpiredInternal(pUrlEntry, pftLastModified);
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return TRUE;
return expired;
}
/***********************************************************************

View file

@ -172,7 +172,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
len = strlenW(lpszServerName);
sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, NULL, 0, NULL, NULL );
if (!(name = HeapAlloc( GetProcessHeap(), 0, sz + 1 ))) return FALSE;
if (!(name = heap_alloc(sz + 1))) return FALSE;
WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL );
name[sz] = 0;
@ -320,7 +320,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
case INTERNET_STATUS_NAME_RESOLVED:
case INTERNET_STATUS_CONNECTING_TO_SERVER:
case INTERNET_STATUS_CONNECTED_TO_SERVER:
lpvNewInfo = HeapAlloc(GetProcessHeap(), 0, strlen(lpvStatusInfo) + 1);
lpvNewInfo = heap_alloc(strlen(lpvStatusInfo) + 1);
if (lpvNewInfo) strcpy(lpvNewInfo, lpvStatusInfo);
break;
case INTERNET_STATUS_RESOLVING_NAME:
@ -379,7 +379,7 @@ void SendAsyncCallback(object_header_t *hdr, DWORD_PTR dwContext,
if (lpvStatusInfo)
{
lpvStatusInfo_copy = HeapAlloc(GetProcessHeap(), 0, dwStatusInfoLength);
lpvStatusInfo_copy = heap_alloc(dwStatusInfoLength);
memcpy(lpvStatusInfo_copy, lpvStatusInfo, dwStatusInfoLength);
}

View file

@ -20,7 +20,7 @@
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Âúâåäåòå ìðåæîâà ïàðîëà"
FONT 8, "MS Shell Dlg"
@ -39,8 +39,3 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Îòìåíè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "LAN âðúçêà"
}

View file

@ -25,7 +25,7 @@ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
/* Czech strings in CP1250 */
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Zadání sí<73>ového hesla"
FONT 8, "MS Shell Dlg"

View file

@ -1,5 +1,6 @@
/*
* Copyright 2008 Jens Albretsen
* 2010 Thomas Larsen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -18,11 +19,13 @@
#include "resource.h"
#pragma code_page(65001)
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Skriv netværkskodeord"
CAPTION "Skriv netværkskodeord"
FONT 8, "MS Shell Dlg"
{
LTEXT "Skriv dit brugernavn og kodeord:", -1, 40, 6, 150, 15
@ -40,7 +43,22 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Annuller", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Godkendelse Påkrævet"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "Lokal netværksforbindelse"
LTEXT "Indtast venligst, dit brugernavn og adgangskode:", -1, 40, 6, 150, 15
LTEXT "Server", -1, 40, 26, 50, 10
LTEXT "Domæne", -1, 40, 46, 50, 10
LTEXT "Bruger", -1, 40, 66, 50, 10
LTEXT "Adgangskode", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Gem denne adgangskode (usikker)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Annuller", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -1,6 +1,6 @@
/*
* Copyright 2004 Henning Gerhardt
* Copyright 2009 André Hentschel
* Copyright 2009-2010 André Hentschel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -23,7 +23,7 @@
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Netzwerkkennung eingeben"
FONT 8, "MS Shell Dlg"
@ -43,7 +43,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Abbrechen", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Benutzeranmeldung"
FONT 8, "MS Shell Dlg"
@ -63,7 +63,14 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Abbrechen", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Sicherheits Warnung"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "LAN Verbindung"
LTEXT "Es gibt ein Problem mit dem Zertifikat dieser Seite.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "Möchten Sie dennoch fortfahren?", -1, 40, 46, 200, 20
PUSHBUTTON "Ja", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Nein", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -20,7 +20,7 @@
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Enter Network Password"
FONT 8, "MS Shell Dlg"
@ -40,7 +40,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Cancel", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Authentication Required"
FONT 8, "MS Shell Dlg"
@ -60,7 +60,14 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Cancel", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Security Warning"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "LAN Connection"
LTEXT "There is a problem with the certificate for this site.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "Do you want to continue anyway?", -1, 40, 46, 200, 20
PUSHBUTTON "Yes", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "No", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -1,5 +1,5 @@
/*
* Copyright 2003, 2005 José Manuel Ferrer Ortiz
/*
* Copyright 2003, 2005 José Manuel Ferrer Ortiz
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -20,27 +20,42 @@
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Introduzca contraseña de red"
CAPTION "Introduzca contraseña de red"
FONT 8, "MS Shell Dlg"
{
LTEXT "Por favor introduzca su nombre de usuario y contraseña:", -1, 40, 6, 150, 15
LTEXT "Por favor introduzca su nombre de usuario y contraseña:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Dominio", -1, 40, 46, 50, 10
LTEXT "Usuario", -1, 40, 66, 50, 10
LTEXT "Contraseña", -1, 40, 86, 50, 10
LTEXT "Contraseña", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Guardar esta contraseña (inseguro)", IDC_SAVEPASSWORD,
CHECKBOX "&Guardar esta contraseña (inseguro)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Aceptar", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Autentificación Requerida"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "Conexión LAN"
LTEXT "Por favor introduzca su nombre de usuario y contraseña:", -1, 40, 6, 150, 15
LTEXT "Servidor", -1, 40, 26, 50, 10
LTEXT "Dominio", -1, 40, 46, 50, 10
LTEXT "Usuario", -1, 40, 66, 50, 10
LTEXT "Contraseña", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Guardar esta contraseña (inseguro)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Aceptar", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -1,4 +1,4 @@
/*
/*
* Copyright 2005 Kimmo Myllyvirta
*
* This library is free software; you can redistribute it and/or
@ -20,27 +20,22 @@
LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Anna Verkon Salasana"
CAPTION "Anna verkon salasana"
FONT 8, "MS Shell Dlg"
{
LTEXT "Anna käyttäjän nimi ja salasana:", -1, 40, 6, 150, 15
LTEXT "Välityspalvelin", -1, 40, 26, 50, 10
LTEXT "Anna käyttäjän nimi ja salasana:", -1, 40, 6, 150, 15
LTEXT "Välityspalvelin", -1, 40, 26, 50, 10
LTEXT "Alue", -1, 40, 46, 50, 10
LTEXT "Käyttäjä", -1, 40, 66, 50, 10
LTEXT "Käyttäjä", -1, 40, 66, 50, 10
LTEXT "Salasana", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Tallenna tämä salasana (epäturvallinen)", IDC_SAVEPASSWORD,
CHECKBOX "&Tallenna tämä salasana (epäturvallinen)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Peruuta", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Lähiverkkoyhteys"
}

View file

@ -5,7 +5,7 @@
* Copyright 2003 Mike McCormack for CodeWeavers
* Copyright 2003 Vincent Béron
* Copyright 2005 Jonathan Ernst
* Copyright 2009 Frédéric Delanoy
* Copyright 2009-2010 Frédéric Delanoy
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -29,7 +29,7 @@
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 218, 150
IDD_PROXYDLG DIALOG 36, 24, 218, 150
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Entrez le mot de passe réseau"
FONT 8, "MS Shell Dlg"
@ -49,7 +49,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Annuler", IDCANCEL, 147, 128, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 218, 150
IDD_AUTHDLG DIALOG 36, 24, 218, 150
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Authentification requise"
FONT 8, "MS Shell Dlg"
@ -69,7 +69,14 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Annuler", IDCANCEL, 147, 128, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Alerte de sécurité"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "Connexion réseau local (LAN)"
LTEXT "Le certificat pour ce site pose problème.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "Voulez-vous tout de même continuer ?", -1, 40, 46, 200, 20
PUSHBUTTON "Oui", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Non", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -1,5 +1,5 @@
/*
* Copyright 2006 Andras Kovacs
* Copyright 2006-2010 Andras Kovacs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -20,27 +20,45 @@
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
/* UTF-8 */
#pragma code_page(65001)
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Hálózati jelszó megadása"
CAPTION "Hálózati jelszó megadása"
FONT 8, "MS Shell Dlg"
{
LTEXT "Kérem adja meg a felhasználónevet, és jelszót:", -1, 40, 6, 150, 15
LTEXT "Kérem adja meg a felhasználónevet és jelszót:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Csoport", -1, 40, 46, 50, 10
LTEXT "Felhasználó", -1, 40, 66, 50, 10
LTEXT "Jelszó", -1, 40, 86, 50, 10
LTEXT "Felhasználó", -1, 40, 66, 50, 10
LTEXT "Jelszó", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Jelszó mentése (nem biztonságos)", IDC_SAVEPASSWORD,
CHECKBOX "&Jelszó mentése (nem biztonságos)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Mégse", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Mégse", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Hitelesítés szükséges"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "LAN kapcsolat"
LTEXT "Kérem adja meg a felhasználónevet és jelszót:", -1, 40, 6, 150, 15
LTEXT "Kiszolgáló", -1, 40, 26, 50, 10
LTEXT "Tartomány", -1, 40, 46, 50, 10
LTEXT "Felhasználó", -1, 40, 66, 50, 10
LTEXT "Jelszó", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "Jel&szó elmentése (nem biztonságos)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Mégse", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -2,6 +2,7 @@
* Copyright 2003 Mike McCormack for CodeWeavers
* Copyright 2003 Ivan Leo Puoti
* Copyright 2006 Antonio Codazzi
* Copyright 2010 Luca Bennati
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -20,49 +21,59 @@
#include "resource.h"
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Inserire la password di rete"
FONT 8, "MS Shell Dlg"
{
LTEXT "Inserire il nome utente e la password:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Dominio", -1, 40, 46, 50, 10
LTEXT "Utente", -1, 40, 66, 50, 10
LTEXT "Password", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Memorizza la password ( RISCHIOSO )", IDC_SAVEPASSWORD,
CHECKBOX "&Memorizza la password (non sicuro)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Ok", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Annulla", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Autenticazione richiesta"
FONT 8, "MS Shell Dlg"
{
LTEXT "Inserire il nome utente e la password:", -1, 40, 6, 150, 15
LTEXT "Server", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Dominio", -1, 40, 46, 50, 10
LTEXT "Utente", -1, 40, 66, 50, 10
LTEXT "Password", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Memorizza la password (RISCHIOSO)", IDC_SAVEPASSWORD,
CHECKBOX "&Memorizza la password (non sicuro)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Ok", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Annulla", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Avviso di sicurezza"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "Connessione LAN"
LTEXT "È presente un problema con il certificato per questo sito.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "Vuoi continuare comunque?", -1, 40, 46, 200, 20
PUSHBUTTON "Sì", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "No", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -23,14 +23,14 @@
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "ネットワーク パスワードの入力"
FONT 9, "MS Shell Dlg"
{
LTEXT "ユーザ名とパスワードを入力して下さい:", -1, 40, 6, 150, 15
LTEXT "プロキシ", -1, 40, 26, 50, 10
LTEXT "域", -1, 40, 46, 50, 10
LTEXT "域", -1, 40, 46, 50, 10
LTEXT "ユーザ名", -1, 40, 66, 50, 10
LTEXT "パスワード", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
@ -43,7 +43,22 @@ FONT 9, "MS Shell Dlg"
PUSHBUTTON "キャンセル", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "認証が必要です"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "LAN 接続"
LTEXT "ユーザ名とパスワードを入力して下さい:", -1, 40, 6, 150, 15
LTEXT "サーバ", -1, 40, 26, 50, 10
LTEXT "領域", -1, 40, 46, 50, 10
LTEXT "ユーザ名", -1, 40, 66, 50, 10
LTEXT "パスワード", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "パスワードを保存する(&S)(セキュアではありません)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "キャンセル", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -1,6 +1,7 @@
/*
* Copyright 2005,2007 YunSong Hwang
*
* Copyright 2003 Mike McCormack for CodeWeavers
* Copyright 2005,2007,2010,2011 YunSong Hwang
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -18,29 +19,58 @@
#include "resource.h"
#pragma code_page(65001)
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "네트워크 암호 입력"
CAPTION "네트워크 암호 입력"
FONT 9, "MS Shell Dlg"
{
LTEXT "당신의 사용자 이름과 암호를 입력하시오:", -1, 40, 6, 150, 15
LTEXT "프록시", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "사용자", -1, 40, 66, 50, 10
LTEXT "암호", -1, 40, 86, 50, 10
LTEXT "당신의 사용자 이름과 암호를 입력하시오:", -1, 40, 6, 150, 15
LTEXT "프록시", -1, 40, 26, 50, 10
LTEXT "영역", -1, 40, 46, 50, 10
LTEXT "사용자", -1, 40, 66, 50, 10
LTEXT "암호", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "암호 입력(&S)(주의하시오)", IDC_SAVEPASSWORD,
CHECKBOX "암호 저장(&S)(안전하지 못함)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "확인", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "취소", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "확인", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "취소", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "인증 필요"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "랜 연결"
LTEXT "당신의 사용자 이름과 암호를 입력하십시오:", -1, 40, 6, 150, 15
LTEXT "서버", -1, 40, 26, 50, 10
LTEXT "영역", -1, 40, 46, 50, 10
LTEXT "사용자", -1, 40, 66, 50, 10
LTEXT "암호", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "암호 저장(&S) (안전하지 못함)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "확인", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "취소", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "보안 경고"
FONT 8, "MS Shell Dlg"
{
LTEXT "이 사이트의 인증서에 문제가 있습니다.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "그래도 계속 진행하겠습니까?", -1, 40, 46, 200, 20
PUSHBUTTON "예", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "아니오", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -1,5 +1,5 @@
/*
* Copyright 2009 Aurimas Fišeras <aurimas@gmail.com>
* Copyright 2009-2010 Aurimas Fišeras <aurimas@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -23,7 +23,7 @@
LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Įveskite tinklo slaptažodį"
FONT 8, "MS Shell Dlg"
@ -43,7 +43,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Atsisakyti", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Reikalingas tapatumo nustatymas"
FONT 8, "MS Shell Dlg"
@ -63,7 +63,14 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Atsisakyti", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Įspėjimas apie saugumą"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "Vietinio tinklo ryšys"
LTEXT "Yra nesklandumų su šios svetainės liudijimu.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "Ar vistiek norite tęsti?", -1, 40, 46, 200, 20
PUSHBUTTON "Taip", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Ne", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -22,7 +22,9 @@
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
#pragma code_page(65001)
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Netwerkwachtwoord invoeren"
FONT 8, "MS Shell Dlg"
@ -42,7 +44,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Annuleren", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Authenticatie vereist"
FONT 8, "MS Shell Dlg"
@ -62,7 +64,14 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Annuleren", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Veiligheidswaarschuwing"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "LAN Verbinding"
LTEXT "Er is een probleem met het certificaat voor deze site.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "Wilt u toch doorgaan?", -1, 40, 46, 200, 20
PUSHBUTTON "Ja", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Nee", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -22,7 +22,7 @@
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Skriv inn nettverkspassord"
FONT 8, "MS Shell Dlg"
@ -42,7 +42,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Pålogging"
FONT 8, "MS Shell Dlg"
@ -61,8 +61,3 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Lokal nettverksforbindelse"
}

View file

@ -1,6 +1,7 @@
/*
/*
* Copyright 2003 Mike McCormack for CodeWeavers
* Copyright 2006 Mikolaj Zalewski
* Copyright 2010 £ukasz Wojni³owicz
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -21,27 +22,54 @@
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "WprowadŸ has³o do sieci"
CAPTION "WprowadŸ has³o do sieci"
FONT 8, "MS Shell Dlg"
{
LTEXT "Proszê wprowadziæ nazwê u¿ytkownika i has³o:", -1, 40, 6, 150, 15
LTEXT "Proszê wprowadziæ nazwê u¿ytkownika i has³o:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Obszar", -1, 40, 46, 50, 10
LTEXT "U¿ytkonik", -1, 40, 66, 50, 10
LTEXT "Has³o", -1, 40, 86, 50, 10
LTEXT "U¿ytkownik", -1, 40, 66, 50, 10
LTEXT "Has³o", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Zapamiêtaj to has³o (nie bezpieczne)", IDC_SAVEPASSWORD,
CHECKBOX "&Zapamiêtaj to has³o (niebezpieczne)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Anuluj", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Wymagane uwierzytelnienie "
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "Po³¹czenie LAN"
LTEXT "Proszê wprowadziæ nazwê u¿ytkownika i has³o:", -1, 40, 6, 150, 15
LTEXT "Serwer", -1, 40, 26, 50, 10
LTEXT "Obszar", -1, 40, 46, 50, 10
LTEXT "U¿ytkownik", -1, 40, 66, 50, 10
LTEXT "Has³o", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Zapamiêtaj to has³o (niebezpieczne)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Anuluj", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ostrze¿enie o zabezpieczeniach"
FONT 8, "MS Shell Dlg"
{
LTEXT "Wyst¹pi³ problem z certyfikatem dla tej strony.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "Czy mimo to chcesz kontynuowaæ?", -1, 40, 46, 200, 20
PUSHBUTTON "Tak", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Nie", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -2,6 +2,7 @@
* Copyright 2003 Marcelo Duarte
* Copyright 2006-2007 Américo José Melo
* Copyright 2009 Ricardo Filipe
* Copyright 2010 Gustavo Henrique Milaré
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -24,14 +25,14 @@
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Entrar Senha da Rede"
FONT 8, "MS Shell Dlg"
{
LTEXT "Por favor, entre com o nome de usuário e a senha:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Domínio", -1, 40, 46, 50, 10
LTEXT "Usuário", -1, 40, 66, 50, 10
LTEXT "Senha", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
@ -46,7 +47,7 @@ FONT 8, "MS Shell Dlg"
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Indicar Senha da Rede"
FONT 8, "MS Shell Dlg"
@ -66,7 +67,32 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Autenticação necessária"
FONT 8, "MS Shell Dlg"
{
LTEXT "Por favor insira o seu nome de usuário e senha:", -1, 40, 6, 150, 15
LTEXT "Servidor", -1, 40, 26, 50, 10
LTEXT "Domínio", -1, 40, 46, 50, 10
LTEXT "Usuário", -1, 40, 66, 50, 10
LTEXT "Senha", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Salvar esta senha (inseguro)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Autenticação necessária"
FONT 8, "MS Shell Dlg"
@ -85,17 +111,3 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Conexão LAN"
}
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Ligação LAN"
}

View file

@ -23,7 +23,7 @@ LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
#pragma code_page(65001)
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Introducere parolă de rețea"
FONT 8, "MS Shell Dlg"
@ -43,7 +43,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Renunță", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Autentificare necesară"
FONT 8, "MS Shell Dlg"
@ -62,8 +62,3 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Renunță", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Conexiune LAN"
}

View file

@ -25,7 +25,7 @@
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ввод сетевого пароля"
FONT 8, "MS Shell Dlg"
@ -45,7 +45,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Отмена", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Требуется идентификация"
FONT 8, "MS Shell Dlg"
@ -64,8 +64,3 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Отмена", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Сетевое подключение"
}

View file

@ -22,7 +22,7 @@
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Vnos omrežnega gesla"
FONT 8, "MS Shell Dlg"
@ -42,7 +42,7 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Prekliči", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Authentication Required"
FONT 8, "MS Shell Dlg"
@ -61,8 +61,3 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "V redu", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Prekliči", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "LAN povezava"
}

View file

@ -1,4 +1,4 @@
/*
/*
* Copyright 2007 Daniel Nylander
*
* This library is free software; you can redistribute it and/or
@ -20,27 +20,54 @@
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ange nätverkslösenord"
CAPTION "Ange nätverkslösenord"
FONT 8, "MS Shell Dlg"
{
LTEXT "Ange ditt användarnamn och lösenord:", -1, 40, 6, 150, 15
LTEXT "Ange ditt användarnamn och lösenord:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Domän", -1, 40, 46, 50, 10
LTEXT "Användarnamn", -1, 40, 66, 50, 10
LTEXT "Lösenord", -1, 40, 86, 50, 10
LTEXT "Domän", -1, 40, 46, 50, 10
LTEXT "Användare", -1, 40, 66, 50, 10
LTEXT "Lösenord", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Spara detta lösenord (osäkert)", IDC_SAVEPASSWORD,
CHECKBOX "&Spara detta lösenord (osäkert)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Autentisering krävs"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "LAN-anslutning"
LTEXT "Ange ditt användarnamn och lösenord:", -1, 40, 6, 150, 15
LTEXT "Server", -1, 40, 26, 50, 10
LTEXT "Domän", -1, 40, 46, 50, 10
LTEXT "Användare", -1, 40, 66, 50, 10
LTEXT "Lösenord", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Spara detta lösenord (osäkert)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_INVCERTDLG DIALOG 3, 24, 250, 86
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Säkerhetsvarning"
FONT 8, "MS Shell Dlg"
{
LTEXT "Ett problem upptäcktes med certifikatet för denna site.", -1, 40, 6, 200, 20
LTEXT "", IDC_CERT_ERROR, 40, 26, 200, 20
LTEXT "Vill du fortsätta ändå?", -1, 40, 46, 200, 20
PUSHBUTTON "Ja", IDOK, 40, 66, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Nej", IDCANCEL, 100, 66, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -1,7 +1,7 @@
/*
/*
* Turkish Resources
*
* Copyright 2006 Fatih Aşıcı
* Copyright 2006 Fatih Aþýcý
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -22,27 +22,22 @@
LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ağ Parolasını Girin"
CAPTION "Að Parolasýný Girin"
FONT 8, "MS Shell Dlg"
{
LTEXT "Lütfen kullanıcı adınızı ve parolanızı girin:", -1, 40, 6, 150, 15
LTEXT "Lütfen kullanýcý adýnýzý ve parolanýzý girin:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Kullanıcı", -1, 40, 66, 50, 10
LTEXT "Kullanýcý", -1, 40, 66, 50, 10
LTEXT "Parola", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "Bu parolayı &sakla (güvensiz)", IDC_SAVEPASSWORD,
CHECKBOX "Bu parolayý &sakla (güvensiz)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Tamam", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "İptal", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "LAN Bağlantısı"
PUSHBUTTON "Ýptal", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -1,7 +1,8 @@
/*
/*
* wininet.dll (Ukrainian resources)
*
* Copyright 2006 Artem Reznikov
* Copyright 2010 Igor Paliychuk
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -22,27 +23,42 @@
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ââåä³òü Ìåðåæíèé Ïàðîëü"
CAPTION "Ââåä³òü Ìåðåæíèé Ïàðîëü"
FONT 8, "MS Shell Dlg"
{
LTEXT "Áóäü ëàñêà, ââåä³òü Âàø³ ³ì'ÿ òà ïàðîëü:", -1, 40, 6, 150, 15
LTEXT "Ïðîêñ³", -1, 40, 26, 50, 10
LTEXT "Îáëàñòü", -1, 40, 46, 50, 10
LTEXT "Êîðèñòóâà÷", -1, 40, 66, 50, 10
LTEXT "Ïàðîëü", -1, 40, 86, 50, 10
LTEXT "Áóäü ëàñêà, ââåä³òü Âàø³ ³ì'ÿ òà ïàðîëü:", -1, 40, 6, 150, 15
LTEXT "Ïðîêñ³", -1, 40, 26, 50, 10
LTEXT "Îáëàñòü", -1, 40, 46, 50, 10
LTEXT "Êîðèñòóâà÷", -1, 40, 66, 50, 10
LTEXT "Ïàðîëü", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Çáåðåãòè öåé ïàðîëü (íåáåçïå÷íî)", IDC_SAVEPASSWORD,
CHECKBOX "&Çáåðåãòè öåé ïàðîëü (íåáåçïå÷íî)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Íåîáõ³äíà àâòîðèçàö³ÿ"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "ϳäêëþ÷åííÿ ïî ëîêàëüí³é ìåðåæ³"
LTEXT "Áóäü ëàñêà, ââåä³òü Âàø³ ³ì'ÿ òà ïàðîëü:", -1, 40, 6, 150, 15
LTEXT "Ñåðâåð", -1, 40, 26, 50, 10
LTEXT "Îáëàñòü", -1, 40, 46, 50, 10
LTEXT "Êîðèñòóâà÷", -1, 40, 66, 50, 10
LTEXT "Ïàðîëü", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Çáåðåãòè öåé ïàðîëü (íåáåçïå÷íî)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -2,6 +2,7 @@
* wininet (Simplified and Traditional Chinese Resources)
*
* Copyright 2008 Hongbo Ni <hongbo.at.njstar.com>
* Copyright 2010 Rex Tsai <chihchun.at.kalug.linux.org.tw>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -25,7 +26,7 @@
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "输入网络密码"
FONT 9, "MS Shell Dlg"
@ -45,34 +46,44 @@ FONT 9, "MS Shell Dlg"
PUSHBUTTON "取消", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "局域网连接"
}
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
IDD_PROXYDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "輸入網路密碼"
FONT 9, "MS Shell Dlg"
{
LTEXT "請輸入你的用戶名和密碼:", -1, 40, 6, 150, 15
LTEXT "代理", -1, 40, 26, 50, 10
LTEXT "請輸入您的帳號和密碼:", -1, 40, 6, 150, 15
LTEXT "代理伺服器", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "用戶", -1, 40, 66, 50, 10
LTEXT "帳號", -1, 40, 66, 50, 10
LTEXT "密碼", -1, 40, 86, 50, 10
LTEXT "", IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "儲存密碼(不安全)(&S)", IDC_SAVEPASSWORD,
CHECKBOX "儲存密碼 (不安全)(&S)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "確定", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "取消", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
IDD_AUTHDLG DIALOG 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "需要認證"
FONT 8, "MS Shell Dlg"
{
IDS_LANCONNECTION "局域網連接"
LTEXT "請輸入您的帳號和密碼:", -1, 40, 6, 150, 15
LTEXT "伺服器", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "帳號", -1, 40, 66, 50, 10
LTEXT "密碼", -1, 40, 86, 50, 10
LTEXT "", IDC_SERVER, 80, 26, 150, 14, 0
LTEXT "", IDC_REALM, 80, 46, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "儲存密碼 (不安全)(&S)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Cancel", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}

View file

@ -66,4 +66,29 @@
+ if (select(0, &infd, NULL, NULL, &tv) > 0)
{
if (recv(nSocket, &lpszBuffer[nRecv], 1, 0) <= 0)
{
{
Index: dll/win32/wininet/urlcache.c
===================================================================
--- dll/win32/wininet/urlcache.c (revision 50814)
+++ dll/win32/wininet/urlcache.c (working copy)
@@ -527,6 +527,7 @@
static const WCHAR HistoryPrefix[] = {'V','i','s','i','t','e','d',':',0};
static const WCHAR CookieSuffix[] = {0};
static const WCHAR CookiePrefix[] = {'C','o','o','k','i','e',':',0};
+ static const WCHAR UserProfile[] = {'U','S','E','R','P','R','O','F','I','L','E',0};
static const struct
{
int nFolder; /* CSIDL_* constant */
@@ -540,6 +541,12 @@
};
DWORD i;
+ if (GetEnvironmentVariableW(UserProfile, NULL, 0) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND)
+ {
+ TRACE("Environment variable 'USERPROFILE' does not exist!\n");
+ return;
+ }
+
for (i = 0; i < sizeof(DefaultContainerData) / sizeof(DefaultContainerData[0]); i++)
{
WCHAR wszCachePath[MAX_PATH];

View file

@ -429,6 +429,11 @@ typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME;
#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE 0x00000040
#define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR 0x80000000
#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008
#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020
#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080
#define WINHTTP_FLAG_SECURE_PROTOCOL_ALL (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1)
#define WINHTTP_AUTH_SCHEME_BASIC 0x00000001
#define WINHTTP_AUTH_SCHEME_NTLM 0x00000002
#define WINHTTP_AUTH_SCHEME_PASSPORT 0x00000004

View file

@ -591,9 +591,13 @@ BOOLAPI InternetUnlockRequestFile(HANDLE);
#define INTERNET_OPTION_CODEPAGE_PATH 100
#define INTERNET_OPTION_CODEPAGE_EXTRA 101
#define INTERNET_OPTION_IDN 102
#define INTERNET_OPTION_MAX_CONNS_PER_PROXY 103
#define INTERNET_OPTION_SUPPRESS_SERVER_AUTH 104
#define INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT 105
#define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK
#define INTERNET_LAST_OPTION INTERNET_OPTION_DATAFILE_EXT
#define INTERNET_LAST_OPTION INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT
#define INTERNET_PRIORITY_FOREGROUND 1000
#define INTERNET_HANDLE_TYPE_INTERNET 1
@ -1442,6 +1446,7 @@ INTERNETAPI DWORD WINAPI PrivacyGetZonePreferenceW(DWORD,DWORD,LPDWORD,LPWSTR,LP
#define ERROR_INTERNET_RETRY_DIALOG (INTERNET_ERROR_BASE + 50)
#define ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR (INTERNET_ERROR_BASE + 52)
#define ERROR_INTERNET_INSERT_CDROM (INTERNET_ERROR_BASE + 53)
#define ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED (INTERNET_ERROR_BASE + 54)
#define ERROR_INTERNET_SEC_CERT_ERRORS (INTERNET_ERROR_BASE + 55)
#define ERROR_INTERNET_SEC_CERT_NO_REV (INTERNET_ERROR_BASE + 56)
#define ERROR_INTERNET_SEC_CERT_REV_FAILED (INTERNET_ERROR_BASE + 57)
@ -1655,6 +1660,16 @@ BOOLAPI DeleteUrlCacheEntryA(LPCSTR);
BOOLAPI DeleteUrlCacheEntryW(LPCWSTR);
#define DeleteUrlCacheEntry WINELIB_NAME_AW(DeleteUrlCacheEntry)
/* FCS_ flags and FreeUrlCacheSpace are no longer documented */
#define FCS_PERCENT_CACHE_SPACE 0 /* guessed value */
#define FCS_PERCENT_DISK_SPACE 1 /* guessed value */
#define FCS_ABSOLUTE_SIZE 2 /* guessed value */
BOOLAPI FreeUrlCacheSpaceA(LPCSTR ,DWORD ,DWORD);
BOOLAPI FreeUrlCacheSpaceW(LPCWSTR ,DWORD ,DWORD);
#define FreeUrlCacheSpace WINELIB_NAME_AW(FreeUrlCacheSpace)
INTERNETAPI DWORD WINAPI InternetDialA(HWND ,LPSTR ,DWORD ,DWORD_PTR* ,DWORD);
INTERNETAPI DWORD WINAPI InternetDialW(HWND ,LPWSTR ,DWORD ,DWORD_PTR* ,DWORD);
#define InternetDial WINELIB_NAME_AW(InternetDial)

View file

@ -46,15 +46,15 @@ typedef struct _INTERNET_CACHE_CONFIG_INFOA
BOOL fPerUser;
DWORD dwSyncMode;
DWORD dwNumCachePaths;
union
__C89_NAMELESS union
{
struct
__C89_NAMELESS struct
{
CHAR CachePath[MAX_PATH];
DWORD dwCacheSize;
} DUMMYSTRUCTNAME;
} __C89_NAMELESSSTRUCTNAME;
INTERNET_CACHE_CONFIG_PATH_ENTRYA CachePaths[ANYSIZE_ARRAY];
} DUMYUNIONNAME;
} __C89_NAMELESSUNIONNAME;
DWORD dwNormalUsage;
DWORD dwExemptUsage;
} INTERNET_CACHE_CONFIG_INFOA, *LPINTERNET_CACHE_CONFIG_INFOA;
@ -68,15 +68,15 @@ typedef struct _INTERNET_CACHE_CONFIG_INFOW
BOOL fPerUser;
DWORD dwSyncMode;
DWORD dwNumCachePaths;
union
__C89_NAMELESS union
{
struct
__C89_NAMELESS struct
{
WCHAR CachePath[MAX_PATH];
DWORD dwCacheSize;
} DUMMYSTRUCTNAME;
} __C89_NAMELESSSTRUCTNAME;
INTERNET_CACHE_CONFIG_PATH_ENTRYW CachePaths[ANYSIZE_ARRAY];
} ;
} __C89_NAMELESSUNIONNAME;
DWORD dwNormalUsage;
DWORD dwExemptUsage;
} INTERNET_CACHE_CONFIG_INFOW, *LPINTERNET_CACHE_CONFIG_INFOW;
@ -84,6 +84,26 @@ typedef struct _INTERNET_CACHE_CONFIG_INFOW
DECL_WINELIB_TYPE_AW(INTERNET_CACHE_CONFIG_INFO)
DECL_WINELIB_TYPE_AW(LPINTERNET_CACHE_CONFIG_INFO)
typedef enum {
WININET_SYNC_MODE_NEVER = 0,
WININET_SYNC_MODE_ON_EXPIRY,
WININET_SYNC_MODE_ONCE_PER_SESSION,
WININET_SYNC_MODE_ALWAYS,
WININET_SYNC_MODE_AUTOMATIC,
WININET_SYNC_MODE_DEFAULT = WININET_SYNC_MODE_AUTOMATIC
} WININET_SYNC_MODE;
/* Flags for GetUrlCacheConfigInfoA/W and SetUrlCacheConfigInfoA/W */
#define CACHE_CONFIG_FORCE_CLEANUP_FC 0x00000020
#define CACHE_CONFIG_DISK_CACHE_PATHS_FC 0x00000040
#define CACHE_CONFIG_SYNC_MODE_FC 0x00000080
#define CACHE_CONFIG_CONTENT_PATHS_FC 0x00000100
#define CACHE_CONFIG_COOKIES_PATHS_FC 0x00000200
#define CACHE_CONFIG_HISTORY_PATHS_FC 0x00000400
#define CACHE_CONFIG_QUOTA_FC 0x00000800
#define CACHE_CONFIG_USER_MODE_FC 0x00001000
#define CACHE_CONFIG_CONTENT_USAGE_FC 0x00002000
#define CACHE_CONFIG_STICKY_CONTENT_USAGE_FC 0x00004000
#ifdef __cplusplus
extern "C" {