From: Aleksey Bragin Date: Fri, 20 Nov 2009 14:22:05 +0000 (+0000) Subject: [wininet] X-Git-Tag: ReactOS-0.3.11~22 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=ad2dffe03010a7ba694c09d1c136583659ef9761 [wininet] - Update wininet to Wine-1.1.33. svn path=/trunk/; revision=44236 --- diff --git a/reactos/dll/win32/wininet/cookie.c b/reactos/dll/win32/wininet/cookie.c index 30e0b99ee92..75cf049308b 100644 --- a/reactos/dll/win32/wininet/cookie.c +++ b/reactos/dll/win32/wininet/cookie.c @@ -163,7 +163,6 @@ static cookie_domain *COOKIE_addDomain(LPCWSTR domain, LPCWSTR path) static BOOL COOKIE_crackUrlSimple(LPCWSTR lpszUrl, LPWSTR hostName, int hostNameLen, LPWSTR path, int pathLen) { URL_COMPONENTSW UrlComponents; - BOOL rc; UrlComponents.lpszExtraInfo = NULL; UrlComponents.lpszPassword = NULL; @@ -178,22 +177,28 @@ static BOOL COOKIE_crackUrlSimple(LPCWSTR lpszUrl, LPWSTR hostName, int hostName UrlComponents.dwHostNameLength = hostNameLen; UrlComponents.dwUrlPathLength = pathLen; - rc = InternetCrackUrlW(lpszUrl, 0, 0, &UrlComponents); + if (!InternetCrackUrlW(lpszUrl, 0, 0, &UrlComponents)) return FALSE; /* discard the webpage off the end of the path */ - if (pathLen > 0 && path[pathLen-1] != '/') + if (UrlComponents.dwUrlPathLength) { - LPWSTR ptr; - ptr = strrchrW(path,'/'); - if (ptr) - *(++ptr) = 0; - else + if (path[UrlComponents.dwUrlPathLength - 1] != '/') { - path[0] = '/'; - path[1] = 0; + WCHAR *ptr; + if ((ptr = strrchrW(path, '/'))) *(++ptr) = 0; + else + { + path[0] = '/'; + path[1] = 0; + } } } - return rc; + 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 */ @@ -569,7 +574,7 @@ BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, 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])); if (!ret || !hostName[0]) return FALSE; diff --git a/reactos/dll/win32/wininet/ftp.c b/reactos/dll/win32/wininet/ftp.c index b0dc695f1af..f0c3cbd02c4 100644 --- a/reactos/dll/win32/wininet/ftp.c +++ b/reactos/dll/win32/wininet/ftp.c @@ -1293,6 +1293,7 @@ HINTERNET FTP_FtpOpenFileW(ftp_session_t *lpwfs, lpwh->hdr.vtbl = &FTPFILEVtbl; lpwh->hdr.dwFlags = dwFlags; lpwh->hdr.dwContext = dwContext; + lpwh->hdr.dwInternalFlags = 0; lpwh->hdr.refs = 1; lpwh->hdr.lpfnStatusCB = lpwfs->hdr.lpfnStatusCB; lpwh->nDataSocket = nDataSocket; diff --git a/reactos/dll/win32/wininet/http.c b/reactos/dll/win32/wininet/http.c index 87d5e721571..3a14f7ad844 100644 --- a/reactos/dll/win32/wininet/http.c +++ b/reactos/dll/win32/wininet/http.c @@ -3340,8 +3340,16 @@ BOOL WINAPI HttpSendRequestExW(HINTERNET hRequest, req = &workRequest.u.HttpSendRequestW; if (lpBuffersIn) { - /* FIXME: this should use dwHeadersLength or may not be necessary at all */ - req->lpszHeader = heap_strdupW(lpBuffersIn->lpcszHeader); + DWORD size; + + if (lpBuffersIn->dwHeadersLength == ~0u) + size = (strlenW( lpBuffersIn->lpcszHeader ) + 1) * sizeof(WCHAR); + else + size = lpBuffersIn->dwHeadersLength * sizeof(WCHAR); + + req->lpszHeader = HeapAlloc( GetProcessHeap(), 0, size ); + memcpy( req->lpszHeader, lpBuffersIn->lpcszHeader, size ); + req->dwHeaderLength = lpBuffersIn->dwHeadersLength; req->lpOptional = lpBuffersIn->lpvBuffer; req->dwOptionalLength = lpBuffersIn->dwBufferLength; diff --git a/reactos/dll/win32/wininet/internet.c b/reactos/dll/win32/wininet/internet.c index ca7b982326e..f61074c438f 100644 --- a/reactos/dll/win32/wininet/internet.c +++ b/reactos/dll/win32/wininet/internet.c @@ -1133,11 +1133,14 @@ static void ConvertUrlComponentValue(LPSTR* lppszComponent, LPDWORD dwComponentL DWORD nASCIILength=WideCharToMultiByte(CP_ACP,0,lpwszComponent,dwwComponentLen,NULL,0,NULL,NULL); if (*lppszComponent == NULL) { - int nASCIIOffset=WideCharToMultiByte(CP_ACP,0,lpwszStart,lpwszComponent-lpwszStart,NULL,0,NULL,NULL); if (lpwszComponent) - *lppszComponent = (LPSTR)lpszStart+nASCIIOffset; + { + int offset = WideCharToMultiByte(CP_ACP, 0, lpwszStart, lpwszComponent-lpwszStart, NULL, 0, NULL, NULL); + *lppszComponent = (LPSTR)lpszStart + offset; + } else *lppszComponent = NULL; + *dwComponentLen = nASCIILength; } else @@ -1184,7 +1187,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags, InternetCrackUrlW should not include it */ if (dwUrlLength == -1) nLength--; - lpwszUrl=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WCHAR)*nLength); + lpwszUrl = HeapAlloc(GetProcessHeap(), 0, nLength * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,lpwszUrl,nLength); memset(&UCW,0,sizeof(UCW)); diff --git a/reactos/dll/win32/wininet/netconnection.c b/reactos/dll/win32/wininet/netconnection.c index 97c764fc345..16cce406533 100644 --- a/reactos/dll/win32/wininet/netconnection.c +++ b/reactos/dll/win32/wininet/netconnection.c @@ -289,14 +289,6 @@ void NETCON_unload(void) #if defined(SONAME_LIBSSL) && defined(SONAME_LIBCRYPTO) if (OpenSSL_crypto_handle) { - if (ssl_locks) - { - int i; - - for (i = 0; i < pCRYPTO_num_locks(); i++) - DeleteCriticalSection(&ssl_locks[i]); - HeapFree(GetProcessHeap(), 0, ssl_locks); - } wine_dlclose(OpenSSL_crypto_handle, NULL, 0); } if (OpenSSL_ssl_handle) @@ -305,6 +297,12 @@ void NETCON_unload(void) pSSL_CTX_free(ctx); wine_dlclose(OpenSSL_ssl_handle, NULL, 0); } + if (ssl_locks) + { + int i; + for (i = 0; i < pCRYPTO_num_locks(); i++) DeleteCriticalSection(&ssl_locks[i]); + HeapFree(GetProcessHeap(), 0, ssl_locks); + } #endif } diff --git a/reactos/dll/win32/wininet/urlcache.c b/reactos/dll/win32/wininet/urlcache.c index 37d7b259fd6..29d26ab0b6b 100644 --- a/reactos/dll/win32/wininet/urlcache.c +++ b/reactos/dll/win32/wininet/urlcache.c @@ -1448,6 +1448,28 @@ static BOOL URLCache_EnumHashTableEntries(LPCURLCACHE_HEADER pHeader, const HASH 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.@) * diff --git a/reactos/dll/win32/wininet/wininet.spec b/reactos/dll/win32/wininet/wininet.spec index d5995eb3cc3..46dd04334e6 100644 --- a/reactos/dll/win32/wininet/wininet.spec +++ b/reactos/dll/win32/wininet/wininet.spec @@ -50,8 +50,8 @@ @ stdcall FindNextUrlCacheGroup(long ptr ptr) @ stub ForceNexusLookup @ stub ForceNexusLookupExW -@ stub FreeUrlCacheSpaceA -@ stub FreeUrlCacheSpaceW +@ stdcall FreeUrlCacheSpaceA(str long long) +@ stdcall FreeUrlCacheSpaceW(wstr long long) @ stdcall FtpCommandA(long long long str ptr ptr) @ stdcall FtpCommandW(long long long wstr ptr ptr) @ stdcall FtpCreateDirectoryA(ptr str) diff --git a/reactos/dll/win32/wininet/wininet_Lt.rc b/reactos/dll/win32/wininet/wininet_Lt.rc new file mode 100644 index 00000000000..cd4bf482e35 --- /dev/null +++ b/reactos/dll/win32/wininet/wininet_Lt.rc @@ -0,0 +1,69 @@ +/* + * Copyright 2009 Aurimas Fišeras + * + * 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" +}