[WININET]

sync wininet with wine 1.1.40

svn path=/trunk/; revision=46202
This commit is contained in:
Christoph von Wittich 2010-03-15 11:35:51 +00:00
parent f9d9302445
commit 3e4b8ea4f1
38 changed files with 4740 additions and 2718 deletions

View file

@ -23,6 +23,10 @@
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
#if defined(__MINGW32__) || defined (_MSC_VER)
#include <ws2tcpip.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -48,7 +52,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet);
* Cookies are currently memory only. * Cookies are currently memory only.
* Cookies are NOT THREAD SAFE * Cookies are NOT THREAD SAFE
* Cookies could use A LOT OF MEMORY. We need some kind of memory management here! * Cookies could use A LOT OF MEMORY. We need some kind of memory management here!
* Cookies should care about the expiry time
*/ */
typedef struct _cookie_domain cookie_domain; typedef struct _cookie_domain cookie_domain;
@ -62,7 +65,7 @@ struct _cookie
LPWSTR lpCookieName; LPWSTR lpCookieName;
LPWSTR lpCookieData; LPWSTR lpCookieData;
time_t expiry; /* FIXME: not used */ FILETIME expiry;
}; };
struct _cookie_domain struct _cookie_domain
@ -76,7 +79,7 @@ struct _cookie_domain
static struct list domain_list = LIST_INIT(domain_list); static struct list domain_list = LIST_INIT(domain_list);
static cookie *COOKIE_addCookie(cookie_domain *domain, LPCWSTR name, LPCWSTR data); static cookie *COOKIE_addCookie(cookie_domain *domain, LPCWSTR name, LPCWSTR data, FILETIME expiry);
static cookie *COOKIE_findCookie(cookie_domain *domain, LPCWSTR lpszCookieName); static cookie *COOKIE_findCookie(cookie_domain *domain, LPCWSTR lpszCookieName);
static void COOKIE_deleteCookie(cookie *deadCookie, BOOL deleteDomain); static void COOKIE_deleteCookie(cookie *deadCookie, BOOL deleteDomain);
static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path); static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path);
@ -84,24 +87,16 @@ static void COOKIE_deleteDomain(cookie_domain *deadDomain);
/* adds a cookie to the domain */ /* adds a cookie to the domain */
static cookie *COOKIE_addCookie(cookie_domain *domain, LPCWSTR name, LPCWSTR data) static cookie *COOKIE_addCookie(cookie_domain *domain, LPCWSTR name, LPCWSTR data, FILETIME expiry)
{ {
cookie *newCookie = HeapAlloc(GetProcessHeap(), 0, sizeof(cookie)); cookie *newCookie = HeapAlloc(GetProcessHeap(), 0, sizeof(cookie));
list_init(&newCookie->entry); list_init(&newCookie->entry);
newCookie->lpCookieName = NULL; newCookie->lpCookieName = NULL;
newCookie->lpCookieData = NULL; newCookie->lpCookieData = NULL;
newCookie->expiry = expiry;
if (name) newCookie->lpCookieName = heap_strdupW(name);
{ newCookie->lpCookieData = heap_strdupW(data);
newCookie->lpCookieName = HeapAlloc(GetProcessHeap(), 0, (strlenW(name) + 1)*sizeof(WCHAR));
lstrcpyW(newCookie->lpCookieName, name);
}
if (data)
{
newCookie->lpCookieData = HeapAlloc(GetProcessHeap(), 0, (strlenW(data) + 1)*sizeof(WCHAR));
lstrcpyW(newCookie->lpCookieData, data);
}
TRACE("added cookie %p (data is %s)\n", newCookie, debugstr_w(data) ); TRACE("added cookie %p (data is %s)\n", newCookie, debugstr_w(data) );
@ -156,17 +151,8 @@ static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path)
list_init(&newDomain->cookie_list); list_init(&newDomain->cookie_list);
newDomain->lpCookieDomain = NULL; newDomain->lpCookieDomain = NULL;
newDomain->lpCookiePath = NULL; newDomain->lpCookiePath = NULL;
newDomain->lpCookieDomain = heap_strdupW(domain);
if (domain) newDomain->lpCookiePath = heap_strdupW(path);
{
newDomain->lpCookieDomain = HeapAlloc(GetProcessHeap(), 0, (strlenW(domain) + 1)*sizeof(WCHAR));
strcpyW(newDomain->lpCookieDomain, domain);
}
if (path)
{
newDomain->lpCookiePath = HeapAlloc(GetProcessHeap(), 0, (strlenW(path) + 1)*sizeof(WCHAR));
lstrcpyW(newDomain->lpCookiePath, path);
}
list_add_tail(&domain_list, &newDomain->entry); list_add_tail(&domain_list, &newDomain->entry);
@ -191,7 +177,28 @@ static BOOL COOKIE_crackUrlSimple(LPCWSTR lpszUrl, LPWSTR hostName, int hostName
UrlComponents.dwHostNameLength = hostNameLen; UrlComponents.dwHostNameLength = hostNameLen;
UrlComponents.dwUrlPathLength = pathLen; UrlComponents.dwUrlPathLength = pathLen;
return InternetCrackUrlW(lpszUrl, 0, 0, &UrlComponents); if (!InternetCrackUrlW(lpszUrl, 0, 0, &UrlComponents)) return FALSE;
/* discard the webpage off the end of the path */
if (UrlComponents.dwUrlPathLength)
{
if (path[UrlComponents.dwUrlPathLength - 1] != '/')
{
WCHAR *ptr;
if ((ptr = strrchrW(path, '/'))) *(++ptr) = 0;
else
{
path[0] = '/';
path[1] = 0;
}
}
}
else if (pathLen >= 2)
{
path[0] = '/';
path[1] = 0;
}
return TRUE;
} }
/* match a domain. domain must match if the domain is not NULL. path must match if the path is not NULL */ /* match a domain. domain must match if the domain is not NULL. path must match if the path is not NULL */
@ -215,11 +222,22 @@ static BOOL COOKIE_matchDomain(LPCWSTR lpszCookieDomain, LPCWSTR lpszCookiePath,
} }
if (lpszCookiePath) if (lpszCookiePath)
{ {
INT len;
TRACE("comparing paths: %s with %s\n", debugstr_w(lpszCookiePath), debugstr_w(searchDomain->lpCookiePath)); TRACE("comparing paths: %s with %s\n", debugstr_w(lpszCookiePath), debugstr_w(searchDomain->lpCookiePath));
/* paths match at the beginning. so a path of /foo would match
* /foobar and /foo/bar
*/
if (!searchDomain->lpCookiePath) if (!searchDomain->lpCookiePath)
return FALSE; return FALSE;
if (strcmpW(lpszCookiePath, searchDomain->lpCookiePath)) if (allow_partial)
{
len = lstrlenW(searchDomain->lpCookiePath);
if (strncmpiW(searchDomain->lpCookiePath, lpszCookiePath, len)!=0)
return FALSE;
}
else if (strcmpW(lpszCookiePath, searchDomain->lpCookiePath))
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
@ -262,6 +280,7 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
struct list * cursor; struct list * cursor;
unsigned int cnt = 0, domain_count = 0, cookie_count = 0; unsigned int cnt = 0, domain_count = 0, cookie_count = 0;
WCHAR hostName[2048], path[2048]; WCHAR hostName[2048], path[2048];
FILETIME tm;
TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName), TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName),
lpCookieData, lpdwSize); lpCookieData, lpdwSize);
@ -276,10 +295,12 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
ret = COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0])); ret = COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0]));
if (!ret || !hostName[0]) return FALSE; if (!ret || !hostName[0]) return FALSE;
GetSystemTimeAsFileTime(&tm);
LIST_FOR_EACH(cursor, &domain_list) LIST_FOR_EACH(cursor, &domain_list)
{ {
cookie_domain *cookiesDomain = LIST_ENTRY(cursor, cookie_domain, entry); cookie_domain *cookiesDomain = LIST_ENTRY(cursor, cookie_domain, entry);
if (COOKIE_matchDomain(hostName, NULL /* FIXME: path */, cookiesDomain, TRUE)) if (COOKIE_matchDomain(hostName, path, cookiesDomain, TRUE))
{ {
struct list * cursor; struct list * cursor;
domain_count++; domain_count++;
@ -288,6 +309,14 @@ BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
LIST_FOR_EACH(cursor, &cookiesDomain->cookie_list) LIST_FOR_EACH(cursor, &cookiesDomain->cookie_list)
{ {
cookie *thisCookie = LIST_ENTRY(cursor, cookie, entry); 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 */ if (lpCookieData == NULL) /* return the size of the buffer required to lpdwSize */
{ {
unsigned int len; unsigned int len;
@ -356,27 +385,16 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
LPSTR lpCookieData, LPDWORD lpdwSize) LPSTR lpCookieData, LPDWORD lpdwSize)
{ {
DWORD len; DWORD len;
LPWSTR szCookieData = NULL, szUrl = NULL, szCookieName = NULL; LPWSTR szCookieData = NULL, url, name;
BOOL r; BOOL r;
TRACE("(%s,%s,%p)\n", debugstr_a(lpszUrl), debugstr_a(lpszCookieName), TRACE("(%s,%s,%p)\n", debugstr_a(lpszUrl), debugstr_a(lpszCookieName),
lpCookieData); lpCookieData);
if( lpszUrl ) url = heap_strdupAtoW(lpszUrl);
{ name = heap_strdupAtoW(lpszCookieName);
len = MultiByteToWideChar( CP_ACP, 0, lpszUrl, -1, NULL, 0 );
szUrl = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, lpszUrl, -1, szUrl, len );
}
if( lpszCookieName ) r = InternetGetCookieW( url, name, NULL, &len );
{
len = MultiByteToWideChar( CP_ACP, 0, lpszCookieName, -1, NULL, 0 );
szCookieName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, lpszCookieName, -1, szCookieName, len );
}
r = InternetGetCookieW( szUrl, szCookieName, NULL, &len );
if( r ) if( r )
{ {
szCookieData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); szCookieData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
@ -386,7 +404,7 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
} }
else else
{ {
r = InternetGetCookieW( szUrl, szCookieName, szCookieData, &len ); r = InternetGetCookieW( url, name, szCookieData, &len );
*lpdwSize = WideCharToMultiByte( CP_ACP, 0, szCookieData, len, *lpdwSize = WideCharToMultiByte( CP_ACP, 0, szCookieData, len,
lpCookieData, *lpdwSize, NULL, NULL ); lpCookieData, *lpdwSize, NULL, NULL );
@ -394,8 +412,8 @@ BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
} }
HeapFree( GetProcessHeap(), 0, szCookieData ); HeapFree( GetProcessHeap(), 0, szCookieData );
HeapFree( GetProcessHeap(), 0, szCookieName ); HeapFree( GetProcessHeap(), 0, name );
HeapFree( GetProcessHeap(), 0, szUrl ); HeapFree( GetProcessHeap(), 0, url );
return r; return r;
} }
@ -405,27 +423,129 @@ static BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWST
cookie_domain *thisCookieDomain = NULL; cookie_domain *thisCookieDomain = NULL;
cookie *thisCookie; cookie *thisCookie;
struct list *cursor; struct list *cursor;
LPWSTR data, value;
WCHAR *ptr;
FILETIME expiry;
BOOL expired = FALSE;
value = data = heap_strdupW(cookie_data);
if (!data)
{
ERR("could not allocate %zu bytes for the cookie data buffer\n", (strlenW(cookie_data) + 1) * sizeof(WCHAR));
return FALSE;
}
memset(&expiry,0,sizeof(expiry));
/* lots of information can be parsed out of the cookie value */
ptr = data;
for (;;)
{
static const WCHAR szDomain[] = {'d','o','m','a','i','n','=',0};
static const WCHAR szPath[] = {'p','a','t','h','=',0};
static const WCHAR szExpires[] = {'e','x','p','i','r','e','s','=',0};
static const WCHAR szSecure[] = {'s','e','c','u','r','e',0};
static const WCHAR szHttpOnly[] = {'h','t','t','p','o','n','l','y',0};
if (!(ptr = strchrW(ptr,';'))) break;
*ptr++ = 0;
if (value != data)
HeapFree(GetProcessHeap(), 0, value);
value = HeapAlloc(GetProcessHeap(), 0, (ptr - data) * sizeof(WCHAR));
if (value == NULL)
{
HeapFree(GetProcessHeap(), 0, data);
ERR("could not allocate %zu bytes for the cookie value buffer\n", (ptr - data) * sizeof(WCHAR));
return FALSE;
}
strcpyW(value, data);
while (*ptr == ' ') ptr++; /* whitespace */
if (strncmpiW(ptr, szDomain, 7) == 0)
{
ptr+=strlenW(szDomain);
domain = ptr;
TRACE("Parsing new domain %s\n",debugstr_w(domain));
}
else if (strncmpiW(ptr, szPath, 5) == 0)
{
ptr+=strlenW(szPath);
path = ptr;
TRACE("Parsing new path %s\n",debugstr_w(path));
}
else if (strncmpiW(ptr, szExpires, 8) == 0)
{
FILETIME ft;
SYSTEMTIME st;
FIXME("persistent cookies not handled (%s)\n",debugstr_w(ptr));
ptr+=strlenW(szExpires);
if (InternetTimeToSystemTimeW(ptr, &st, 0))
{
SystemTimeToFileTime(&st, &expiry);
GetSystemTimeAsFileTime(&ft);
if (CompareFileTime(&ft,&expiry) > 0)
{
TRACE("Cookie already expired.\n");
expired = TRUE;
}
}
}
else if (strncmpiW(ptr, szSecure, 6) == 0)
{
FIXME("secure not handled (%s)\n",debugstr_w(ptr));
ptr += strlenW(szSecure);
}
else if (strncmpiW(ptr, szHttpOnly, 8) == 0)
{
FIXME("httponly not handled (%s)\n",debugstr_w(ptr));
ptr += strlenW(szHttpOnly);
}
else if (*ptr)
{
FIXME("Unknown additional option %s\n",debugstr_w(ptr));
break;
}
}
LIST_FOR_EACH(cursor, &domain_list) LIST_FOR_EACH(cursor, &domain_list)
{ {
thisCookieDomain = LIST_ENTRY(cursor, cookie_domain, entry); thisCookieDomain = LIST_ENTRY(cursor, cookie_domain, entry);
if (COOKIE_matchDomain(domain, NULL /* FIXME: path */, thisCookieDomain, FALSE)) if (COOKIE_matchDomain(domain, path, thisCookieDomain, FALSE))
break; break;
thisCookieDomain = NULL; thisCookieDomain = NULL;
} }
if (!thisCookieDomain) if (!thisCookieDomain)
thisCookieDomain = COOKIE_addDomain(domain, path); {
if (!expired)
thisCookieDomain = COOKIE_addDomain(domain, path);
else
{
HeapFree(GetProcessHeap(),0,data);
if (value != data) HeapFree(GetProcessHeap(), 0, value);
return TRUE;
}
}
if ((thisCookie = COOKIE_findCookie(thisCookieDomain, cookie_name))) if ((thisCookie = COOKIE_findCookie(thisCookieDomain, cookie_name)))
COOKIE_deleteCookie(thisCookie, FALSE); COOKIE_deleteCookie(thisCookie, FALSE);
TRACE("setting cookie %s=%s for domain %s\n", debugstr_w(cookie_name), TRACE("setting cookie %s=%s for domain %s path %s\n", debugstr_w(cookie_name),
debugstr_w(cookie_data), debugstr_w(thisCookieDomain->lpCookieDomain)); debugstr_w(value), debugstr_w(thisCookieDomain->lpCookieDomain),debugstr_w(thisCookieDomain->lpCookiePath));
if (!COOKIE_addCookie(thisCookieDomain, cookie_name, cookie_data)) if (!expired && !COOKIE_addCookie(thisCookieDomain, cookie_name, value, expiry))
{
HeapFree(GetProcessHeap(),0,data);
if (value != data) HeapFree(GetProcessHeap(), 0, value);
return FALSE; return FALSE;
}
HeapFree(GetProcessHeap(),0,data);
if (value != data) HeapFree(GetProcessHeap(), 0, value);
return TRUE; return TRUE;
} }
@ -454,28 +574,26 @@ BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
return FALSE; return FALSE;
} }
hostName[0] = path[0] = 0; hostName[0] = 0;
ret = COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0])); ret = COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0]));
if (!ret || !hostName[0]) return FALSE; if (!ret || !hostName[0]) return FALSE;
if (!lpszCookieName) if (!lpszCookieName)
{ {
unsigned int len;
WCHAR *cookie, *data; WCHAR *cookie, *data;
len = strlenW(lpCookieData); cookie = heap_strdupW(lpCookieData);
if (!(cookie = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)))) if (!cookie)
{ {
SetLastError(ERROR_OUTOFMEMORY); SetLastError(ERROR_OUTOFMEMORY);
return FALSE; return FALSE;
} }
strcpyW(cookie, lpCookieData);
/* some apps (or is it us??) try to add a cookie with no cookie name, but /* some apps (or is it us??) try to add a cookie with no cookie name, but
* the cookie data in the form of name[=data]. * the cookie data in the form of name[=data].
*/ */
if (!(data = strchrW(cookie, '='))) data = cookie + len; if (!(data = strchrW(cookie, '='))) data = cookie + strlenW(cookie);
else data++; else *data++ = 0;
ret = set_cookie(hostName, path, cookie, data); ret = set_cookie(hostName, path, cookie, data);
@ -499,39 +617,21 @@ BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName,
BOOL WINAPI InternetSetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, BOOL WINAPI InternetSetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName,
LPCSTR lpCookieData) LPCSTR lpCookieData)
{ {
DWORD len; LPWSTR data, url, name;
LPWSTR szCookieData = NULL, szUrl = NULL, szCookieName = NULL;
BOOL r; BOOL r;
TRACE("(%s,%s,%s)\n", debugstr_a(lpszUrl), TRACE("(%s,%s,%s)\n", debugstr_a(lpszUrl),
debugstr_a(lpszCookieName), debugstr_a(lpCookieData)); debugstr_a(lpszCookieName), debugstr_a(lpCookieData));
if( lpszUrl ) url = heap_strdupAtoW(lpszUrl);
{ name = heap_strdupAtoW(lpszCookieName);
len = MultiByteToWideChar( CP_ACP, 0, lpszUrl, -1, NULL, 0 ); data = heap_strdupAtoW(lpCookieData);
szUrl = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, lpszUrl, -1, szUrl, len );
}
if( lpszCookieName ) r = InternetSetCookieW( url, name, data );
{
len = MultiByteToWideChar( CP_ACP, 0, lpszCookieName, -1, NULL, 0 );
szCookieName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, lpszCookieName, -1, szCookieName, len );
}
if( lpCookieData ) HeapFree( GetProcessHeap(), 0, data );
{ HeapFree( GetProcessHeap(), 0, name );
len = MultiByteToWideChar( CP_ACP, 0, lpCookieData, -1, NULL, 0 ); HeapFree( GetProcessHeap(), 0, url );
szCookieData = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, lpCookieData, -1, szCookieData, len );
}
r = InternetSetCookieW( szUrl, szCookieName, szCookieData );
HeapFree( GetProcessHeap(), 0, szCookieData );
HeapFree( GetProcessHeap(), 0, szCookieName );
HeapFree( GetProcessHeap(), 0, szUrl );
return r; return r;
} }
@ -692,3 +792,28 @@ BOOL WINAPI InternetSetPerSiteCookieDecisionW( LPCWSTR pchHostName, DWORD dwDeci
FIXME("(%s, 0x%08x) stub\n", debugstr_w(pchHostName), dwDecision); FIXME("(%s, 0x%08x) stub\n", debugstr_w(pchHostName), dwDecision);
return FALSE; return FALSE;
} }
/***********************************************************************
* IsDomainLegalCookieDomainW (WININET.@)
*/
BOOL WINAPI IsDomainLegalCookieDomainW( LPCWSTR s1, LPCWSTR s2 )
{
const WCHAR *p;
FIXME("(%s, %s)\n", debugstr_w(s1), debugstr_w(s2));
if (!s1 || !s2)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (s1[0] == '.' || !s1[0] || s2[0] == '.' || !s2[0])
{
SetLastError(ERROR_INVALID_NAME);
return FALSE;
}
if (!(p = strchrW(s2, '.'))) return FALSE;
if (strchrW(p + 1, '.') && !strcmpW(p + 1, s1)) return TRUE;
else if (!strcmpW(s1, s2)) return TRUE;
return FALSE;
}

View file

@ -21,6 +21,10 @@
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
#if defined(__MINGW32__) || defined (_MSC_VER)
#include <ws2tcpip.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"
@ -58,22 +62,23 @@ struct WININET_ErrorDlgParams
*/ */
static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz ) static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
{ {
LPWININETHTTPREQW lpwhr; http_request_t *lpwhr;
LPWININETHTTPSESSIONW lpwhs = NULL; http_session_t *lpwhs = NULL;
LPWININETAPPINFOW hIC = NULL; appinfo_t *hIC = NULL;
BOOL ret = FALSE;
LPWSTR p; LPWSTR p;
lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); lpwhr = (http_request_t*) WININET_GetObject( hRequest );
if (NULL == lpwhr) if (NULL == lpwhr)
return FALSE; return FALSE;
lpwhs = lpwhr->lpHttpSession; lpwhs = lpwhr->lpHttpSession;
if (NULL == lpwhs) if (NULL == lpwhs)
return FALSE; goto done;
hIC = lpwhs->lpAppInfo; hIC = lpwhs->lpAppInfo;
if (NULL == hIC) if (NULL == hIC)
return FALSE; goto done;
lstrcpynW(szBuf, hIC->lpszProxy, sz); lstrcpynW(szBuf, hIC->lpszProxy, sz);
@ -82,7 +87,39 @@ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
if (p) if (p)
*p = 0; *p = 0;
return TRUE; ret = TRUE;
done:
WININET_Release( &lpwhr->hdr );
return ret;
}
/***********************************************************************
* WININET_GetServer
*
* Determine the name of the web server
*/
static BOOL WININET_GetServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
{
http_request_t *lpwhr;
http_session_t *lpwhs = NULL;
BOOL ret = FALSE;
lpwhr = (http_request_t*) WININET_GetObject( hRequest );
if (NULL == lpwhr)
return FALSE;
lpwhs = lpwhr->lpHttpSession;
if (NULL == lpwhs)
goto done;
lstrcpynW(szBuf, lpwhs->lpszHostName, sz);
ret = TRUE;
done:
WININET_Release( &lpwhr->hdr );
return ret;
} }
/*********************************************************************** /***********************************************************************
@ -90,16 +127,20 @@ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
* *
* Determine the name of the (basic) Authentication realm * Determine the name of the (basic) Authentication realm
*/ */
static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz ) static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz, BOOL proxy )
{ {
LPWSTR p, q; LPWSTR p, q;
DWORD index; DWORD index, query;
static const WCHAR szRealm[] = { 'r','e','a','l','m','=',0 }; static const WCHAR szRealm[] = { 'r','e','a','l','m','=',0 };
/* extract the Realm from the proxy response and show it */ if (proxy)
query = HTTP_QUERY_PROXY_AUTHENTICATE;
else
query = HTTP_QUERY_WWW_AUTHENTICATE;
/* extract the Realm from the response and show it */
index = 0; index = 0;
if( !HttpQueryInfoW( hRequest, HTTP_QUERY_PROXY_AUTHENTICATE, if( !HttpQueryInfoW( hRequest, query, szBuf, &sz, &index) )
szBuf, &sz, &index) )
return FALSE; return FALSE;
/* /*
@ -109,11 +150,10 @@ static BOOL WININET_GetAuthRealm( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
p = strchrW( szBuf, ' ' ); p = strchrW( szBuf, ' ' );
if( !p || strncmpW( p+1, szRealm, strlenW(szRealm) ) ) if( !p || strncmpW( p+1, szRealm, strlenW(szRealm) ) )
{ {
ERR("proxy response wrong? (%s)\n", debugstr_w(szBuf)); ERR("response wrong? (%s)\n", debugstr_w(szBuf));
return FALSE; return FALSE;
} }
/* remove quotes */ /* remove quotes */
p += 7; p += 7;
if( *p == '"' ) if( *p == '"' )
@ -194,44 +234,62 @@ static BOOL WININET_GetSetPassword( HWND hdlg, LPCWSTR szServer,
} }
/*********************************************************************** /***********************************************************************
* WININET_SetProxyAuthorization * WININET_SetAuthorization
*/ */
static BOOL WININET_SetProxyAuthorization( HINTERNET hRequest, static BOOL WININET_SetAuthorization( HINTERNET hRequest, LPWSTR username,
LPWSTR username, LPWSTR password ) LPWSTR password, BOOL proxy )
{ {
LPWININETHTTPREQW lpwhr; http_request_t *lpwhr;
LPWININETHTTPSESSIONW lpwhs; http_session_t *lpwhs;
LPWININETAPPINFOW hIC; BOOL ret = FALSE;
LPWSTR p; LPWSTR p, q;
lpwhr = (LPWININETHTTPREQW) WININET_GetObject( hRequest ); lpwhr = (http_request_t*) WININET_GetObject( hRequest );
if( !lpwhr ) if( !lpwhr )
return FALSE; return FALSE;
lpwhs = lpwhr->lpHttpSession; lpwhs = lpwhr->lpHttpSession;
if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION) if (NULL == lpwhs || lpwhs->hdr.htype != WH_HHTTPSESSION)
{ {
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
return FALSE; goto done;
} }
hIC = lpwhs->lpAppInfo; p = heap_strdupW(username);
p = HeapAlloc( GetProcessHeap(), 0, (strlenW( username ) + 1)*sizeof(WCHAR) );
if( !p ) if( !p )
return FALSE; goto done;
lstrcpyW( p, username );
hIC->lpszProxyUsername = p;
p = HeapAlloc( GetProcessHeap(), 0, (strlenW( password ) + 1)*sizeof(WCHAR) ); q = heap_strdupW(password);
if( !p ) if( !q )
return FALSE; {
HeapFree(GetProcessHeap(), 0, username);
lstrcpyW( p, password ); goto done;
hIC->lpszProxyPassword = p; }
return TRUE; if (proxy)
{
appinfo_t *hIC = lpwhs->lpAppInfo;
HeapFree(GetProcessHeap(), 0, hIC->lpszProxyUsername);
hIC->lpszProxyUsername = p;
HeapFree(GetProcessHeap(), 0, hIC->lpszProxyPassword);
hIC->lpszProxyPassword = q;
}
else
{
HeapFree(GetProcessHeap(), 0, lpwhs->lpszUserName);
lpwhs->lpszUserName = p;
HeapFree(GetProcessHeap(), 0, lpwhs->lpszPassword);
lpwhs->lpszPassword = q;
}
ret = TRUE;
done:
WININET_Release( &lpwhr->hdr );
return ret;
} }
/*********************************************************************** /***********************************************************************
@ -254,7 +312,7 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
/* extract the Realm from the proxy response and show it */ /* extract the Realm from the proxy response and show it */
if( WININET_GetAuthRealm( params->hRequest, if( WININET_GetAuthRealm( params->hRequest,
szRealm, sizeof szRealm/sizeof(WCHAR)) ) szRealm, sizeof szRealm/sizeof(WCHAR), TRUE ) )
{ {
hitem = GetDlgItem( hdlg, IDC_REALM ); hitem = GetDlgItem( hdlg, IDC_REALM );
SetWindowTextW( hitem, szRealm ); SetWindowTextW( hitem, szRealm );
@ -297,13 +355,97 @@ static INT_PTR WINAPI WININET_ProxyPasswordDialog(
if( hitem && if( hitem &&
SendMessageW( hitem, BM_GETSTATE, 0, 0 ) && SendMessageW( hitem, BM_GETSTATE, 0, 0 ) &&
WININET_GetAuthRealm( params->hRequest, WININET_GetAuthRealm( params->hRequest,
szRealm, sizeof szRealm/sizeof(WCHAR)) && szRealm, sizeof szRealm/sizeof(WCHAR), TRUE ) &&
WININET_GetProxyServer( params->hRequest, WININET_GetProxyServer( params->hRequest,
szServer, sizeof szServer/sizeof(WCHAR)) ) szServer, sizeof szServer/sizeof(WCHAR)) )
{ {
WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE ); WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE );
} }
WININET_SetProxyAuthorization( params->hRequest, username, password ); WININET_SetAuthorization( params->hRequest, username, password, TRUE );
EndDialog( hdlg, ERROR_INTERNET_FORCE_RETRY );
return TRUE;
}
if( wParam == IDCANCEL )
{
EndDialog( hdlg, 0 );
return TRUE;
}
break;
}
return FALSE;
}
/***********************************************************************
* WININET_PasswordDialog
*/
static INT_PTR WINAPI WININET_PasswordDialog(
HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
HWND hitem;
struct WININET_ErrorDlgParams *params;
WCHAR szRealm[0x80], szServer[0x80];
if( uMsg == WM_INITDIALOG )
{
TRACE("WM_INITDIALOG (%08lx)\n", lParam);
/* save the parameter list */
params = (struct WININET_ErrorDlgParams*) lParam;
SetWindowLongPtrW( hdlg, GWLP_USERDATA, lParam );
/* extract the Realm from the response and show it */
if( WININET_GetAuthRealm( params->hRequest,
szRealm, sizeof szRealm/sizeof(WCHAR), FALSE ) )
{
hitem = GetDlgItem( hdlg, IDC_REALM );
SetWindowTextW( hitem, szRealm );
}
/* extract the name of the server */
if( WININET_GetServer( params->hRequest,
szServer, sizeof szServer/sizeof(WCHAR)) )
{
hitem = GetDlgItem( hdlg, IDC_SERVER );
SetWindowTextW( hitem, szServer );
}
WININET_GetSetPassword( hdlg, szServer, szRealm, FALSE );
return TRUE;
}
params = (struct WININET_ErrorDlgParams*)
GetWindowLongPtrW( hdlg, GWLP_USERDATA );
switch( uMsg )
{
case WM_COMMAND:
if( wParam == IDOK )
{
WCHAR username[0x20], password[0x20];
username[0] = 0;
hitem = GetDlgItem( hdlg, IDC_USERNAME );
if( hitem )
GetWindowTextW( hitem, username, sizeof username/sizeof(WCHAR) );
password[0] = 0;
hitem = GetDlgItem( hdlg, IDC_PASSWORD );
if( hitem )
GetWindowTextW( hitem, password, sizeof password/sizeof(WCHAR) );
hitem = GetDlgItem( hdlg, IDC_SAVEPASSWORD );
if( hitem &&
SendMessageW( hitem, BM_GETSTATE, 0, 0 ) &&
WININET_GetAuthRealm( params->hRequest,
szRealm, sizeof szRealm/sizeof(WCHAR), FALSE ) &&
WININET_GetServer( params->hRequest,
szServer, sizeof szServer/sizeof(WCHAR)) )
{
WININET_GetSetPassword( hdlg, szServer, szRealm, TRUE );
}
WININET_SetAuthorization( params->hRequest, username, password, FALSE );
EndDialog( hdlg, ERROR_INTERNET_FORCE_RETRY ); EndDialog( hdlg, ERROR_INTERNET_FORCE_RETRY );
return TRUE; return TRUE;
@ -362,17 +504,23 @@ DWORD WINAPI InternetErrorDlg(HWND hWnd, HINTERNET hRequest,
switch( dwError ) switch( dwError )
{ {
case ERROR_SUCCESS: case ERROR_SUCCESS:
if( !(dwFlags & FLAGS_ERROR_UI_FILTER_FOR_ERRORS ) )
return 0;
dwStatus = WININET_GetConnectionStatus( hRequest );
if( HTTP_STATUS_PROXY_AUTH_REQ != dwStatus )
return ERROR_SUCCESS;
return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ),
hWnd, WININET_ProxyPasswordDialog, (LPARAM) &params );
case ERROR_INTERNET_INCORRECT_PASSWORD: case ERROR_INTERNET_INCORRECT_PASSWORD:
return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ), if( !dwError && !(dwFlags & FLAGS_ERROR_UI_FILTER_FOR_ERRORS ) )
hWnd, WININET_ProxyPasswordDialog, (LPARAM) &params ); return 0;
dwStatus = WININET_GetConnectionStatus( hRequest );
switch (dwStatus)
{
case HTTP_STATUS_PROXY_AUTH_REQ:
return DialogBoxParamW( hwininet, MAKEINTRESOURCEW( IDD_PROXYDLG ),
hWnd, WININET_ProxyPasswordDialog, (LPARAM) &params );
case HTTP_STATUS_DENIED:
return DialogBoxParamW( hwininet, 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_HTTP_TO_HTTPS_ON_REDIR:
case ERROR_INTERNET_INVALID_CA: case ERROR_INTERNET_INVALID_CA:

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -42,12 +42,7 @@
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif
#if defined(__MINGW32__) || defined (_MSC_VER) #if !defined(__MINGW32__) && !defined(_MSC_VER)
#include "ws2tcpip.h"
#ifndef MSG_WAITALL
#define MSG_WAITALL 0
#endif
#else
#define closesocket close #define closesocket close
#define ioctlsocket ioctl #define ioctlsocket ioctl
#endif /* __MINGW32__ */ #endif /* __MINGW32__ */
@ -62,33 +57,51 @@ typedef struct
BOOL useSSL; BOOL useSSL;
int socketFD; int socketFD;
void *ssl_s; void *ssl_s;
char *peek_msg;
char *peek_msg_mem;
size_t peek_len;
} WININET_NETCONNECTION; } WININET_NETCONNECTION;
static inline LPWSTR WININET_strdupW( LPCWSTR str ) static inline LPWSTR heap_strdupW(LPCWSTR str)
{ {
LPWSTR ret = HeapAlloc( GetProcessHeap(), 0, (strlenW(str) + 1)*sizeof(WCHAR) ); LPWSTR ret = NULL;
if (ret) strcpyW( ret, str );
if(str) {
DWORD size;
size = (strlenW(str)+1)*sizeof(WCHAR);
ret = HeapAlloc(GetProcessHeap(), 0, size);
if(ret)
memcpy(ret, str, size);
}
return ret; return ret;
} }
static inline LPWSTR WININET_strdup_AtoW( LPCSTR str ) static inline WCHAR *heap_strdupAtoW(const char *str)
{ {
int len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0); LPWSTR ret = NULL;
LPWSTR ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
if (ret) if(str) {
MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len); DWORD len;
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
ret = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
if(ret)
MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
}
return ret; return ret;
} }
static inline LPSTR WININET_strdup_WtoA( LPCWSTR str ) static inline char *heap_strdupWtoA(LPCWSTR str)
{ {
int len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL); char *ret = NULL;
LPSTR ret = HeapAlloc( GetProcessHeap(), 0, len );
if (ret) if(str) {
WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL); DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
ret = HeapAlloc(GetProcessHeap(), 0, size);
if(ret)
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
}
return ret; return ret;
} }
@ -124,24 +137,25 @@ typedef enum
#define INET_OPENURL 0x0001 #define INET_OPENURL 0x0001
#define INET_CALLBACKW 0x0002 #define INET_CALLBACKW 0x0002
typedef struct _WININETHANDLEHEADER WININETHANDLEHEADER, *LPWININETHANDLEHEADER; typedef struct _object_header_t object_header_t;
typedef struct { typedef struct {
void (*Destroy)(WININETHANDLEHEADER*); void (*Destroy)(object_header_t*);
void (*CloseConnection)(WININETHANDLEHEADER*); void (*CloseConnection)(object_header_t*);
DWORD (*QueryOption)(WININETHANDLEHEADER*,DWORD,void*,DWORD*,BOOL); DWORD (*QueryOption)(object_header_t*,DWORD,void*,DWORD*,BOOL);
DWORD (*SetOption)(WININETHANDLEHEADER*,DWORD,void*,DWORD); DWORD (*SetOption)(object_header_t*,DWORD,void*,DWORD);
DWORD (*ReadFile)(WININETHANDLEHEADER*,void*,DWORD,DWORD*); DWORD (*ReadFile)(object_header_t*,void*,DWORD,DWORD*);
DWORD (*ReadFileExA)(WININETHANDLEHEADER*,INTERNET_BUFFERSA*,DWORD,DWORD_PTR); DWORD (*ReadFileExA)(object_header_t*,INTERNET_BUFFERSA*,DWORD,DWORD_PTR);
BOOL (*WriteFile)(WININETHANDLEHEADER*,const void*,DWORD,DWORD*); DWORD (*ReadFileExW)(object_header_t*,INTERNET_BUFFERSW*,DWORD,DWORD_PTR);
DWORD (*QueryDataAvailable)(WININETHANDLEHEADER*,DWORD*,DWORD,DWORD_PTR); DWORD (*WriteFile)(object_header_t*,const void*,DWORD,DWORD*);
DWORD (*FindNextFileW)(WININETHANDLEHEADER*,void*); DWORD (*QueryDataAvailable)(object_header_t*,DWORD*,DWORD,DWORD_PTR);
} HANDLEHEADERVtbl; DWORD (*FindNextFileW)(object_header_t*,void*);
} object_vtbl_t;
struct _WININETHANDLEHEADER struct _object_header_t
{ {
WH_TYPE htype; WH_TYPE htype;
const HANDLEHEADERVtbl *vtbl; const object_vtbl_t *vtbl;
HINTERNET hInternet; HINTERNET hInternet;
DWORD dwFlags; DWORD dwFlags;
DWORD_PTR dwContext; DWORD_PTR dwContext;
@ -156,28 +170,29 @@ struct _WININETHANDLEHEADER
typedef struct typedef struct
{ {
WININETHANDLEHEADER hdr; object_header_t hdr;
LPWSTR lpszAgent; LPWSTR lpszAgent;
LPWSTR lpszProxy; LPWSTR lpszProxy;
LPWSTR lpszProxyBypass; LPWSTR lpszProxyBypass;
LPWSTR lpszProxyUsername; LPWSTR lpszProxyUsername;
LPWSTR lpszProxyPassword; LPWSTR lpszProxyPassword;
DWORD dwAccessType; DWORD dwAccessType;
} WININETAPPINFOW, *LPWININETAPPINFOW; } appinfo_t;
typedef struct typedef struct
{ {
WININETHANDLEHEADER hdr; object_header_t hdr;
WININETAPPINFOW *lpAppInfo; appinfo_t *lpAppInfo;
LPWSTR lpszHostName; /* the final destination of the request */ LPWSTR lpszHostName; /* the final destination of the request */
LPWSTR lpszServerName; /* the name of the server we directly connect to */ LPWSTR lpszServerName; /* the name of the server we directly connect to */
LPWSTR lpszUserName; LPWSTR lpszUserName;
LPWSTR lpszPassword; LPWSTR lpszPassword;
INTERNET_PORT nHostPort; /* the final destination port of the request */ INTERNET_PORT nHostPort; /* the final destination port of the request */
INTERNET_PORT nServerPort; /* the port of the server we directly connect to */ INTERNET_PORT nServerPort; /* the port of the server we directly connect to */
struct sockaddr_in socketAddress; struct sockaddr_storage socketAddress;
} WININETHTTPSESSIONW, *LPWININETHTTPSESSIONW; socklen_t sa_len;
} http_session_t;
#define HDR_ISREQUEST 0x0001 #define HDR_ISREQUEST 0x0001
#define HDR_COMMADELIMITED 0x0002 #define HDR_COMMADELIMITED 0x0002
@ -194,25 +209,38 @@ typedef struct
struct HttpAuthInfo; struct HttpAuthInfo;
typedef struct gzip_stream_t gzip_stream_t;
typedef struct typedef struct
{ {
WININETHANDLEHEADER hdr; object_header_t hdr;
WININETHTTPSESSIONW *lpHttpSession; http_session_t *lpHttpSession;
LPWSTR lpszPath; LPWSTR lpszPath;
LPWSTR lpszVerb; LPWSTR lpszVerb;
LPWSTR lpszRawHeaders; LPWSTR lpszRawHeaders;
WININET_NETCONNECTION netConnection; WININET_NETCONNECTION netConnection;
LPWSTR lpszVersion; LPWSTR lpszVersion;
LPWSTR lpszStatusText; LPWSTR lpszStatusText;
DWORD dwContentLength; /* total number of bytes to be read */ DWORD dwBytesToWrite;
DWORD dwContentRead; /* bytes of the content read so far */ DWORD dwBytesWritten;
HTTPHEADERW *pCustHeaders; HTTPHEADERW *pCustHeaders;
DWORD nCustHeaders; DWORD nCustHeaders;
HANDLE hCacheFile; HANDLE hCacheFile;
LPWSTR lpszCacheFile; LPWSTR lpszCacheFile;
struct HttpAuthInfo *pAuthInfo; struct HttpAuthInfo *pAuthInfo;
struct HttpAuthInfo *pProxyAuthInfo; struct HttpAuthInfo *pProxyAuthInfo;
} WININETHTTPREQW, *LPWININETHTTPREQW;
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 */
BOOL read_chunked; /* are we reading in chunked 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 */
BOOL decoding;
gzip_stream_t *gzip_stream;
} http_request_t;
@ -297,6 +325,12 @@ struct WORKREQ_HTTPSENDREQUESTW
BOOL bEndRequest; BOOL bEndRequest;
}; };
struct WORKREQ_HTTPENDREQUESTW
{
DWORD dwFlags;
DWORD_PTR dwContext;
};
struct WORKREQ_SENDCALLBACK struct WORKREQ_SENDCALLBACK
{ {
DWORD_PTR dwContext; DWORD_PTR dwContext;
@ -320,10 +354,15 @@ struct WORKREQ_INTERNETREADFILEEXA
LPINTERNET_BUFFERSA lpBuffersOut; LPINTERNET_BUFFERSA lpBuffersOut;
}; };
struct WORKREQ_INTERNETREADFILEEXW
{
LPINTERNET_BUFFERSW lpBuffersOut;
};
typedef struct WORKREQ typedef struct WORKREQ
{ {
void (*asyncproc)(struct WORKREQ*); void (*asyncproc)(struct WORKREQ*);
WININETHANDLEHEADER *hdr; object_header_t *hdr;
union { union {
struct WORKREQ_FTPPUTFILEW FtpPutFileW; struct WORKREQ_FTPPUTFILEW FtpPutFileW;
@ -338,77 +377,69 @@ typedef struct WORKREQ
struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW; struct WORKREQ_FTPRENAMEFILEW FtpRenameFileW;
struct WORKREQ_FTPFINDNEXTW FtpFindNextW; struct WORKREQ_FTPFINDNEXTW FtpFindNextW;
struct WORKREQ_HTTPSENDREQUESTW HttpSendRequestW; struct WORKREQ_HTTPSENDREQUESTW HttpSendRequestW;
struct WORKREQ_HTTPENDREQUESTW HttpEndRequestW;
struct WORKREQ_SENDCALLBACK SendCallback; struct WORKREQ_SENDCALLBACK SendCallback;
struct WORKREQ_INTERNETOPENURLW InternetOpenUrlW; struct WORKREQ_INTERNETOPENURLW InternetOpenUrlW;
struct WORKREQ_INTERNETREADFILEEXA InternetReadFileExA; struct WORKREQ_INTERNETREADFILEEXA InternetReadFileExA;
struct WORKREQ_INTERNETREADFILEEXW InternetReadFileExW;
} u; } u;
} WORKREQUEST, *LPWORKREQUEST; } WORKREQUEST, *LPWORKREQUEST;
HINTERNET WININET_AllocHandle( LPWININETHANDLEHEADER info ); HINTERNET WININET_AllocHandle( object_header_t *info );
LPWININETHANDLEHEADER WININET_GetObject( HINTERNET hinternet ); object_header_t *WININET_GetObject( HINTERNET hinternet );
LPWININETHANDLEHEADER WININET_AddRef( LPWININETHANDLEHEADER info ); object_header_t *WININET_AddRef( object_header_t *info );
BOOL WININET_Release( LPWININETHANDLEHEADER info ); BOOL WININET_Release( object_header_t *info );
BOOL WININET_FreeHandle( HINTERNET hinternet ); BOOL WININET_FreeHandle( HINTERNET hinternet );
DWORD INET_QueryOption(DWORD,void*,DWORD*,BOOL); DWORD INET_QueryOption(DWORD,void*,DWORD*,BOOL);
time_t ConvertTimeString(LPCWSTR asctime); time_t ConvertTimeString(LPCWSTR asctime);
HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
INTERNET_PORT nServerPort, LPCWSTR lpszUserName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName,
LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext,
DWORD dwInternalFlags); DWORD dwInternalFlags);
HINTERNET HTTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, DWORD HTTP_Connect(appinfo_t*,LPCWSTR,
INTERNET_PORT nServerPort, LPCWSTR lpszUserName, INTERNET_PORT nServerPort, LPCWSTR lpszUserName,
LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext, LPCWSTR lpszPassword, DWORD dwFlags, DWORD_PTR dwContext,
DWORD dwInternalFlags); DWORD dwInternalFlags, HINTERNET*);
BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort, BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
struct sockaddr_in *psa); struct sockaddr *psa, socklen_t *sa_len);
void INTERNET_SetLastError(DWORD dwError); void INTERNET_SetLastError(DWORD dwError);
DWORD INTERNET_GetLastError(void); DWORD INTERNET_GetLastError(void);
BOOL INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest); DWORD INTERNET_AsyncCall(LPWORKREQUEST lpWorkRequest);
LPSTR INTERNET_GetResponseBuffer(void); LPSTR INTERNET_GetResponseBuffer(void);
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen); LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen);
BOOLAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, VOID SendAsyncCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD dwHeaderLength, LPVOID lpOptional, DWORD dwOptionalLength,
DWORD dwContentLength, BOOL bEndRequest);
INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
LPCWSTR lpszVerb, LPCWSTR lpszObjectName, LPCWSTR lpszVersion,
LPCWSTR lpszReferrer , LPCWSTR *lpszAcceptTypes,
DWORD dwFlags, DWORD_PTR dwContext);
BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr);
VOID SendAsyncCallback(LPWININETHANDLEHEADER hdr, DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwInternetStatus, LPVOID lpvStatusInfo,
DWORD dwStatusInfoLength); DWORD dwStatusInfoLength);
VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD_PTR dwContext, VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwInternetStatus, LPVOID lpvStatusInfo,
DWORD dwStatusInfoLength); DWORD dwStatusInfoLength);
LPHTTPHEADERW HTTP_GetHeader(LPWININETHTTPREQW lpwhr, LPCWSTR header);
BOOL NETCON_connected(WININET_NETCONNECTION *connection); BOOL NETCON_connected(WININET_NETCONNECTION *connection);
BOOL NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL); DWORD NETCON_init(WININET_NETCONNECTION *connnection, BOOL useSSL);
BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain, void NETCON_unload(void);
DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
int type, int protocol); int type, int protocol);
BOOL NETCON_close(WININET_NETCONNECTION *connection); DWORD NETCON_close(WININET_NETCONNECTION *connection);
BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
unsigned int addrlen); unsigned int addrlen);
BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname); DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPWSTR hostname);
BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags, DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags,
int *sent /* out */); int *sent /* out */);
BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags, DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags,
int *recvd /* out */); int *recvd /* out */);
BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *available); BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *available);
BOOL NETCON_getNextLine(WININET_NETCONNECTION *connection, LPSTR lpszBuffer, LPDWORD dwBuffer);
LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection); LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection);
DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value); DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value);
int sock_get_error(int);
extern void URLCacheContainers_CreateDefaults(void); extern void URLCacheContainers_CreateDefaults(void);
extern void URLCacheContainers_DeleteAll(void); extern void URLCacheContainers_DeleteAll(void);

View file

@ -23,6 +23,12 @@
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
#define NONAMELESSUNION
#if defined(__MINGW32__) || defined (_MSC_VER)
#include <ws2tcpip.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_POLL_H #ifdef HAVE_POLL_H
#include <poll.h> #include <poll.h>
@ -33,10 +39,12 @@
#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
# include <sys/time.h> # include <sys/time.h>
#endif #endif
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H #ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h> # include <sys/socket.h>
#endif #endif
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
@ -55,9 +63,6 @@
#undef FAR #undef FAR
#undef DSA #undef DSA
#endif #endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
@ -81,7 +86,7 @@
#include "winsock2.h" #include "winsock2.h"
#define RESPONSE_TIMEOUT 30 /* FROM internet.c */ #define RESPONSE_TIMEOUT 30 /* FROM internet.c */
#define sock_get_error(x) WSAGetLastError()
WINE_DEFAULT_DEBUG_CHANNEL(wininet); WINE_DEFAULT_DEBUG_CHANNEL(wininet);
@ -95,11 +100,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet);
#include <openssl/err.h> #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_ssl_handle;
static void *OpenSSL_crypto_handle; static void *OpenSSL_crypto_handle;
static SSL_METHOD *meth; static SSL_METHOD *meth;
static SSL_CTX *ctx; static SSL_CTX *ctx;
static int hostname_idx;
static int error_idx;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f #define MAKE_FUNCPTR(f) static typeof(f) * p##f
@ -107,6 +124,7 @@ static SSL_CTX *ctx;
MAKE_FUNCPTR(SSL_library_init); MAKE_FUNCPTR(SSL_library_init);
MAKE_FUNCPTR(SSL_load_error_strings); MAKE_FUNCPTR(SSL_load_error_strings);
MAKE_FUNCPTR(SSLv23_method); MAKE_FUNCPTR(SSLv23_method);
MAKE_FUNCPTR(SSL_CTX_free);
MAKE_FUNCPTR(SSL_CTX_new); MAKE_FUNCPTR(SSL_CTX_new);
MAKE_FUNCPTR(SSL_new); MAKE_FUNCPTR(SSL_new);
MAKE_FUNCPTR(SSL_free); MAKE_FUNCPTR(SSL_free);
@ -115,46 +133,240 @@ MAKE_FUNCPTR(SSL_connect);
MAKE_FUNCPTR(SSL_shutdown); MAKE_FUNCPTR(SSL_shutdown);
MAKE_FUNCPTR(SSL_write); MAKE_FUNCPTR(SSL_write);
MAKE_FUNCPTR(SSL_read); MAKE_FUNCPTR(SSL_read);
MAKE_FUNCPTR(SSL_pending);
MAKE_FUNCPTR(SSL_get_ex_new_index);
MAKE_FUNCPTR(SSL_get_ex_data);
MAKE_FUNCPTR(SSL_set_ex_data);
MAKE_FUNCPTR(SSL_get_ex_data_X509_STORE_CTX_idx);
MAKE_FUNCPTR(SSL_get_verify_result); MAKE_FUNCPTR(SSL_get_verify_result);
MAKE_FUNCPTR(SSL_get_peer_certificate); MAKE_FUNCPTR(SSL_get_peer_certificate);
MAKE_FUNCPTR(SSL_CTX_get_timeout); MAKE_FUNCPTR(SSL_CTX_get_timeout);
MAKE_FUNCPTR(SSL_CTX_set_timeout); MAKE_FUNCPTR(SSL_CTX_set_timeout);
MAKE_FUNCPTR(SSL_CTX_set_default_verify_paths); MAKE_FUNCPTR(SSL_CTX_set_default_verify_paths);
MAKE_FUNCPTR(i2d_X509); MAKE_FUNCPTR(SSL_CTX_set_verify);
MAKE_FUNCPTR(X509_STORE_CTX_get_ex_data);
/* OpenSSL's libcrypto functions that we use */ /* OpenSSL's libcrypto functions that we use */
MAKE_FUNCPTR(BIO_new_fp); MAKE_FUNCPTR(BIO_new_fp);
MAKE_FUNCPTR(CRYPTO_num_locks);
MAKE_FUNCPTR(CRYPTO_set_id_callback);
MAKE_FUNCPTR(CRYPTO_set_locking_callback);
MAKE_FUNCPTR(ERR_free_strings);
MAKE_FUNCPTR(ERR_get_error); MAKE_FUNCPTR(ERR_get_error);
MAKE_FUNCPTR(ERR_error_string); MAKE_FUNCPTR(ERR_error_string);
MAKE_FUNCPTR(i2d_X509);
MAKE_FUNCPTR(sk_num);
MAKE_FUNCPTR(sk_value);
#undef MAKE_FUNCPTR #undef MAKE_FUNCPTR
static CRITICAL_SECTION *ssl_locks;
static unsigned int num_ssl_locks;
static unsigned long ssl_thread_id(void)
{
return GetCurrentThreadId();
}
static void ssl_lock_callback(int mode, int type, const char *file, int line)
{
if (mode & CRYPTO_LOCK)
EnterCriticalSection(&ssl_locks[type]);
else
LeaveCriticalSection(&ssl_locks[type]);
}
static PCCERT_CONTEXT X509_to_cert_context(X509 *cert)
{
unsigned char* buffer,*p;
INT len;
BOOL malloced = FALSE;
PCCERT_CONTEXT ret;
p = NULL;
len = pi2d_X509(cert,&p);
/*
* SSL 0.9.7 and above malloc the buffer if it is null.
* however earlier version do not and so we would need to alloc the buffer.
*
* see the i2d_X509 man page for more details.
*/
if (!p)
{
buffer = HeapAlloc(GetProcessHeap(),0,len);
p = buffer;
len = pi2d_X509(cert,&p);
}
else
{
buffer = p;
malloced = TRUE;
}
ret = CertCreateCertificateContext(X509_ASN_ENCODING,buffer,len);
if (malloced)
free(buffer);
else
HeapFree(GetProcessHeap(),0,buffer);
return ret;
}
static DWORD netconn_verify_cert(PCCERT_CONTEXT cert, HCERTSTORE store,
WCHAR *server)
{
BOOL ret;
CERT_CHAIN_PARA chainPara = { sizeof(chainPara), { 0 } };
PCCERT_CHAIN_CONTEXT chain;
char oid_server_auth[] = szOID_PKIX_KP_SERVER_AUTH;
char *server_auth[] = { oid_server_auth };
DWORD err = ERROR_SUCCESS;
TRACE("verifying %s\n", debugstr_w(server));
chainPara.RequestedUsage.Usage.cUsageIdentifier = 1;
chainPara.RequestedUsage.Usage.rgpszUsageIdentifier = server_auth;
if ((ret = CertGetCertificateChain(NULL, cert, NULL, store, &chainPara, 0,
NULL, &chain)))
{
if (chain->TrustStatus.dwErrorStatus)
{
if (chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_TIME_VALID)
err = ERROR_INTERNET_SEC_CERT_DATE_INVALID;
else if (chain->TrustStatus.dwErrorStatus &
CERT_TRUST_IS_UNTRUSTED_ROOT)
err = ERROR_INTERNET_INVALID_CA;
else if ((chain->TrustStatus.dwErrorStatus &
CERT_TRUST_IS_OFFLINE_REVOCATION) ||
(chain->TrustStatus.dwErrorStatus &
CERT_TRUST_REVOCATION_STATUS_UNKNOWN))
err = ERROR_INTERNET_SEC_CERT_NO_REV;
else if (chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_REVOKED)
err = ERROR_INTERNET_SEC_CERT_REVOKED;
else if (chain->TrustStatus.dwErrorStatus &
CERT_TRUST_IS_NOT_VALID_FOR_USAGE)
err = ERROR_INTERNET_SEC_INVALID_CERT;
else
err = ERROR_INTERNET_SEC_INVALID_CERT;
}
else
{
CERT_CHAIN_POLICY_PARA policyPara;
SSL_EXTRA_CERT_CHAIN_POLICY_PARA sslExtraPolicyPara;
CERT_CHAIN_POLICY_STATUS policyStatus;
sslExtraPolicyPara.u.cbSize = sizeof(sslExtraPolicyPara);
sslExtraPolicyPara.dwAuthType = AUTHTYPE_SERVER;
sslExtraPolicyPara.pwszServerName = server;
policyPara.cbSize = sizeof(policyPara);
policyPara.dwFlags = 0;
policyPara.pvExtraPolicyPara = &sslExtraPolicyPara;
ret = CertVerifyCertificateChainPolicy(CERT_CHAIN_POLICY_SSL,
chain, &policyPara, &policyStatus);
/* Any error in the policy status indicates that the
* policy couldn't be verified.
*/
if (ret && policyStatus.dwError)
{
if (policyStatus.dwError == CERT_E_CN_NO_MATCH)
err = ERROR_INTERNET_SEC_CERT_CN_INVALID;
else
err = ERROR_INTERNET_SEC_INVALID_CERT;
}
}
CertFreeCertificateChain(chain);
}
TRACE("returning %08x\n", err);
return err;
}
static int netconn_secure_verify(int preverify_ok, X509_STORE_CTX *ctx)
{
SSL *ssl;
WCHAR *server;
BOOL ret = FALSE;
ssl = pX509_STORE_CTX_get_ex_data(ctx,
pSSL_get_ex_data_X509_STORE_CTX_idx());
server = pSSL_get_ex_data(ssl, hostname_idx);
if (preverify_ok)
{
HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0,
CERT_STORE_CREATE_NEW_FLAG, NULL);
if (store)
{
X509 *cert;
int i;
PCCERT_CONTEXT endCert = NULL;
ret = TRUE;
for (i = 0; ret && i < psk_num((struct stack_st *)ctx->chain); i++)
{
PCCERT_CONTEXT context;
cert = (X509 *)psk_value((struct stack_st *)ctx->chain, i);
if ((context = X509_to_cert_context(cert)))
{
if (i == 0)
ret = CertAddCertificateContextToStore(store, context,
CERT_STORE_ADD_ALWAYS, &endCert);
else
ret = CertAddCertificateContextToStore(store, context,
CERT_STORE_ADD_ALWAYS, NULL);
CertFreeCertificateContext(context);
}
}
if (!endCert) ret = FALSE;
if (ret)
{
DWORD_PTR err = netconn_verify_cert(endCert, store, server);
if (err)
{
pSSL_set_ex_data(ssl, error_idx, (void *)err);
ret = FALSE;
}
}
CertFreeCertificateContext(endCert);
CertCloseStore(store, 0);
}
}
return ret;
}
#endif #endif
BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) DWORD NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
{ {
connection->useSSL = FALSE; connection->useSSL = FALSE;
connection->socketFD = -1; connection->socketFD = -1;
if (useSSL) if (useSSL)
{ {
#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) #if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO)
int i;
TRACE("using SSL connection\n"); TRACE("using SSL connection\n");
EnterCriticalSection(&init_ssl_cs);
if (OpenSSL_ssl_handle) /* already initialized everything */ if (OpenSSL_ssl_handle) /* already initialized everything */
return TRUE; {
LeaveCriticalSection(&init_ssl_cs);
return ERROR_SUCCESS;
}
OpenSSL_ssl_handle = wine_dlopen(SONAME_LIBSSL, RTLD_NOW, NULL, 0); OpenSSL_ssl_handle = wine_dlopen(SONAME_LIBSSL, RTLD_NOW, NULL, 0);
if (!OpenSSL_ssl_handle) if (!OpenSSL_ssl_handle)
{ {
ERR("trying to use a SSL connection, but couldn't load %s. Expect trouble.\n", ERR("trying to use a SSL connection, but couldn't load %s. Expect trouble.\n",
SONAME_LIBSSL); SONAME_LIBSSL);
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); LeaveCriticalSection(&init_ssl_cs);
return FALSE; return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
} }
OpenSSL_crypto_handle = wine_dlopen(SONAME_LIBCRYPTO, RTLD_NOW, NULL, 0); OpenSSL_crypto_handle = wine_dlopen(SONAME_LIBCRYPTO, RTLD_NOW, NULL, 0);
if (!OpenSSL_crypto_handle) if (!OpenSSL_crypto_handle)
{ {
ERR("trying to use a SSL connection, but couldn't load %s. Expect trouble.\n", ERR("trying to use a SSL connection, but couldn't load %s. Expect trouble.\n",
SONAME_LIBCRYPTO); SONAME_LIBCRYPTO);
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); LeaveCriticalSection(&init_ssl_cs);
return FALSE; return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
} }
/* mmm nice ugly macroness */ /* mmm nice ugly macroness */
@ -163,13 +375,14 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
if (!p##x) \ if (!p##x) \
{ \ { \
ERR("failed to load symbol %s\n", #x); \ ERR("failed to load symbol %s\n", #x); \
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); \ LeaveCriticalSection(&init_ssl_cs); \
return FALSE; \ return ERROR_INTERNET_SECURITY_CHANNEL_ERROR; \
} }
DYNSSL(SSL_library_init); DYNSSL(SSL_library_init);
DYNSSL(SSL_load_error_strings); DYNSSL(SSL_load_error_strings);
DYNSSL(SSLv23_method); DYNSSL(SSLv23_method);
DYNSSL(SSL_CTX_free);
DYNSSL(SSL_CTX_new); DYNSSL(SSL_CTX_new);
DYNSSL(SSL_new); DYNSSL(SSL_new);
DYNSSL(SSL_free); DYNSSL(SSL_free);
@ -178,12 +391,18 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
DYNSSL(SSL_shutdown); DYNSSL(SSL_shutdown);
DYNSSL(SSL_write); DYNSSL(SSL_write);
DYNSSL(SSL_read); DYNSSL(SSL_read);
DYNSSL(SSL_pending);
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_verify_result); DYNSSL(SSL_get_verify_result);
DYNSSL(SSL_get_peer_certificate); DYNSSL(SSL_get_peer_certificate);
DYNSSL(SSL_CTX_get_timeout); DYNSSL(SSL_CTX_get_timeout);
DYNSSL(SSL_CTX_set_timeout); DYNSSL(SSL_CTX_set_timeout);
DYNSSL(SSL_CTX_set_default_verify_paths); DYNSSL(SSL_CTX_set_default_verify_paths);
DYNSSL(i2d_X509); DYNSSL(SSL_CTX_set_verify);
DYNSSL(X509_STORE_CTX_get_ex_data);
#undef DYNSSL #undef DYNSSL
#define DYNCRYPTO(x) \ #define DYNCRYPTO(x) \
@ -191,12 +410,19 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
if (!p##x) \ if (!p##x) \
{ \ { \
ERR("failed to load symbol %s\n", #x); \ ERR("failed to load symbol %s\n", #x); \
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); \ LeaveCriticalSection(&init_ssl_cs); \
return FALSE; \ return ERROR_INTERNET_SECURITY_CHANNEL_ERROR; \
} }
DYNCRYPTO(BIO_new_fp); 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_get_error);
DYNCRYPTO(ERR_error_string); DYNCRYPTO(ERR_error_string);
DYNCRYPTO(i2d_X509);
DYNCRYPTO(sk_num);
DYNCRYPTO(sk_value);
#undef DYNCRYPTO #undef DYNCRYPTO
pSSL_library_init(); pSSL_library_init();
@ -204,15 +430,75 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL)
pBIO_new_fp(stderr, BIO_NOCLOSE); /* FIXME: should use winedebug stuff */ pBIO_new_fp(stderr, BIO_NOCLOSE); /* FIXME: should use winedebug stuff */
meth = pSSLv23_method(); meth = pSSLv23_method();
connection->peek_msg = NULL; ctx = pSSL_CTX_new(meth);
connection->peek_msg_mem = NULL; 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;
}
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 #else
FIXME("can't use SSL, not compiled in.\n"); FIXME("can't use SSL, not compiled in.\n");
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); return ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
return FALSE;
#endif #endif
} }
return TRUE; return ERROR_SUCCESS;
}
void NETCON_unload(void)
{
#if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO)
if (OpenSSL_crypto_handle)
{
pERR_free_strings();
wine_dlclose(OpenSSL_crypto_handle, NULL, 0);
}
if (OpenSSL_ssl_handle)
{
if (ctx)
pSSL_CTX_free(ctx);
wine_dlclose(OpenSSL_ssl_handle, NULL, 0);
}
if (ssl_locks)
{
int i;
for (i = 0; i < num_ssl_locks; i++) DeleteCriticalSection(&ssl_locks[i]);
HeapFree(GetProcessHeap(), 0, ssl_locks);
}
#endif
} }
BOOL NETCON_connected(WININET_NETCONNECTION *connection) BOOL NETCON_connected(WININET_NETCONNECTION *connection)
@ -223,9 +509,8 @@ BOOL NETCON_connected(WININET_NETCONNECTION *connection)
return TRUE; return TRUE;
} }
#if 0
/* translate a unix error code into a winsock one */ /* translate a unix error code into a winsock one */
static int sock_get_error( int err ) int sock_get_error( int err )
{ {
#if !defined(__MINGW32__) && !defined (_MSC_VER) #if !defined(__MINGW32__) && !defined (_MSC_VER)
switch (err) switch (err)
@ -290,47 +575,39 @@ static int sock_get_error( int err )
#endif #endif
return err; return err;
} }
#endif
/****************************************************************************** /******************************************************************************
* NETCON_create * NETCON_create
* Basically calls 'socket()' * Basically calls 'socket()'
*/ */
BOOL NETCON_create(WININET_NETCONNECTION *connection, int domain, DWORD NETCON_create(WININET_NETCONNECTION *connection, int domain,
int type, int protocol) int type, int protocol)
{ {
#ifdef SONAME_LIBSSL #ifdef SONAME_LIBSSL
if (connection->useSSL) if (connection->useSSL)
return FALSE; return ERROR_NOT_SUPPORTED;
#endif #endif
connection->socketFD = socket(domain, type, protocol); connection->socketFD = socket(domain, type, protocol);
if (connection->socketFD == -1) if (connection->socketFD == -1)
{ return sock_get_error(errno);
INTERNET_SetLastError(sock_get_error(errno));
return FALSE; return ERROR_SUCCESS;
}
return TRUE;
} }
/****************************************************************************** /******************************************************************************
* NETCON_close * NETCON_close
* Basically calls 'close()' unless we should use SSL * Basically calls 'close()' unless we should use SSL
*/ */
BOOL NETCON_close(WININET_NETCONNECTION *connection) DWORD NETCON_close(WININET_NETCONNECTION *connection)
{ {
int result; int result;
if (!NETCON_connected(connection)) return FALSE; if (!NETCON_connected(connection)) return ERROR_SUCCESS;
#ifdef SONAME_LIBSSL #ifdef SONAME_LIBSSL
if (connection->useSSL) if (connection->useSSL)
{ {
HeapFree(GetProcessHeap(),0,connection->peek_msg_mem);
connection->peek_msg = NULL;
connection->peek_msg_mem = NULL;
connection->peek_len = 0;
pSSL_shutdown(connection->ssl_s); pSSL_shutdown(connection->ssl_s);
pSSL_free(connection->ssl_s); pSSL_free(connection->ssl_s);
connection->ssl_s = NULL; connection->ssl_s = NULL;
@ -343,52 +620,34 @@ BOOL NETCON_close(WININET_NETCONNECTION *connection)
connection->socketFD = -1; connection->socketFD = -1;
if (result == -1) if (result == -1)
{ return sock_get_error(errno);
INTERNET_SetLastError(sock_get_error(errno)); return ERROR_SUCCESS;
return FALSE;
}
return TRUE;
} }
#ifdef SONAME_LIBSSL
static BOOL check_hostname(X509 *cert, char *hostname)
{
/* FIXME: implement */
return TRUE;
}
#endif
/****************************************************************************** /******************************************************************************
* NETCON_secure_connect * NETCON_secure_connect
* Initiates a secure connection over an existing plaintext connection. * Initiates a secure connection over an existing plaintext connection.
*/ */
BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname) DWORD NETCON_secure_connect(WININET_NETCONNECTION *connection, LPWSTR hostname)
{ {
DWORD res = ERROR_NOT_SUPPORTED;
#ifdef SONAME_LIBSSL #ifdef SONAME_LIBSSL
long verify_res; long verify_res;
X509 *cert; X509 *cert;
int len;
char *hostname_unix;
/* can't connect if we are already connected */ /* can't connect if we are already connected */
if (connection->useSSL) if (connection->useSSL)
{ {
ERR("already connected\n"); ERR("already connected\n");
return FALSE; return ERROR_INTERNET_CANNOT_CONNECT;
} }
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));
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
return FALSE;
}
connection->ssl_s = pSSL_new(ctx); connection->ssl_s = pSSL_new(ctx);
if (!connection->ssl_s) if (!connection->ssl_s)
{ {
ERR("SSL_new failed: %s\n", ERR("SSL_new failed: %s\n",
pERR_error_string(pERR_get_error(), 0)); pERR_error_string(pERR_get_error(), 0));
INTERNET_SetLastError(ERROR_OUTOFMEMORY); res = ERROR_OUTOFMEMORY;
goto fail; goto fail;
} }
@ -396,23 +655,25 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname)
{ {
ERR("SSL_set_fd failed: %s\n", ERR("SSL_set_fd failed: %s\n",
pERR_error_string(pERR_get_error(), 0)); pERR_error_string(pERR_get_error(), 0));
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); res = ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
goto fail; goto fail;
} }
if (pSSL_connect(connection->ssl_s) <= 0) if (pSSL_connect(connection->ssl_s) <= 0)
{ {
ERR("SSL_connect failed: %s\n", res = (DWORD_PTR)pSSL_get_ex_data(connection->ssl_s, error_idx);
pERR_error_string(pERR_get_error(), 0)); if (!res)
INTERNET_SetLastError(ERROR_INTERNET_SECURITY_CHANNEL_ERROR); res = ERROR_INTERNET_SECURITY_CHANNEL_ERROR;
ERR("SSL_connect failed: %d\n", res);
goto fail; goto fail;
} }
pSSL_set_ex_data(connection->ssl_s, hostname_idx, hostname);
cert = pSSL_get_peer_certificate(connection->ssl_s); cert = pSSL_get_peer_certificate(connection->ssl_s);
if (!cert) if (!cert)
{ {
ERR("no certificate for server %s\n", debugstr_w(hostname)); ERR("no certificate for server %s\n", debugstr_w(hostname));
/* FIXME: is this the best error? */ /* FIXME: is this the best error? */
INTERNET_SetLastError(ERROR_INTERNET_INVALID_CA); res = ERROR_INTERNET_INVALID_CA;
goto fail; goto fail;
} }
verify_res = pSSL_get_verify_result(connection->ssl_s); verify_res = pSSL_get_verify_result(connection->ssl_s);
@ -423,25 +684,8 @@ BOOL NETCON_secure_connect(WININET_NETCONNECTION *connection, LPCWSTR hostname)
* the moment */ * the moment */
} }
len = WideCharToMultiByte(CP_UNIXCP, 0, hostname, -1, NULL, 0, NULL, NULL);
hostname_unix = HeapAlloc(GetProcessHeap(), 0, len);
if (!hostname_unix)
{
INTERNET_SetLastError(ERROR_OUTOFMEMORY);
goto fail;
}
WideCharToMultiByte(CP_UNIXCP, 0, hostname, -1, hostname_unix, len, NULL, NULL);
if (!check_hostname(cert, hostname_unix))
{
HeapFree(GetProcessHeap(), 0, hostname_unix);
INTERNET_SetLastError(ERROR_INTERNET_SEC_CERT_CN_INVALID);
goto fail;
}
HeapFree(GetProcessHeap(), 0, hostname_unix);
connection->useSSL = TRUE; connection->useSSL = TRUE;
return TRUE; return ERROR_SUCCESS;
fail: fail:
if (connection->ssl_s) if (connection->ssl_s)
@ -451,32 +695,29 @@ fail:
connection->ssl_s = NULL; connection->ssl_s = NULL;
} }
#endif #endif
return FALSE; return res;
} }
/****************************************************************************** /******************************************************************************
* NETCON_connect * NETCON_connect
* Connects to the specified address. * Connects to the specified address.
*/ */
BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr, DWORD NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *serv_addr,
unsigned int addrlen) unsigned int addrlen)
{ {
int result; int result;
if (!NETCON_connected(connection)) return FALSE;
result = connect(connection->socketFD, serv_addr, addrlen); result = connect(connection->socketFD, serv_addr, addrlen);
if (result == -1) if (result == -1)
{ {
WARN("Unable to connect to host (%s)\n", strerror(errno)); WARN("Unable to connect to host (%s)\n", strerror(errno));
INTERNET_SetLastError(sock_get_error(errno));
closesocket(connection->socketFD); closesocket(connection->socketFD);
connection->socketFD = -1; connection->socketFD = -1;
return FALSE; return sock_get_error(errno);
} }
return TRUE; return ERROR_SUCCESS;
} }
/****************************************************************************** /******************************************************************************
@ -484,19 +725,16 @@ BOOL NETCON_connect(WININET_NETCONNECTION *connection, const struct sockaddr *se
* Basically calls 'send()' unless we should use SSL * Basically calls 'send()' unless we should use SSL
* number of chars send is put in *sent * number of chars send is put in *sent
*/ */
BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags, DWORD NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len, int flags,
int *sent /* out */) int *sent /* out */)
{ {
if (!NETCON_connected(connection)) return FALSE; if (!NETCON_connected(connection)) return ERROR_INTERNET_CONNECTION_ABORTED;
if (!connection->useSSL) if (!connection->useSSL)
{ {
*sent = send(connection->socketFD, msg, len, flags); *sent = send(connection->socketFD, msg, len, flags);
if (*sent == -1) if (*sent == -1)
{ return sock_get_error(errno);
INTERNET_SetLastError(sock_get_error(errno)); return ERROR_SUCCESS;
return FALSE;
}
return TRUE;
} }
else else
{ {
@ -505,10 +743,10 @@ BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len,
FIXME("SSL_write doesn't support any flags (%08x)\n", flags); FIXME("SSL_write doesn't support any flags (%08x)\n", flags);
*sent = pSSL_write(connection->ssl_s, msg, len); *sent = pSSL_write(connection->ssl_s, msg, len);
if (*sent < 1 && len) if (*sent < 1 && len)
return FALSE; return ERROR_INTERNET_CONNECTION_ABORTED;
return TRUE; return ERROR_SUCCESS;
#else #else
return FALSE; return ERROR_NOT_SUPPORTED;
#endif #endif
} }
} }
@ -518,77 +756,25 @@ BOOL NETCON_send(WININET_NETCONNECTION *connection, const void *msg, size_t len,
* Basically calls 'recv()' unless we should use SSL * Basically calls 'recv()' unless we should use SSL
* number of chars received is put in *recvd * number of chars received is put in *recvd
*/ */
BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags, DWORD NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int flags,
int *recvd /* out */) int *recvd /* out */)
{ {
*recvd = 0; *recvd = 0;
if (!NETCON_connected(connection)) return FALSE; if (!NETCON_connected(connection)) return ERROR_INTERNET_CONNECTION_ABORTED;
if (!len) if (!len)
return TRUE; return ERROR_SUCCESS;
if (!connection->useSSL) if (!connection->useSSL)
{ {
*recvd = recv(connection->socketFD, buf, len, flags); *recvd = recv(connection->socketFD, buf, len, flags);
if (*recvd == -1) return *recvd == -1 ? sock_get_error(errno) : ERROR_SUCCESS;
{
INTERNET_SetLastError(sock_get_error(errno));
return FALSE;
}
return TRUE;
} }
else else
{ {
#ifdef SONAME_LIBSSL #ifdef SONAME_LIBSSL
if (flags & ~(MSG_PEEK|MSG_WAITALL)) *recvd = pSSL_read(connection->ssl_s, buf, len);
FIXME("SSL_read does not support the following flag: %08x\n", flags); return *recvd > 0 ? ERROR_SUCCESS : ERROR_INTERNET_CONNECTION_ABORTED;
/* this ugly hack is all for MSG_PEEK. eww gross */
if (flags & MSG_PEEK && !connection->peek_msg)
{
connection->peek_msg = connection->peek_msg_mem = HeapAlloc(GetProcessHeap(), 0, (sizeof(char) * len) + 1);
}
else if (flags & MSG_PEEK && connection->peek_msg)
{
if (len < connection->peek_len)
FIXME("buffer isn't big enough. Do the expect us to wrap?\n");
*recvd = min(len, connection->peek_len);
memcpy(buf, connection->peek_msg, *recvd);
return TRUE;
}
else if (connection->peek_msg)
{
*recvd = min(len, connection->peek_len);
memcpy(buf, connection->peek_msg, *recvd);
connection->peek_len -= *recvd;
connection->peek_msg += *recvd;
if (connection->peek_len == 0)
{
HeapFree(GetProcessHeap(), 0, connection->peek_msg_mem);
connection->peek_msg_mem = NULL;
connection->peek_msg = NULL;
}
/* check if we got enough data from the peek buffer */
if (!(flags & MSG_WAITALL) || (*recvd == len))
return TRUE;
/* otherwise, fall through */
}
*recvd += pSSL_read(connection->ssl_s, (char*)buf + *recvd, len - *recvd);
if (flags & MSG_PEEK) /* must copy stuff into buffer */
{
connection->peek_len = *recvd;
if (!*recvd)
{
HeapFree(GetProcessHeap(), 0, connection->peek_msg_mem);
connection->peek_msg_mem = NULL;
connection->peek_msg = NULL;
}
else
memcpy(connection->peek_msg, buf, *recvd);
}
if (*recvd < 1 && len)
return FALSE;
return TRUE;
#else #else
return FALSE; return ERROR_NOT_SUPPORTED;
#endif #endif
} }
} }
@ -604,13 +790,9 @@ BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *avail
if (!NETCON_connected(connection)) if (!NETCON_connected(connection))
return FALSE; return FALSE;
#ifdef SONAME_LIBSSL
if (connection->peek_msg) *available = connection->peek_len;
#endif
#ifdef FIONREAD
if (!connection->useSSL) if (!connection->useSSL)
{ {
#ifdef FIONREAD
int unread; int unread;
int retval = ioctlsocket(connection->socketFD, FIONREAD, &unread); int retval = ioctlsocket(connection->socketFD, FIONREAD, &unread);
if (!retval) if (!retval)
@ -618,155 +800,28 @@ BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *avail
TRACE("%d bytes of queued, but unread data\n", unread); TRACE("%d bytes of queued, but unread data\n", unread);
*available += unread; *available += unread;
} }
}
#endif #endif
return TRUE;
}
/******************************************************************************
* NETCON_getNextLine
*/
BOOL NETCON_getNextLine(WININET_NETCONNECTION *connection, LPSTR lpszBuffer, LPDWORD dwBuffer)
{
TRACE("\n");
if (!NETCON_connected(connection)) return FALSE;
if (!connection->useSSL)
{
struct timeval tv;
fd_set infd;
BOOL bSuccess = FALSE;
DWORD nRecv = 0;
FD_ZERO(&infd);
FD_SET(connection->socketFD, &infd);
tv.tv_sec=RESPONSE_TIMEOUT;
tv.tv_usec=0;
while (nRecv < *dwBuffer)
{
if (select(connection->socketFD+1,&infd,NULL,NULL,&tv) > 0)
{
if (recv(connection->socketFD, &lpszBuffer[nRecv], 1, 0) <= 0)
{
INTERNET_SetLastError(sock_get_error(errno));
goto lend;
}
if (lpszBuffer[nRecv] == '\n')
{
bSuccess = TRUE;
break;
}
if (lpszBuffer[nRecv] != '\r')
nRecv++;
}
else
{
INTERNET_SetLastError(ERROR_INTERNET_TIMEOUT);
goto lend;
}
}
lend: /* FIXME: don't use labels */
if (bSuccess)
{
lpszBuffer[nRecv++] = '\0';
*dwBuffer = nRecv;
TRACE(":%u %s\n", nRecv, lpszBuffer);
return TRUE;
}
else
{
return FALSE;
}
} }
else else
{ {
#ifdef SONAME_LIBSSL #ifdef SONAME_LIBSSL
long prev_timeout; *available = pSSL_pending(connection->ssl_s);
DWORD nRecv = 0;
BOOL success = TRUE;
prev_timeout = pSSL_CTX_get_timeout(ctx);
pSSL_CTX_set_timeout(ctx, RESPONSE_TIMEOUT);
while (nRecv < *dwBuffer)
{
int recv = 1;
if (!NETCON_recv(connection, &lpszBuffer[nRecv], 1, 0, &recv))
{
INTERNET_SetLastError(ERROR_CONNECTION_ABORTED);
success = FALSE;
}
if (lpszBuffer[nRecv] == '\n')
{
success = TRUE;
break;
}
if (lpszBuffer[nRecv] != '\r')
nRecv++;
}
pSSL_CTX_set_timeout(ctx, prev_timeout);
if (success)
{
lpszBuffer[nRecv++] = '\0';
*dwBuffer = nRecv;
TRACE("_SSL:%u %s\n", nRecv, lpszBuffer);
return TRUE;
}
return FALSE;
#else
return FALSE;
#endif #endif
} }
return TRUE;
} }
LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection) LPCVOID NETCON_GetCert(WININET_NETCONNECTION *connection)
{ {
#ifdef SONAME_LIBSSL #ifdef SONAME_LIBSSL
X509* cert; X509* cert;
unsigned char* buffer,*p;
INT len;
BOOL malloced = FALSE;
LPCVOID r = NULL; LPCVOID r = NULL;
if (!connection->useSSL) if (!connection->useSSL)
return NULL; return NULL;
cert = pSSL_get_peer_certificate(connection->ssl_s); cert = pSSL_get_peer_certificate(connection->ssl_s);
p = NULL; r = X509_to_cert_context(cert);
len = pi2d_X509(cert,&p);
/*
* SSL 0.9.7 and above malloc the buffer if it is null.
* however earlier version do not and so we would need to alloc the buffer.
*
* see the i2d_X509 man page for more details.
*/
if (!p)
{
buffer = HeapAlloc(GetProcessHeap(),0,len);
p = buffer;
len = pi2d_X509(cert,&p);
}
else
{
buffer = p;
malloced = TRUE;
}
r = CertCreateCertificateContext(X509_ASN_ENCODING,buffer,len);
if (malloced)
free(buffer);
else
HeapFree(GetProcessHeap(),0,buffer);
return r; return r;
#else #else
return NULL; return NULL;
@ -788,7 +843,7 @@ DWORD NETCON_set_timeout(WININET_NETCONNECTION *connection, BOOL send, int value
tv.tv_usec = (value % 1000) * 1000; tv.tv_usec = (value % 1000) * 1000;
result = setsockopt(connection->socketFD, SOL_SOCKET, result = setsockopt(connection->socketFD, SOL_SOCKET,
send ? SO_SNDTIMEO : SO_RCVTIMEO, &tv, send ? SO_SNDTIMEO : SO_RCVTIMEO, (void*)&tv,
sizeof(tv)); sizeof(tv));
if (result == -1) if (result == -1)

View file

@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <windef.h>
#include <winuser.h>
#define IDD_AUTHDLG 0x399
#define IDD_PROXYDLG 0x400 #define IDD_PROXYDLG 0x400
#define IDC_PROXY 0x401 #define IDC_PROXY 0x401
@ -25,5 +29,6 @@
#define IDC_USERNAME 0x403 #define IDC_USERNAME 0x403
#define IDC_PASSWORD 0x404 #define IDC_PASSWORD 0x404
#define IDC_SAVEPASSWORD 0x405 #define IDC_SAVEPASSWORD 0x405
#define IDC_SERVER 0x406
#define IDS_LANCONNECTION 0x500 #define IDS_LANCONNECTION 0x500

View file

@ -43,24 +43,28 @@
#include "wininet_Bg.rc" #include "wininet_Bg.rc"
#include "wininet_Cs.rc" #include "wininet_Cs.rc"
#include "wininet_Da.rc" #include "wininet_Da.rc"
#include "wininet_De.rc"
#include "wininet_En.rc" #include "wininet_En.rc"
#include "wininet_Eo.rc" #include "wininet_Eo.rc"
#include "wininet_Es.rc" #include "wininet_Es.rc"
#include "wininet_Fi.rc" #include "wininet_Fi.rc"
#include "wininet_Fr.rc"
#include "wininet_Hu.rc" #include "wininet_Hu.rc"
#include "wininet_It.rc" #include "wininet_It.rc"
#include "wininet_Ja.rc"
#include "wininet_Ko.rc" #include "wininet_Ko.rc"
#include "wininet_Nl.rc" #include "wininet_Nl.rc"
#include "wininet_No.rc"
#include "wininet_Pl.rc" #include "wininet_Pl.rc"
#include "wininet_Sv.rc"
#include "wininet_Uk.rc"
#include "wininet_Tr.rc"
/* UTF-8 */
#include "wininet_De.rc"
#include "wininet_Fr.rc"
#include "wininet_Ja.rc"
#include "wininet_Lt.rc"
#include "wininet_No.rc"
#include "wininet_Pt.rc" #include "wininet_Pt.rc"
#include "wininet_Ro.rc" #include "wininet_Ro.rc"
#include "wininet_Ru.rc" #include "wininet_Ru.rc"
#include "wininet_Si.rc" #include "wininet_Si.rc"
#include "wininet_Sv.rc"
#include "wininet_Uk.rc"
#include "wininet_Tr.rc"
#include "wininet_Zh.rc" #include "wininet_Zh.rc"

View file

@ -465,7 +465,6 @@ static void URLCacheContainer_CloseIndex(URLCACHECONTAINER * pContainer)
static BOOL URLCacheContainers_AddContainer(LPCWSTR cache_prefix, LPCWSTR path, LPWSTR mutex_name) static BOOL URLCacheContainers_AddContainer(LPCWSTR cache_prefix, LPCWSTR path, LPWSTR mutex_name)
{ {
URLCACHECONTAINER * pContainer = HeapAlloc(GetProcessHeap(), 0, sizeof(URLCACHECONTAINER)); URLCACHECONTAINER * pContainer = HeapAlloc(GetProcessHeap(), 0, sizeof(URLCACHECONTAINER));
int path_len = strlenW(path);
int cache_prefix_len = strlenW(cache_prefix); int cache_prefix_len = strlenW(cache_prefix);
if (!pContainer) if (!pContainer)
@ -476,15 +475,13 @@ static BOOL URLCacheContainers_AddContainer(LPCWSTR cache_prefix, LPCWSTR path,
pContainer->hMapping = NULL; pContainer->hMapping = NULL;
pContainer->file_size = 0; pContainer->file_size = 0;
pContainer->path = HeapAlloc(GetProcessHeap(), 0, (path_len + 1) * sizeof(WCHAR)); pContainer->path = heap_strdupW(path);
if (!pContainer->path) if (!pContainer->path)
{ {
HeapFree(GetProcessHeap(), 0, pContainer); HeapFree(GetProcessHeap(), 0, pContainer);
return FALSE; return FALSE;
} }
memcpy(pContainer->path, path, (path_len + 1) * sizeof(WCHAR));
pContainer->cache_prefix = HeapAlloc(GetProcessHeap(), 0, (cache_prefix_len + 1) * sizeof(WCHAR)); pContainer->cache_prefix = HeapAlloc(GetProcessHeap(), 0, (cache_prefix_len + 1) * sizeof(WCHAR));
if (!pContainer->cache_prefix) if (!pContainer->cache_prefix)
{ {
@ -593,6 +590,9 @@ static DWORD URLCacheContainers_FindContainerW(LPCWSTR lpwszUrl, URLCACHECONTAIN
TRACE("searching for prefix for URL: %s\n", debugstr_w(lpwszUrl)); TRACE("searching for prefix for URL: %s\n", debugstr_w(lpwszUrl));
if(!lpwszUrl)
return ERROR_INVALID_PARAMETER;
LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry) LIST_FOR_EACH_ENTRY(pContainer, &UrlContainers, URLCACHECONTAINER, entry)
{ {
int prefix_len = strlenW(pContainer->cache_prefix); int prefix_len = strlenW(pContainer->cache_prefix);
@ -609,17 +609,15 @@ static DWORD URLCacheContainers_FindContainerW(LPCWSTR lpwszUrl, URLCACHECONTAIN
static DWORD URLCacheContainers_FindContainerA(LPCSTR lpszUrl, URLCACHECONTAINER ** ppContainer) static DWORD URLCacheContainers_FindContainerA(LPCSTR lpszUrl, URLCACHECONTAINER ** ppContainer)
{ {
LPWSTR url = NULL;
DWORD ret; DWORD ret;
LPWSTR lpwszUrl;
int url_len = MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, NULL, 0); if (lpszUrl && !(url = heap_strdupAtoW(lpszUrl)))
if (url_len && (lpwszUrl = HeapAlloc(GetProcessHeap(), 0, url_len * sizeof(WCHAR)))) return ERROR_OUTOFMEMORY;
{
MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, lpwszUrl, url_len); ret = URLCacheContainers_FindContainerW(url, ppContainer);
ret = URLCacheContainers_FindContainerW(lpwszUrl, ppContainer); HeapFree(GetProcessHeap(), 0, url);
HeapFree(GetProcessHeap(), 0, lpwszUrl); return ret;
return ret;
}
return GetLastError();
} }
static BOOL URLCacheContainers_Enum(LPCWSTR lpwszSearchPattern, DWORD dwIndex, URLCACHECONTAINER ** ppContainer) static BOOL URLCacheContainers_Enum(LPCWSTR lpwszSearchPattern, DWORD dwIndex, URLCACHECONTAINER ** ppContainer)
@ -692,6 +690,7 @@ static LPURLCACHE_HEADER URLCacheContainer_LockIndex(URLCACHECONTAINER * pContai
* of the memory mapped file */ * of the memory mapped file */
if (pHeader->dwFileSize != pContainer->file_size) if (pHeader->dwFileSize != pContainer->file_size)
{ {
UnmapViewOfFile( pHeader );
URLCacheContainer_CloseIndex(pContainer); URLCacheContainer_CloseIndex(pContainer);
error = URLCacheContainer_OpenIndex(pContainer); error = URLCacheContainer_OpenIndex(pContainer);
if (error != ERROR_SUCCESS) if (error != ERROR_SUCCESS)
@ -1240,17 +1239,15 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
static BOOL URLCache_FindHashW(LPCURLCACHE_HEADER pHeader, LPCWSTR lpszUrl, struct _HASH_ENTRY ** ppHashEntry) static BOOL URLCache_FindHashW(LPCURLCACHE_HEADER pHeader, LPCWSTR lpszUrl, struct _HASH_ENTRY ** ppHashEntry)
{ {
LPSTR urlA; LPSTR urlA;
int url_len;
BOOL ret; BOOL ret;
url_len = WideCharToMultiByte(CP_ACP, 0, lpszUrl, -1, NULL, 0, NULL, NULL); urlA = heap_strdupWtoA(lpszUrl);
urlA = HeapAlloc(GetProcessHeap(), 0, url_len * sizeof(CHAR));
if (!urlA) if (!urlA)
{ {
SetLastError(ERROR_OUTOFMEMORY); SetLastError(ERROR_OUTOFMEMORY);
return FALSE; return FALSE;
} }
WideCharToMultiByte(CP_ACP, 0, lpszUrl, -1, urlA, url_len, NULL, NULL);
ret = URLCache_FindHash(pHeader, urlA, ppHashEntry); ret = URLCache_FindHash(pHeader, urlA, ppHashEntry);
HeapFree(GetProcessHeap(), 0, urlA); HeapFree(GetProcessHeap(), 0, urlA);
return ret; return ret;
@ -1451,6 +1448,28 @@ static BOOL URLCache_EnumHashTableEntries(LPCURLCACHE_HEADER pHeader, const HASH
return FALSE; return FALSE;
} }
/***********************************************************************
* FreeUrlCacheSpaceA (WININET.@)
*
*/
BOOL WINAPI FreeUrlCacheSpaceA(LPCSTR lpszCachePath, DWORD dwSize, DWORD dwFilter)
{
FIXME("stub!\n");
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/***********************************************************************
* FreeUrlCacheSpaceW (WININET.@)
*
*/
BOOL WINAPI FreeUrlCacheSpaceW(LPCWSTR lpszCachePath, DWORD dwSize, DWORD dwFilter)
{
FIXME("stub!\n");
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/*********************************************************************** /***********************************************************************
* GetUrlCacheEntryInfoExA (WININET.@) * GetUrlCacheEntryInfoExA (WININET.@)
* *
@ -1482,7 +1501,11 @@ BOOL WINAPI GetUrlCacheEntryInfoExA(
return FALSE; return FALSE;
} }
if (dwFlags != 0) if (dwFlags != 0)
{
FIXME("Undocumented flag(s): %x\n", dwFlags); FIXME("Undocumented flag(s): %x\n", dwFlags);
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
return GetUrlCacheEntryInfoA(lpszUrl, lpCacheEntryInfo, lpdwCacheEntryInfoBufSize); return GetUrlCacheEntryInfoA(lpszUrl, lpCacheEntryInfo, lpdwCacheEntryInfoBufSize);
} }
@ -1682,7 +1705,11 @@ BOOL WINAPI GetUrlCacheEntryInfoExW(
return FALSE; return FALSE;
} }
if (dwFlags != 0) if (dwFlags != 0)
{
FIXME("Undocumented flag(s): %x\n", dwFlags); FIXME("Undocumented flag(s): %x\n", dwFlags);
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
return GetUrlCacheEntryInfoW(lpszUrl, lpCacheEntryInfo, lpdwCacheEntryInfoBufSize); return GetUrlCacheEntryInfoW(lpszUrl, lpCacheEntryInfo, lpdwCacheEntryInfoBufSize);
} }
@ -1869,6 +1896,13 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
} }
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry; pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
if (!pUrlEntry->dwOffsetLocalName)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
SetLastError(ERROR_INVALID_DATA);
return FALSE;
}
TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl);
TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo);
@ -1958,6 +1992,13 @@ BOOL WINAPI RetrieveUrlCacheEntryFileW(
} }
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry; pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
if (!pUrlEntry->dwOffsetLocalName)
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
SetLastError(ERROR_INVALID_DATA);
return FALSE;
}
TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl);
TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo);
@ -2142,21 +2183,16 @@ BOOL WINAPI CreateUrlCacheEntryA(
IN DWORD dwReserved IN DWORD dwReserved
) )
{ {
DWORD len;
WCHAR *url_name; WCHAR *url_name;
WCHAR *file_extension; WCHAR *file_extension;
WCHAR file_name[MAX_PATH]; WCHAR file_name[MAX_PATH];
BOOL bSuccess = FALSE; BOOL bSuccess = FALSE;
DWORD dwError = 0; DWORD dwError = 0;
if ((len = MultiByteToWideChar(CP_ACP, 0, lpszUrlName, -1, NULL, 0)) != 0 && if (lpszUrlName && (url_name = heap_strdupAtoW(lpszUrlName)))
(url_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))) != 0)
{ {
MultiByteToWideChar(CP_ACP, 0, lpszUrlName, -1, url_name, len); if (lpszFileExtension && (file_extension = heap_strdupAtoW(lpszFileExtension)))
if ((len = MultiByteToWideChar(CP_ACP, 0, lpszFileExtension, -1, NULL, 0)) != 0 &&
(file_extension = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))) != 0)
{ {
MultiByteToWideChar(CP_ACP, 0, lpszFileExtension, -1, file_extension, len);
if (CreateUrlCacheEntryW(url_name, dwExpectedFileSize, file_extension, file_name, dwReserved)) if (CreateUrlCacheEntryW(url_name, dwExpectedFileSize, file_extension, file_name, dwReserved))
{ {
if (WideCharToMultiByte(CP_ACP, 0, file_name, -1, lpszFileName, MAX_PATH, NULL, NULL) < MAX_PATH) if (WideCharToMultiByte(CP_ACP, 0, file_name, -1, lpszFileName, MAX_PATH, NULL, NULL) < MAX_PATH)
@ -2211,7 +2247,11 @@ BOOL WINAPI CreateUrlCacheEntryW(
BOOL bFound = FALSE; BOOL bFound = FALSE;
int count; int count;
DWORD error; DWORD error;
HANDLE hFile;
FILETIME ft;
static const WCHAR szWWW[] = {'w','w','w',0}; static const WCHAR szWWW[] = {'w','w','w',0};
static const WCHAR fmt[] = {'%','0','8','X','%','s',0};
TRACE("(%s, 0x%08x, %s, %p, 0x%08x)\n", TRACE("(%s, 0x%08x, %s, %p, 0x%08x)\n",
debugstr_w(lpszUrlName), debugstr_w(lpszUrlName),
@ -2221,11 +2261,7 @@ BOOL WINAPI CreateUrlCacheEntryW(
dwReserved); dwReserved);
if (dwReserved) if (dwReserved)
{ FIXME("dwReserved 0x%08x\n", dwReserved);
ERR("dwReserved != 0\n");
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
lpszUrlEnd = lpszUrlName + strlenW(lpszUrlName); lpszUrlEnd = lpszUrlName + strlenW(lpszUrlName);
@ -2318,7 +2354,6 @@ BOOL WINAPI CreateUrlCacheEntryW(
for (i = 0; i < 255; i++) for (i = 0; i < 255; i++)
{ {
static const WCHAR szFormat[] = {'[','%','u',']','%','s',0}; static const WCHAR szFormat[] = {'[','%','u',']','%','s',0};
HANDLE hFile;
WCHAR *p; WCHAR *p;
wsprintfW(lpszFileNameNoPath + countnoextension, szFormat, i, szExtension); wsprintfW(lpszFileNameNoPath + countnoextension, szFormat, i, szExtension);
@ -2346,6 +2381,18 @@ BOOL WINAPI CreateUrlCacheEntryW(
} }
} }
GetSystemTimeAsFileTime(&ft);
wsprintfW(lpszFileNameNoPath + countnoextension, fmt, ft.dwLowDateTime, szExtension);
TRACE("Trying: %s\n", debugstr_w(lpszFileName));
hFile = CreateFileW(lpszFileName, GENERIC_READ, 0, NULL, CREATE_NEW, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
CloseHandle(hFile);
return TRUE;
}
WARN("Could not find a unique filename\n");
return FALSE; return FALSE;
} }
@ -2447,25 +2494,17 @@ static BOOL CommitUrlCacheEntryInternal(
if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) if (!(pHeader = URLCacheContainer_LockIndex(pContainer)))
return FALSE; return FALSE;
len = WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, NULL, 0, NULL, NULL); lpszUrlNameA = heap_strdupWtoA(lpszUrlName);
lpszUrlNameA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
if (!lpszUrlNameA) if (!lpszUrlNameA)
{ {
error = GetLastError(); error = GetLastError();
goto cleanup; goto cleanup;
} }
WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, lpszUrlNameA, len, NULL, NULL);
if (lpszFileExtension) if (lpszFileExtension && !(lpszFileExtensionA = heap_strdupWtoA(lpszFileExtension)))
{ {
len = WideCharToMultiByte(CP_ACP, 0, lpszFileExtension, -1, NULL, 0, NULL, NULL); error = GetLastError();
lpszFileExtensionA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char)); goto cleanup;
if (!lpszFileExtensionA)
{
error = GetLastError();
goto cleanup;
}
WideCharToMultiByte(CP_ACP, 0, lpszFileExtension, -1, lpszFileExtensionA, len, NULL, NULL);
} }
if (URLCache_FindHash(pHeader, lpszUrlNameA, &pHashEntry)) if (URLCache_FindHash(pHeader, lpszUrlNameA, &pHashEntry))
@ -2622,7 +2661,6 @@ BOOL WINAPI CommitUrlCacheEntryA(
IN LPCSTR lpszOriginalUrl IN LPCSTR lpszOriginalUrl
) )
{ {
DWORD len;
WCHAR *url_name = NULL; WCHAR *url_name = NULL;
WCHAR *local_file_name = NULL; WCHAR *local_file_name = NULL;
WCHAR *original_url = NULL; WCHAR *original_url = NULL;
@ -2638,35 +2676,27 @@ BOOL WINAPI CommitUrlCacheEntryA(
debugstr_a(lpszFileExtension), debugstr_a(lpszFileExtension),
debugstr_a(lpszOriginalUrl)); debugstr_a(lpszOriginalUrl));
len = MultiByteToWideChar(CP_ACP, 0, lpszUrlName, -1, NULL, 0); url_name = heap_strdupAtoW(lpszUrlName);
url_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!url_name) if (!url_name)
goto cleanup; goto cleanup;
MultiByteToWideChar(CP_ACP, 0, lpszUrlName, -1, url_name, len);
if (lpszLocalFileName) if (lpszLocalFileName)
{ {
len = MultiByteToWideChar(CP_ACP, 0, lpszLocalFileName, -1, NULL, 0); local_file_name = heap_strdupAtoW(lpszLocalFileName);
local_file_name = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!local_file_name) if (!local_file_name)
goto cleanup; goto cleanup;
MultiByteToWideChar(CP_ACP, 0, lpszLocalFileName, -1, local_file_name, len);
} }
if (lpszFileExtension) if (lpszFileExtension)
{ {
len = MultiByteToWideChar(CP_ACP, 0, lpszFileExtension, -1, NULL, 0); file_extension = heap_strdupAtoW(lpszFileExtension);
file_extension = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!file_extension) if (!file_extension)
goto cleanup; goto cleanup;
MultiByteToWideChar(CP_ACP, 0, lpszFileExtension, -1, file_extension, len);
} }
if (lpszOriginalUrl) if (lpszOriginalUrl)
{ {
len = MultiByteToWideChar(CP_ACP, 0, lpszOriginalUrl, -1, NULL, 0); original_url = heap_strdupAtoW(lpszOriginalUrl);
original_url = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!original_url) if (!original_url)
goto cleanup; goto cleanup;
MultiByteToWideChar(CP_ACP, 0, lpszOriginalUrl, -1, original_url, len);
} }
bSuccess = CommitUrlCacheEntryInternal(url_name, local_file_name, ExpireTime, LastModifiedTime, bSuccess = CommitUrlCacheEntryInternal(url_name, local_file_name, ExpireTime, LastModifiedTime,
@ -2712,12 +2742,8 @@ BOOL WINAPI CommitUrlCacheEntryW(
debugstr_w(lpszFileExtension), debugstr_w(lpszFileExtension),
debugstr_w(lpszOriginalUrl)); debugstr_w(lpszOriginalUrl));
if (!lpHeaderInfo || if (!lpHeaderInfo || (header_info = heap_strdupWtoA(lpHeaderInfo)))
((len = WideCharToMultiByte(CP_ACP, 0, lpHeaderInfo, -1, NULL, 0, NULL, NULL)) != 0 &&
(header_info = HeapAlloc(GetProcessHeap(), 0, sizeof(CHAR) * len)) != 0))
{ {
if (header_info)
WideCharToMultiByte(CP_ACP, 0, lpHeaderInfo, -1, header_info, len, NULL, NULL);
if (CommitUrlCacheEntryInternal(lpszUrlName, lpszLocalFileName, ExpireTime, LastModifiedTime, if (CommitUrlCacheEntryInternal(lpszUrlName, lpszLocalFileName, ExpireTime, LastModifiedTime,
CacheEntryType, (LPBYTE)header_info, len, lpszFileExtension, lpszOriginalUrl)) CacheEntryType, (LPBYTE)header_info, len, lpszFileExtension, lpszOriginalUrl))
{ {
@ -2940,19 +2966,16 @@ BOOL WINAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName)
struct _HASH_ENTRY * pHashEntry; struct _HASH_ENTRY * pHashEntry;
CACHEFILE_ENTRY * pEntry; CACHEFILE_ENTRY * pEntry;
LPSTR urlA; LPSTR urlA;
int url_len;
DWORD error; DWORD error;
TRACE("(%s)\n", debugstr_w(lpszUrlName)); TRACE("(%s)\n", debugstr_w(lpszUrlName));
url_len = WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, NULL, 0, NULL, NULL); urlA = heap_strdupWtoA(lpszUrlName);
urlA = HeapAlloc(GetProcessHeap(), 0, url_len * sizeof(CHAR));
if (!urlA) if (!urlA)
{ {
SetLastError(ERROR_OUTOFMEMORY); SetLastError(ERROR_OUTOFMEMORY);
return FALSE; return FALSE;
} }
WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, urlA, url_len, NULL, NULL);
error = URLCacheContainers_FindContainerW(lpszUrlName, &pContainer); error = URLCacheContainers_FindContainerW(lpszUrlName, &pContainer);
if (error != ERROR_SUCCESS) if (error != ERROR_SUCCESS)
@ -3133,14 +3156,12 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryA(LPCSTR lpszUrlSearchPattern,
pEntryHandle->dwMagic = URLCACHE_FIND_ENTRY_HANDLE_MAGIC; pEntryHandle->dwMagic = URLCACHE_FIND_ENTRY_HANDLE_MAGIC;
if (lpszUrlSearchPattern) if (lpszUrlSearchPattern)
{ {
int len = MultiByteToWideChar(CP_ACP, 0, lpszUrlSearchPattern, -1, NULL, 0); pEntryHandle->lpszUrlSearchPattern = heap_strdupAtoW(lpszUrlSearchPattern);
pEntryHandle->lpszUrlSearchPattern = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!pEntryHandle->lpszUrlSearchPattern) if (!pEntryHandle->lpszUrlSearchPattern)
{ {
HeapFree(GetProcessHeap(), 0, pEntryHandle); HeapFree(GetProcessHeap(), 0, pEntryHandle);
return NULL; return NULL;
} }
MultiByteToWideChar(CP_ACP, 0, lpszUrlSearchPattern, -1, pEntryHandle->lpszUrlSearchPattern, len);
} }
else else
pEntryHandle->lpszUrlSearchPattern = NULL; pEntryHandle->lpszUrlSearchPattern = NULL;
@ -3174,14 +3195,12 @@ INTERNETAPI HANDLE WINAPI FindFirstUrlCacheEntryW(LPCWSTR lpszUrlSearchPattern,
pEntryHandle->dwMagic = URLCACHE_FIND_ENTRY_HANDLE_MAGIC; pEntryHandle->dwMagic = URLCACHE_FIND_ENTRY_HANDLE_MAGIC;
if (lpszUrlSearchPattern) if (lpszUrlSearchPattern)
{ {
int len = strlenW(lpszUrlSearchPattern); pEntryHandle->lpszUrlSearchPattern = heap_strdupW(lpszUrlSearchPattern);
pEntryHandle->lpszUrlSearchPattern = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
if (!pEntryHandle->lpszUrlSearchPattern) if (!pEntryHandle->lpszUrlSearchPattern)
{ {
HeapFree(GetProcessHeap(), 0, pEntryHandle); HeapFree(GetProcessHeap(), 0, pEntryHandle);
return NULL; return NULL;
} }
memcpy(pEntryHandle->lpszUrlSearchPattern, lpszUrlSearchPattern, (len + 1) * sizeof(WCHAR));
} }
else else
pEntryHandle->lpszUrlSearchPattern = NULL; pEntryHandle->lpszUrlSearchPattern = NULL;
@ -3623,10 +3642,26 @@ BOOL WINAPI IsUrlCacheEntryExpiredW( LPCWSTR url, DWORD dwFlags, FILETIME* pftLa
/*********************************************************************** /***********************************************************************
* GetDiskInfoA (WININET.@) * GetDiskInfoA (WININET.@)
*/ */
BOOL WINAPI GetDiskInfoA(PCSTR p0, PDWORD p1, PDWORDLONG p2, PDWORDLONG p3) BOOL WINAPI GetDiskInfoA(PCSTR path, PDWORD cluster_size, PDWORDLONG free, PDWORDLONG total)
{ {
FIXME("(%p, %p, %p, %p)\n", p0, p1, p2, p3); BOOL ret;
return FALSE; ULARGE_INTEGER bytes_free, bytes_total;
TRACE("(%s, %p, %p, %p)\n", debugstr_a(path), cluster_size, free, total);
if (!path)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if ((ret = GetDiskFreeSpaceExA(path, NULL, &bytes_total, &bytes_free)))
{
if (cluster_size) *cluster_size = 1;
if (free) *free = bytes_free.QuadPart;
if (total) *total = bytes_total.QuadPart;
}
return ret;
} }
/*********************************************************************** /***********************************************************************
@ -3637,3 +3672,12 @@ DWORD WINAPI RegisterUrlCacheNotification(LPVOID a, DWORD b, DWORD c, DWORD d, D
FIXME("(%p %x %x %x %x %x)\n", a, b, c, d, e, f); FIXME("(%p %x %x %x %x %x)\n", a, b, c, d, e, f);
return 0; return 0;
} }
/***********************************************************************
* IncrementUrlCacheHeaderData (WININET.@)
*/
BOOL WINAPI IncrementUrlCacheHeaderData(DWORD index, LPDWORD data)
{
FIXME("(%u, %p)\n", index, data);
return FALSE;
}

View file

@ -25,6 +25,10 @@
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
#if defined(__MINGW32__) || defined (_MSC_VER)
#include <ws2tcpip.h>
#endif
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -40,6 +44,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(wininet); WINE_DEFAULT_DEBUG_CHANNEL(wininet);
#ifndef HAVE_GETADDRINFO
/* critical section to protect non-reentrant gethostbyname() */ /* critical section to protect non-reentrant gethostbyname() */
static CRITICAL_SECTION cs_gethostbyname; static CRITICAL_SECTION cs_gethostbyname;
static CRITICAL_SECTION_DEBUG critsect_debug = static CRITICAL_SECTION_DEBUG critsect_debug =
@ -50,6 +56,8 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
}; };
static CRITICAL_SECTION cs_gethostbyname = { &critsect_debug, -1, 0, 0, 0, 0 }; static CRITICAL_SECTION cs_gethostbyname = { &critsect_debug, -1, 0, 0, 0, 0 };
#endif
#define TIME_STRING_LEN 30 #define TIME_STRING_LEN 30
time_t ConvertTimeString(LPCWSTR asctime) time_t ConvertTimeString(LPCWSTR asctime)
@ -137,12 +145,18 @@ time_t ConvertTimeString(LPCWSTR asctime)
BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort, BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
struct sockaddr_in *psa) struct sockaddr *psa, socklen_t *sa_len)
{ {
WCHAR *found; WCHAR *found;
char *name; char *name;
int len, sz; int len, sz;
#ifdef HAVE_GETADDRINFO
struct addrinfo *res, hints;
int ret;
#else
struct hostent *phe; struct hostent *phe;
struct sockaddr_in *sin = (struct sockaddr_in *)psa;
#endif
TRACE("%s\n", debugstr_w(lpszServerName)); TRACE("%s\n", debugstr_w(lpszServerName));
@ -158,27 +172,75 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
len = strlenW(lpszServerName); len = strlenW(lpszServerName);
sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, NULL, 0, NULL, NULL ); sz = WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, NULL, 0, NULL, NULL );
name = HeapAlloc(GetProcessHeap(), 0, sz+1); if (!(name = HeapAlloc( GetProcessHeap(), 0, sz + 1 ))) return FALSE;
WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL ); WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL );
name[sz] = 0; name[sz] = 0;
#ifdef HAVE_GETADDRINFO
memset( &hints, 0, sizeof(struct addrinfo) );
/* Prefer IPv4 to IPv6 addresses, since some servers do not listen on
* their IPv6 addresses even though they have IPv6 addresses in the DNS.
*/
hints.ai_family = AF_INET;
ret = getaddrinfo( name, NULL, &hints, &res );
HeapFree( GetProcessHeap(), 0, name );
if (ret != 0)
{
TRACE("failed to get IPv4 address of %s (%s), retrying with IPv6\n", debugstr_w(lpszServerName), gai_strerror(ret));
hints.ai_family = AF_INET6;
ret = getaddrinfo( name, NULL, &hints, &res );
if (ret != 0)
{
TRACE("failed to get address of %s (%s)\n", debugstr_w(lpszServerName), gai_strerror(ret));
return FALSE;
}
}
if (*sa_len < res->ai_addrlen)
{
WARN("address too small\n");
freeaddrinfo( res );
return FALSE;
}
*sa_len = res->ai_addrlen;
memcpy( psa, res->ai_addr, res->ai_addrlen );
/* Copy port */
switch (res->ai_family)
{
case AF_INET:
((struct sockaddr_in *)psa)->sin_port = htons(nServerPort);
break;
case AF_INET6:
((struct sockaddr_in6 *)psa)->sin6_port = htons(nServerPort);
break;
}
freeaddrinfo( res );
#else
EnterCriticalSection( &cs_gethostbyname ); EnterCriticalSection( &cs_gethostbyname );
phe = gethostbyname(name); phe = gethostbyname(name);
HeapFree( GetProcessHeap(), 0, name ); HeapFree( GetProcessHeap(), 0, name );
if (NULL == phe) if (NULL == phe)
{ {
TRACE("Failed to get hostname: (%s)\n", debugstr_w(lpszServerName) ); TRACE("failed to get address of %s (%d)\n", debugstr_w(lpszServerName), h_errno);
LeaveCriticalSection( &cs_gethostbyname ); LeaveCriticalSection( &cs_gethostbyname );
return FALSE; return FALSE;
} }
if (*sa_len < sizeof(struct sockaddr_in))
memset(psa,0,sizeof(struct sockaddr_in)); {
memcpy((char *)&psa->sin_addr, phe->h_addr, phe->h_length); WARN("address too small\n");
psa->sin_family = phe->h_addrtype; LeaveCriticalSection( &cs_gethostbyname );
psa->sin_port = htons(nServerPort); return FALSE;
}
*sa_len = sizeof(struct sockaddr_in);
memset(sin,0,sizeof(struct sockaddr_in));
memcpy((char *)&sin->sin_addr, phe->h_addr, phe->h_length);
sin->sin_family = phe->h_addrtype;
sin->sin_port = htons(nServerPort);
LeaveCriticalSection( &cs_gethostbyname ); LeaveCriticalSection( &cs_gethostbyname );
#endif
return TRUE; return TRUE;
} }
@ -224,7 +286,7 @@ static const char *get_callback_name(DWORD dwInternetStatus) {
return "Unknown"; return "Unknown";
} }
VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD_PTR dwContext, VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwInternetStatus, LPVOID lpvStatusInfo,
DWORD dwStatusInfoLength) DWORD dwStatusInfoLength)
{ {
@ -244,11 +306,11 @@ VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD_PTR dwContext,
case INTERNET_STATUS_NAME_RESOLVED: case INTERNET_STATUS_NAME_RESOLVED:
case INTERNET_STATUS_CONNECTING_TO_SERVER: case INTERNET_STATUS_CONNECTING_TO_SERVER:
case INTERNET_STATUS_CONNECTED_TO_SERVER: case INTERNET_STATUS_CONNECTED_TO_SERVER:
lpvNewInfo = WININET_strdup_AtoW(lpvStatusInfo); lpvNewInfo = heap_strdupAtoW(lpvStatusInfo);
break; break;
case INTERNET_STATUS_RESOLVING_NAME: case INTERNET_STATUS_RESOLVING_NAME:
case INTERNET_STATUS_REDIRECT: case INTERNET_STATUS_REDIRECT:
lpvNewInfo = WININET_strdupW(lpvStatusInfo); lpvNewInfo = heap_strdupW(lpvStatusInfo);
break; break;
} }
}else { }else {
@ -262,7 +324,7 @@ VOID INTERNET_SendCallback(LPWININETHANDLEHEADER hdr, DWORD_PTR dwContext,
break; break;
case INTERNET_STATUS_RESOLVING_NAME: case INTERNET_STATUS_RESOLVING_NAME:
case INTERNET_STATUS_REDIRECT: case INTERNET_STATUS_REDIRECT:
lpvNewInfo = WININET_strdup_WtoA(lpvStatusInfo); lpvNewInfo = heap_strdupWtoA(lpvStatusInfo);
break; break;
} }
} }
@ -294,7 +356,7 @@ static void SendAsyncCallbackProc(WORKREQUEST *workRequest)
HeapFree(GetProcessHeap(), 0, req->lpvStatusInfo); HeapFree(GetProcessHeap(), 0, req->lpvStatusInfo);
} }
VOID SendAsyncCallback(LPWININETHANDLEHEADER hdr, DWORD_PTR dwContext, void SendAsyncCallback(object_header_t *hdr, DWORD_PTR dwContext,
DWORD dwInternetStatus, LPVOID lpvStatusInfo, DWORD dwInternetStatus, LPVOID lpvStatusInfo,
DWORD dwStatusInfoLength) DWORD dwStatusInfoLength)
{ {

View file

@ -22,6 +22,7 @@
<library>secur32</library> <library>secur32</library>
<library>crypt32</library> <library>crypt32</library>
<library>ws2_32</library> <library>ws2_32</library>
<library>pseh</library>
<file>cookie.c</file> <file>cookie.c</file>
<file>dialogs.c</file> <file>dialogs.c</file>
<file>ftp.c</file> <file>ftp.c</file>

View file

@ -1,5 +1,5 @@
101 stub -noname DoConnectoidsExist 101 stub -noname DoConnectoidsExist
102 stub -noname GetDiskInfoA 102 stdcall -noname GetDiskInfoA(str ptr ptr ptr)
103 stub -noname PerformOperationOverUrlCacheA 103 stub -noname PerformOperationOverUrlCacheA
104 stub -noname HttpCheckDavComplianceA 104 stub -noname HttpCheckDavComplianceA
105 stub -noname HttpCheckDavComplianceW 105 stub -noname HttpCheckDavComplianceW
@ -9,7 +9,7 @@
111 stub -noname ExportCookieFileW 111 stub -noname ExportCookieFileW
112 stub -noname IsProfilesEnabled 112 stub -noname IsProfilesEnabled
116 stub -noname IsDomainlegalCookieDomainA 116 stub -noname IsDomainlegalCookieDomainA
117 stub -noname IsDomainLegalCookieDomainW 117 stdcall -noname IsDomainLegalCookieDomainW(wstr wstr)
118 stub -noname FindP3PPolicySymbol 118 stub -noname FindP3PPolicySymbol
120 stub -noname MapResourceToPolicy 120 stub -noname MapResourceToPolicy
121 stub -noname GetP3PPolicy 121 stub -noname GetP3PPolicy
@ -50,8 +50,8 @@
@ stdcall FindNextUrlCacheGroup(long ptr ptr) @ stdcall FindNextUrlCacheGroup(long ptr ptr)
@ stub ForceNexusLookup @ stub ForceNexusLookup
@ stub ForceNexusLookupExW @ stub ForceNexusLookupExW
@ stub FreeUrlCacheSpaceA @ stdcall FreeUrlCacheSpaceA(str long long)
@ stub FreeUrlCacheSpaceW @ stdcall FreeUrlCacheSpaceW(wstr long long)
@ stdcall FtpCommandA(long long long str ptr ptr) @ stdcall FtpCommandA(long long long str ptr ptr)
@ stdcall FtpCommandW(long long long wstr ptr ptr) @ stdcall FtpCommandW(long long long wstr ptr ptr)
@ stdcall FtpCreateDirectoryA(ptr str) @ stdcall FtpCreateDirectoryA(ptr str)
@ -109,7 +109,7 @@
@ stdcall HttpSendRequestExA(long ptr ptr long long) @ stdcall HttpSendRequestExA(long ptr ptr long long)
@ stdcall HttpSendRequestExW(long ptr ptr long long) @ stdcall HttpSendRequestExW(long ptr ptr long long)
@ stdcall HttpSendRequestW(ptr wstr long ptr long) @ stdcall HttpSendRequestW(ptr wstr long ptr long)
@ stub IncrementUrlCacheHeaderData @ stdcall IncrementUrlCacheHeaderData(long ptr)
@ stub InternetAlgIdToStringA @ stub InternetAlgIdToStringA
@ stub InternetAlgIdToStringW @ stub InternetAlgIdToStringW
@ stdcall InternetAttemptConnect(long) @ stdcall InternetAttemptConnect(long)
@ -213,10 +213,10 @@
@ stdcall IsUrlCacheEntryExpiredW(wstr long ptr) @ stdcall IsUrlCacheEntryExpiredW(wstr long ptr)
@ stub LoadUrlCacheContent @ stub LoadUrlCacheContent
@ stub ParseX509EncodedCertificateForListBoxEntry @ stub ParseX509EncodedCertificateForListBoxEntry
@ stub PrivacyGetZonePreferenceW # (long long ptr ptr ptr) @ stdcall PrivacyGetZonePreferenceW(long long ptr ptr ptr)
@ stub PrivacySetZonePreferenceW # (long long long wstr) @ stdcall PrivacySetZonePreferenceW(long long long wstr)
@ stdcall ReadUrlCacheEntryStream(ptr long ptr ptr long) @ stdcall ReadUrlCacheEntryStream(ptr long ptr ptr long)
@ stub RegisterUrlCacheNotification @ stdcall RegisterUrlCacheNotification(ptr long long long long long)
@ stdcall ResumeSuspendedDownload(long long) @ stdcall ResumeSuspendedDownload(long long)
@ stdcall RetrieveUrlCacheEntryFileA(str ptr ptr long) @ stdcall RetrieveUrlCacheEntryFileA(str ptr ptr long)
@ stdcall RetrieveUrlCacheEntryFileW(wstr ptr ptr long) @ stdcall RetrieveUrlCacheEntryFileW(wstr ptr ptr long)

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
/* Czech strings in CP1250 */ /* Czech strings in CP1250 */

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -1,5 +1,6 @@
/* /*
* Copyright 2004 Henning Gerhardt * Copyright 2004 Henning Gerhardt
* Copyright 2009 André Hentschel
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -16,6 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
#pragma code_page(65001)
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
@ -25,8 +30,8 @@ FONT 8, "MS Shell Dlg"
{ {
LTEXT "Geben Sie Benutzernamen und Kennwort ein:", -1, 40, 6, 150, 15 LTEXT "Geben Sie Benutzernamen und Kennwort ein:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10 LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10 LTEXT "Bereich", -1, 40, 46, 50, 10
LTEXT "Ben&utzername", -1, 40, 66, 50, 10 LTEXT "Ben&utzer", -1, 40, 66, 50, 10
LTEXT "Kenn&wort", -1, 40, 86, 50, 10 LTEXT "Kenn&wort", -1, 40, 86, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 LTEXT "" IDC_REALM, 80, 46, 150, 14, 0
@ -38,6 +43,26 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Abbrechen", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Abbrechen", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
} }
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Benutzeranmeldung"
FONT 8, "MS Shell Dlg"
{
LTEXT "Geben Sie Benutzernamen und Kennwort ein:", -1, 40, 6, 150, 15
LTEXT "Server", -1, 40, 26, 50, 10
LTEXT "Bereich", -1, 40, 46, 50, 10
LTEXT "Benutzer", -1, 40, 66, 50, 10
LTEXT "Kennwort", -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 "Dieses &Kennwort speichern (unsicher)", 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 "Abbrechen", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "LAN Verbindung" IDS_LANCONNECTION "LAN Verbindung"

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
@ -38,6 +40,26 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Cancel", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Cancel", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
} }
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Authentication Required"
FONT 8, "MS Shell Dlg"
{
LTEXT "Please enter your username and password:", -1, 40, 6, 150, 15
LTEXT "Server", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "User", -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 "&Save this password (insecure)", 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
}
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "LAN Connection" IDS_LANCONNECTION "LAN Connection"

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -3,8 +3,9 @@
* French language support * French language support
* *
* Copyright 2003 Mike McCormack for CodeWeavers * Copyright 2003 Mike McCormack for CodeWeavers
* Copyright 2003 Vincent Béron * Copyright 2003 Vincent Béron
* Copyright 2005 Jonathan Ernst * Copyright 2005 Jonathan Ernst
* Copyright 2009 Frédéric Delanoy
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -21,29 +22,54 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 218, 150
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Entrez le mot de passe réseau" CAPTION "Entrez le mot de passe réseau"
FONT 8, "MS Shell Dlg" FONT 8, "MS Shell Dlg"
{ {
LTEXT "Entrez votre nom d'utilisateur et votre mot de passe :", -1, 40, 6, 150, 15 LTEXT "Entrez votre nom d'utilisateur et votre mot de passe :", -1, 10, 8, 173, 12
LTEXT "Mandataire", -1, 40, 26, 50, 10 LTEXT "Serveur mandataire", -1, 10, 28, 50, 17
LTEXT "Domaine", -1, 40, 46, 50, 10 LTEXT "Domaine", -1, 10, 50, 50, 10
LTEXT "Utilisateur", -1, 40, 66, 50, 10 LTEXT "Utilisateur", -1, 10, 71, 50, 10
LTEXT "Mot de passe", -1, 40, 86, 50, 10 LTEXT "Mot de passe", -1, 10, 90, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 LTEXT "" IDC_PROXY, 58, 28, 150, 14, 0
LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 LTEXT "" IDC_REALM, 58, 48, 150, 14, 0
EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP EDITTEXT IDC_USERNAME, 58, 68, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD EDITTEXT IDC_PASSWORD, 58, 88, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Enregistrer ce mot de passe (risqué)", IDC_SAVEPASSWORD, CHECKBOX "&Enregistrer ce mot de passe (risqué)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP 58, 108, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON PUSHBUTTON "OK", IDOK, 87, 128, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Annuler", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Annuler", IDCANCEL, 147, 128, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 218, 150
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Authentification requise"
FONT 8, "MS Shell Dlg"
{
LTEXT "Entrez votre nom d'utilisateur et votre mot de passe :", -1, 10, 8, 173, 12
LTEXT "Serveur", -1, 10, 28, 50, 17
LTEXT "Domaine", -1, 10, 50, 50, 10
LTEXT "Utilisateur", -1, 10, 71, 50, 10
LTEXT "Mot de passe", -1, 10, 90, 50, 10
LTEXT "" IDC_SERVER, 58, 28, 150, 14, 0
LTEXT "" IDC_REALM, 58, 48, 150, 14, 0
EDITTEXT IDC_USERNAME, 58, 68, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP
EDITTEXT IDC_PASSWORD, 58, 88, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD
CHECKBOX "&Enregistrer ce mot de passe (risqué)", IDC_SAVEPASSWORD,
58, 108, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "OK", IDOK, 87, 128, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Annuler", IDCANCEL, 147, 128, 56, 14, WS_GROUP | WS_TABSTOP
} }
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "Connexion LAN" IDS_LANCONNECTION "Connexion réseau local (LAN)"
} }

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
@ -40,6 +42,26 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Annulla", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Annulla", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
} }
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 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 "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,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
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 STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "Connessione LAN" IDS_LANCONNECTION "Connessione LAN"

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
/* UTF-8 */ /* UTF-8 */
#pragma code_page(65001) #pragma code_page(65001)
@ -45,5 +47,3 @@ STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "LAN 接続" IDS_LANCONNECTION "LAN 接続"
} }
#pragma code_page(default)

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -0,0 +1,69 @@
/*
* Copyright 2009 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
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "resource.h"
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Įveskite tinklo slaptažodį"
FONT 8, "MS Shell Dlg"
{
LTEXT "Įveskite savo naudotojo vardą ir slaptažodį:", -1, 40, 6, 150, 15
LTEXT "Įgaliot. serv.", -1, 40, 26, 50, 10
LTEXT "Sritis", -1, 40, 46, 50, 10
LTEXT "Naudotojas", -1, 40, 66, 50, 10
LTEXT "Slaptažodis", -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 "Į&rašyti šį slaptažodį (nesaugu)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Gerai", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Atsisakyti", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Reikalingas tapatumo nustatymas"
FONT 8, "MS Shell Dlg"
{
LTEXT "Įveskite savo naudotojo vardą ir slaptažodį:", -1, 40, 6, 150, 15
LTEXT "Serveris", -1, 40, 26, 50, 10
LTEXT "Sritis", -1, 40, 46, 50, 10
LTEXT "Naudotojas", -1, 40, 66, 50, 10
LTEXT "Slaptažodis", -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 "Į&rašyti šį slaptažodį (nesaugu)", IDC_SAVEPASSWORD,
80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
PUSHBUTTON "Gerai", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON
PUSHBUTTON "Atsisakyti", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE
{
IDS_LANCONNECTION "Vietinio tinklo ryšys"
}

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
@ -40,6 +42,26 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Annuleren", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Annuleren", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
} }
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Authenticatie vereist"
FONT 8, "MS Shell Dlg"
{
LTEXT "Voer uw gebruikersnaam en wachtwoord in:", -1, 40, 6, 150, 15
LTEXT "Server", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Gebruikersnaam", -1, 40, 66, 50, 10
LTEXT "Wachtwoord", -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 "&Wachtwoord opslaan (onveilig)", 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 "Annuleren", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "LAN Verbinding" IDS_LANCONNECTION "LAN Verbinding"

View file

@ -1,5 +1,5 @@
/* /*
* Copyright 2005 Alexander N. Sørnes <alex@thehandofagony.com> * Copyright 2005-2009 Alexander N. Sørnes <alex@thehandofagony.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -16,6 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
#pragma code_page(65001)
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
@ -25,7 +29,7 @@ FONT 8, "MS Shell Dlg"
{ {
LTEXT "Skriv inn brukernavnet og passordet ditt:", -1, 40, 6, 150, 15 LTEXT "Skriv inn brukernavnet og passordet ditt:", -1, 40, 6, 150, 15
LTEXT "Mellomtjener", -1, 40, 26, 50, 10 LTEXT "Mellomtjener", -1, 40, 26, 50, 10
LTEXT "Område", -1, 40, 46, 50, 10 LTEXT "Område", -1, 40, 46, 50, 10
LTEXT "Bruker", -1, 40, 66, 50, 10 LTEXT "Bruker", -1, 40, 66, 50, 10
LTEXT "Passord", -1, 40, 86, 50, 10 LTEXT "Passord", -1, 40, 86, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
@ -38,6 +42,26 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Avbryt", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
} }
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Pålogging"
FONT 8, "MS Shell Dlg"
{
LTEXT "Oppgi brukernavn og passord:", -1, 40, 6, 150, 15
LTEXT "Tjener", -1, 40, 26, 50, 10
LTEXT "Område", -1, 40, 46, 50, 10
LTEXT "Bruker", -1, 40, 66, 50, 10
LTEXT "Passord", -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 "Lagre pa&ssordet (sikkerhetsrisiko)", 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 STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "Lokal nettverksforbindelse" IDS_LANCONNECTION "Lokal nettverksforbindelse"

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -1,6 +1,7 @@
/* /*
* Copyright 2003 Marcelo Duarte * Copyright 2003 Marcelo Duarte
* Copyright 2006-2007 Américo José Melo * Copyright 2006-2007 Américo José Melo
* Copyright 2009 Ricardo Filipe
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -17,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
#pragma code_page(65001)
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
@ -24,10 +29,10 @@ STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Entrar Senha da Rede" CAPTION "Entrar Senha da Rede"
FONT 8, "MS Shell Dlg" FONT 8, "MS Shell Dlg"
{ {
LTEXT "Por favor, entre com o nome de usuário e a senha:", -1, 40, 6, 150, 15 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 "Proxy", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10 LTEXT "Realm", -1, 40, 46, 50, 10
LTEXT "Usuário", -1, 40, 66, 50, 10 LTEXT "Usuário", -1, 40, 66, 50, 10
LTEXT "Senha", -1, 40, 86, 50, 10 LTEXT "Senha", -1, 40, 86, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 LTEXT "" IDC_REALM, 80, 46, 150, 14, 0
@ -61,17 +66,36 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Cancelar", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
} }
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 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 utilizador e palavra-passe:", -1, 40, 6, 150, 15
LTEXT "Servidor", -1, 40, 26, 50, 10
LTEXT "Reino", -1, 40, 46, 50, 10
LTEXT "Utilizador", -1, 40, 66, 50, 10
LTEXT "Palavra-passe", -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 palavra-passe (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_BRAZILIAN LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "Conexão LAN" IDS_LANCONNECTION "Conexão LAN"
} }
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "Ligação LAN" IDS_LANCONNECTION "Ligação LAN"
} }

View file

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
#pragma code_page(65001) #pragma code_page(65001)
@ -28,7 +30,7 @@ FONT 8, "MS Shell Dlg"
{ {
LTEXT "Introduceți numele de utilizator și parola:", -1, 40, 6, 150, 15 LTEXT "Introduceți numele de utilizator și parola:", -1, 40, 6, 150, 15
LTEXT "Proxy", -1, 40, 26, 50, 10 LTEXT "Proxy", -1, 40, 26, 50, 10
LTEXT "Realm", -1, 40, 46, 50, 10 LTEXT "Domeniu", -1, 40, 46, 50, 10
LTEXT "Utilizator", -1, 40, 66, 50, 10 LTEXT "Utilizator", -1, 40, 66, 50, 10
LTEXT "Parolă", -1, 40, 86, 50, 10 LTEXT "Parolă", -1, 40, 86, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
@ -41,9 +43,27 @@ FONT 8, "MS Shell Dlg"
PUSHBUTTON "Renunță", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Renunță", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
} }
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Autentificare necesară"
FONT 8, "MS Shell Dlg"
{
LTEXT "Introduceți numele de utilizator și parola:", -1, 40, 6, 150, 15
LTEXT "Server", -1, 40, 26, 50, 10
LTEXT "Domeniu", -1, 40, 46, 50, 10
LTEXT "Utilizator", -1, 40, 66, 50, 10
LTEXT "Parolă", -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 "&Salvează această parolă (nesigur)", 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 "Renunță", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "Conexiune LAN" IDS_LANCONNECTION "Conexiune LAN"
} }
#pragma code_page(default)

View file

@ -18,29 +18,54 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Ввод сетевого пароля" CAPTION "Ввод сетевого пароля"
FONT 8, "MS Shell Dlg" FONT 8, "MS Shell Dlg"
{ {
LTEXT "Введите имя пользователя и пароль:", -1, 40, 6, 150, 15 LTEXT "Введите имя пользователя и пароль:", -1, 40, 6, 150, 15
LTEXT "Прокси", -1, 40, 26, 50, 10 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, 66, 50, 10
LTEXT "Пароль", -1, 40, 86, 50, 10 LTEXT "Пароль", -1, 40, 86, 50, 10
LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0
LTEXT "" IDC_REALM, 80, 46, 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_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 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 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 "Отмена", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "Отмена", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP
}
IDD_AUTHDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
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 "" 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
} }
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "Сетевое подключение" IDS_LANCONNECTION "Сетевое подключение"
} }

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
#pragma code_page(65001) #pragma code_page(65001)
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
@ -44,5 +46,3 @@ STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "LAN povezava" IDS_LANCONNECTION "LAN povezava"
} }
#pragma code_page(default)

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154

View file

@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "resource.h"
/* Chinese text is encoded in UTF-8 */ /* Chinese text is encoded in UTF-8 */
#pragma code_page(65001) #pragma code_page(65001)
@ -74,5 +76,3 @@ STRINGTABLE DISCARDABLE
{ {
IDS_LANCONNECTION "局域網連接" IDS_LANCONNECTION "局域網連接"
} }
#pragma code_page(default)