Author: zguo Date: Mon Oct 11 19:57:17 2010 New Revision: 49120
URL: http://svn.reactos.org/svn/reactos?rev=49120&view=rev Log: Revert wininet sync take two. Hopefully caught all of the changes this in winnet folder this time. See issue #5663 for more details.
Modified: branches/ros-branch-0_3_12/reactos/dll/win32/wininet/ftp.c branches/ros-branch-0_3_12/reactos/dll/win32/wininet/http.c branches/ros-branch-0_3_12/reactos/dll/win32/wininet/internet.c branches/ros-branch-0_3_12/reactos/dll/win32/wininet/internet.h branches/ros-branch-0_3_12/reactos/dll/win32/wininet/netconnection.c branches/ros-branch-0_3_12/reactos/dll/win32/wininet/urlcache.c branches/ros-branch-0_3_12/reactos/dll/win32/wininet/utility.c
Modified: branches/ros-branch-0_3_12/reactos/dll/win32/wininet/ftp.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/wi... ============================================================================== --- branches/ros-branch-0_3_12/reactos/dll/win32/wininet/ftp.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_12/reactos/dll/win32/wininet/ftp.c [iso-8859-1] Mon Oct 11 19:57:17 2010 @@ -2395,7 +2395,7 @@ return ERROR_SUCCESS; }
- return INET_QueryOption(hdr, option, buffer, size, unicode); + return INET_QueryOption(option, buffer, size, unicode); }
static const object_vtbl_t FTPSESSIONVtbl = { @@ -3476,7 +3476,7 @@ return ERROR_SUCCESS; }
- return INET_QueryOption(hdr, option, buffer, size, unicode); + return INET_QueryOption(option, buffer, size, unicode); }
static DWORD FTPFINDNEXT_FindNextFileW(object_header_t *hdr, void *data)
Modified: branches/ros-branch-0_3_12/reactos/dll/win32/wininet/http.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/wi... ============================================================================== --- branches/ros-branch-0_3_12/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_12/reactos/dll/win32/wininet/http.c [iso-8859-1] Mon Oct 11 19:57:17 2010 @@ -3464,10 +3464,6 @@ * for all the data */ HTTP_DrainContent(lpwhr); lpwhr->dwContentRead = 0; - if(redirected) { - lpwhr->dwContentLength = ~0u; - lpwhr->dwBytesToWrite = 0; - }
if (TRACE_ON(wininet)) { @@ -3674,7 +3670,7 @@ HTTP_ReceiveRequestData(lpwhr, TRUE); else { - iar.dwResult = 0; + iar.dwResult = (DWORD_PTR)lpwhr->hdr.hInternet; iar.dwError = res;
INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, @@ -4168,7 +4164,7 @@ return ERROR_SUCCESS; }
- return INET_QueryOption(hdr, option, buffer, size, unicode); + return INET_QueryOption(option, buffer, size, unicode); }
static DWORD HTTPSESSION_SetOption(object_header_t *hdr, DWORD option, void *buffer, DWORD size) @@ -4265,8 +4261,11 @@ if(hIC->lpszProxyBypass) FIXME("Proxy bypass is ignored.\n"); } - lpwhs->lpszServerName = heap_strdupW(lpszServerName); - lpwhs->lpszHostName = heap_strdupW(lpszServerName); + if (lpszServerName && lpszServerName[0]) + { + lpwhs->lpszServerName = heap_strdupW(lpszServerName); + lpwhs->lpszHostName = heap_strdupW(lpszServerName); + } if (lpszUserName && lpszUserName[0]) lpwhs->lpszUserName = heap_strdupW(lpszUserName); if (lpszPassword && lpszPassword[0]) @@ -4363,10 +4362,6 @@ if(res != ERROR_SUCCESS) goto lend;
- INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, - INTERNET_STATUS_CONNECTED_TO_SERVER, - szaddr, strlen(szaddr)+1); - if (lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE) { /* Note: we differ from Microsoft's WinINet here. they seem to have @@ -4375,31 +4370,20 @@ * behaviour to be more correct and to not cause any incompatibilities * because using a secure connection through a proxy server is a rare * case that would be hard for anyone to depend on */ - if (hIC->lpszProxy && (res = HTTP_SecureProxyConnect(lpwhr)) != ERROR_SUCCESS) { - HTTPREQ_CloseConnection(&lpwhr->hdr); + if (hIC->lpszProxy && (res = HTTP_SecureProxyConnect(lpwhr)) != ERROR_SUCCESS) goto lend; - }
res = NETCON_secure_connect(&lpwhr->netConnection, lpwhs->lpszHostName); if(res != ERROR_SUCCESS) { WARN("Couldn't connect securely to host\n"); - - if((lpwhr->hdr.ErrorMask&INTERNET_ERROR_MASK_COMBINED_SEC_CERT) && ( - res == ERROR_INTERNET_SEC_CERT_DATE_INVALID - || res == ERROR_INTERNET_INVALID_CA - || res == ERROR_INTERNET_SEC_CERT_NO_REV - || res == ERROR_INTERNET_SEC_CERT_REV_FAILED - || res == ERROR_INTERNET_SEC_CERT_REVOKED - || res == ERROR_INTERNET_SEC_INVALID_CERT - || res == ERROR_INTERNET_SEC_CERT_CN_INVALID)) - res = ERROR_INTERNET_SEC_CERT_ERRORS; - - HTTPREQ_CloseConnection(&lpwhr->hdr); goto lend; } }
+ INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, + INTERNET_STATUS_CONNECTED_TO_SERVER, + szaddr, strlen(szaddr)+1);
lend: lpwhr->read_pos = lpwhr->read_size = 0;
Modified: branches/ros-branch-0_3_12/reactos/dll/win32/wininet/internet.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/wi... ============================================================================== --- branches/ros-branch-0_3_12/reactos/dll/win32/wininet/internet.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_12/reactos/dll/win32/wininet/internet.c [iso-8859-1] Mon Oct 11 19:57:17 2010 @@ -1447,7 +1447,7 @@ lpUrlComponents->nScheme = UCW.nScheme; lpUrlComponents->nPort = UCW.nPort;
- TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", debugstr_a(lpszUrl), + TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", lpszUrl, debugstr_an(lpUrlComponents->lpszScheme, lpUrlComponents->dwSchemeLength), debugstr_an(lpUrlComponents->lpszHostName, lpUrlComponents->dwHostNameLength), debugstr_an(lpUrlComponents->lpszUrlPath, lpUrlComponents->dwUrlPathLength), @@ -1860,7 +1860,7 @@ DWORD dwURLFlags = URL_WININET_COMPATIBILITY | URL_ESCAPE_UNSAFE;
TRACE("(%s, %p, %p, 0x%08x) bufferlength: %d\n", debugstr_a(lpszUrl), lpszBuffer, - lpdwBufferLength, dwFlags, lpdwBufferLength ? *lpdwBufferLength : -1); + lpdwBufferLength, lpdwBufferLength ? *lpdwBufferLength : -1, dwFlags);
if(dwFlags & ICU_DECODE) { @@ -2194,7 +2194,7 @@ return res == ERROR_SUCCESS; }
-DWORD INET_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode) +DWORD INET_QueryOption(DWORD option, void *buffer, DWORD *size, BOOL unicode) { static BOOL warn = TRUE;
@@ -2357,25 +2357,6 @@ return ERROR_INTERNET_INCORRECT_HANDLE_TYPE; case INTERNET_OPTION_POLICY: return ERROR_INVALID_PARAMETER; - case INTERNET_OPTION_CONTEXT_VALUE: - { - if (!hdr) - return ERROR_INTERNET_INCORRECT_HANDLE_TYPE; - if (!size) - return ERROR_INVALID_PARAMETER; - - if (*size < sizeof(DWORD_PTR)) - { - *size = sizeof(DWORD_PTR); - return ERROR_INSUFFICIENT_BUFFER; - } - if (!buffer) - return ERROR_INVALID_PARAMETER; - - *(DWORD_PTR *)buffer = hdr->dwContext; - *size = sizeof(DWORD_PTR); - return ERROR_SUCCESS; - } }
FIXME("Stub for %d\n", option); @@ -2407,7 +2388,7 @@ WININET_Release(hdr); } }else { - res = INET_QueryOption(NULL, dwOption, lpBuffer, lpdwBufferLength, TRUE); + res = INET_QueryOption(dwOption, lpBuffer, lpdwBufferLength, TRUE); }
if(res != ERROR_SUCCESS) @@ -2440,7 +2421,7 @@ WININET_Release(hdr); } }else { - res = INET_QueryOption(NULL, dwOption, lpBuffer, lpdwBufferLength, FALSE); + res = INET_QueryOption(dwOption, lpBuffer, lpdwBufferLength, FALSE); }
if(res != ERROR_SUCCESS) @@ -2503,19 +2484,8 @@ break; case INTERNET_OPTION_ERROR_MASK: { - if(!lpwhh) { - SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); - return FALSE; - } else if(*(ULONG*)lpBuffer & (~(INTERNET_ERROR_MASK_INSERT_CDROM| - INTERNET_ERROR_MASK_COMBINED_SEC_CERT| - INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY))) { - SetLastError(ERROR_INVALID_PARAMETER); - ret = FALSE; - } else if(dwBufferLength != sizeof(ULONG)) { - SetLastError(ERROR_INTERNET_BAD_OPTION_LENGTH); - ret = FALSE; - } else - lpwhh->ErrorMask = *(ULONG*)lpBuffer; + ULONG flags = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_ERROR_MASK(%d): STUB\n", flags); } break; case INTERNET_OPTION_CODEPAGE: @@ -2580,21 +2550,8 @@ break; } case INTERNET_OPTION_CONTEXT_VALUE: - { - if (!lpwhh) - { - SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); - return FALSE; - } - if (!lpBuffer || dwBufferLength != sizeof(DWORD_PTR)) - { - SetLastError(ERROR_INVALID_PARAMETER); - ret = FALSE; - } - else - lpwhh->dwContext = *(DWORD_PTR *)lpBuffer; - break; - } + FIXME("Option INTERNET_OPTION_CONTEXT_VALUE; STUB\n"); + break; case INTERNET_OPTION_SECURITY_FLAGS: FIXME("Option INTERNET_OPTION_SECURITY_FLAGS; STUB\n"); break;
Modified: branches/ros-branch-0_3_12/reactos/dll/win32/wininet/internet.h URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/wi... ============================================================================== --- branches/ros-branch-0_3_12/reactos/dll/win32/wininet/internet.h [iso-8859-1] (original) +++ branches/ros-branch-0_3_12/reactos/dll/win32/wininet/internet.h [iso-8859-1] Mon Oct 11 19:57:17 2010 @@ -392,7 +392,7 @@ BOOL WININET_Release( object_header_t *info ); BOOL WININET_FreeHandle( HINTERNET hinternet );
-DWORD INET_QueryOption( object_header_t *, DWORD, void *, DWORD *, BOOL ); +DWORD INET_QueryOption(DWORD,void*,DWORD*,BOOL);
time_t ConvertTimeString(LPCWSTR asctime);
Modified: branches/ros-branch-0_3_12/reactos/dll/win32/wininet/netconnection.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/wi... ============================================================================== --- branches/ros-branch-0_3_12/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_12/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] Mon Oct 11 19:57:17 2010 @@ -330,9 +330,7 @@ CertFreeCertificateContext(endCert); CertCloseStore(store, 0); } - } else - pSSL_set_ex_data(ssl, error_idx, (void *)ERROR_INTERNET_SEC_CERT_ERRORS); - + } return ret; }
@@ -394,7 +392,6 @@ DYNSSL(SSL_write); DYNSSL(SSL_read); DYNSSL(SSL_pending); - DYNSSL(SSL_get_error); DYNSSL(SSL_get_ex_new_index); DYNSSL(SSL_get_ex_data); DYNSSL(SSL_set_ex_data); @@ -775,12 +772,6 @@ { #ifdef SONAME_LIBSSL *recvd = pSSL_read(connection->ssl_s, buf, len); - - /* Check if EOF was received */ - if(!*recvd && (pSSL_get_error(connection->ssl_s, *recvd)==SSL_ERROR_ZERO_RETURN - || pSSL_get_error(connection->ssl_s, *recvd)==SSL_ERROR_SYSCALL)) - return ERROR_SUCCESS; - return *recvd > 0 ? ERROR_SUCCESS : ERROR_INTERNET_CONNECTION_ABORTED; #else return ERROR_NOT_SUPPORTED;
Modified: branches/ros-branch-0_3_12/reactos/dll/win32/wininet/urlcache.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/wi... ============================================================================== --- branches/ros-branch-0_3_12/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_12/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] Mon Oct 11 19:57:17 2010 @@ -2556,6 +2556,7 @@ dwBytesNeeded = DWORD_ALIGN(dwBytesNeeded + strlen(lpszUrlNameA) + 1); if (lpszLocalFileName) { + len = WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, NULL, 0, NULL, NULL); dwOffsetLocalFileName = dwBytesNeeded; dwBytesNeeded = DWORD_ALIGN(dwBytesNeeded + strlen(pchLocalFileName) + 1); }
Modified: branches/ros-branch-0_3_12/reactos/dll/win32/wininet/utility.c URL: http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_12/reactos/dll/wi... ============================================================================== --- branches/ros-branch-0_3_12/reactos/dll/win32/wininet/utility.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_12/reactos/dll/win32/wininet/utility.c [iso-8859-1] Mon Oct 11 19:57:17 2010 @@ -325,7 +325,6 @@ case INTERNET_STATUS_RESOLVING_NAME: case INTERNET_STATUS_REDIRECT: lpvNewInfo = heap_strdupWtoA(lpvStatusInfo); - dwStatusInfoLength /= sizeof(WCHAR); break; } }