mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[WINHTTP] Sync with Wine Staging 1.9.23. CORE-12409
e27ff36 winhttp: Added WINHTTP_OPTION_CLIENT_CERT_CONTEXT option stub. 9bc3e96 winhttp: Added WINHTTP_OPTION_MAX_CONNS_PER_SERVER and WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER options stub. c8b166e winhttp: Also pass hostname to jsproxy. 668d429 winhttp: Indicate that WinHttpCrackUrl should return string pointers. 985443e winhttp: Don't perform buffer size tests for components that don't pass buffer in WinHttpCrackUrl. 17b4abf winhttp: Validate the port number in WinHttpCrackUrl. 1d07f89 winhttp: Set required buffer length for all components in WinHttpCrackUrl. 6c0fdc0 winhttp: Prevent console spamming in get_system_proxy_autoconfig_url. svn path=/trunk/; revision=73357
This commit is contained in:
parent
8c2649b3fe
commit
4a404e8b55
5 changed files with 189 additions and 87 deletions
|
@ -177,6 +177,12 @@ static BOOL session_set_option( object_header_t *hdr, DWORD option, LPVOID buffe
|
|||
TRACE("WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT: %p\n", *(HANDLE *)buffer);
|
||||
session->unload_event = *(HANDLE *)buffer;
|
||||
return TRUE;
|
||||
case WINHTTP_OPTION_MAX_CONNS_PER_SERVER:
|
||||
FIXME("WINHTTP_OPTION_MAX_CONNS_PER_SERVER: %d\n", *(DWORD *)buffer);
|
||||
return TRUE;
|
||||
case WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER:
|
||||
FIXME("WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER: %d\n", *(DWORD *)buffer);
|
||||
return TRUE;
|
||||
default:
|
||||
FIXME("unimplemented option %u\n", option);
|
||||
set_last_error( ERROR_INVALID_PARAMETER );
|
||||
|
@ -971,6 +977,14 @@ static BOOL request_set_option( object_header_t *hdr, DWORD option, LPVOID buffe
|
|||
if (!(session->proxy_password = buffer_to_str( buffer, buflen ))) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
case WINHTTP_OPTION_CLIENT_CERT_CONTEXT:
|
||||
if (!(hdr->flags & WINHTTP_FLAG_SECURE))
|
||||
{
|
||||
SetLastError( ERROR_WINHTTP_INCORRECT_HANDLE_STATE );
|
||||
return FALSE;
|
||||
}
|
||||
FIXME("WINHTTP_OPTION_CLIENT_CERT_CONTEXT\n");
|
||||
return TRUE;
|
||||
default:
|
||||
FIXME("unimplemented option %u\n", option);
|
||||
set_last_error( ERROR_INVALID_PARAMETER );
|
||||
|
@ -1196,7 +1210,7 @@ static BOOL set_option( object_header_t *hdr, DWORD option, LPVOID buffer, DWORD
|
|||
{
|
||||
BOOL ret = TRUE;
|
||||
|
||||
if (!buffer)
|
||||
if (!buffer && buflen)
|
||||
{
|
||||
set_last_error( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
|
@ -1329,8 +1343,14 @@ static BOOL get_system_proxy_autoconfig_url( char *buf, DWORD buflen )
|
|||
CFRelease( settings );
|
||||
return ret;
|
||||
#else
|
||||
static int once;
|
||||
if (!once++) FIXME( "no support on this platform\n" );
|
||||
static BOOL first = TRUE;
|
||||
if (first)
|
||||
{
|
||||
FIXME( "no support on this platform\n" );
|
||||
first = FALSE;
|
||||
}
|
||||
else
|
||||
TRACE( "no support on this platform\n" );
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
@ -1722,6 +1742,8 @@ static char *download_script( const WCHAR *url, DWORD *out_size )
|
|||
|
||||
memset( &uc, 0, sizeof(uc) );
|
||||
uc.dwStructSize = sizeof(uc);
|
||||
uc.dwHostNameLength = -1;
|
||||
uc.dwUrlPathLength = -1;
|
||||
if (!WinHttpCrackUrl( url, 0, 0, &uc )) return NULL;
|
||||
if (!(hostname = heap_alloc( (uc.dwHostNameLength + 1) * sizeof(WCHAR) ))) return NULL;
|
||||
memcpy( hostname, uc.lpszHostName, uc.dwHostNameLength * sizeof(WCHAR) );
|
||||
|
@ -1783,6 +1805,7 @@ static BOOL run_script( char *script, DWORD size, const WCHAR *url, WINHTTP_PROX
|
|||
char *result, *urlA;
|
||||
DWORD len_result;
|
||||
struct AUTO_PROXY_SCRIPT_BUFFER buffer;
|
||||
URL_COMPONENTSW uc;
|
||||
|
||||
buffer.dwStructSize = sizeof(buffer);
|
||||
buffer.lpszScriptBuffer = script;
|
||||
|
@ -1794,10 +1817,23 @@ static BOOL run_script( char *script, DWORD size, const WCHAR *url, WINHTTP_PROX
|
|||
heap_free( urlA );
|
||||
return FALSE;
|
||||
}
|
||||
if ((ret = InternetGetProxyInfo( urlA, strlen(urlA), NULL, 0, &result, &len_result )))
|
||||
|
||||
memset( &uc, 0, sizeof(uc) );
|
||||
uc.dwStructSize = sizeof(uc);
|
||||
uc.dwHostNameLength = -1;
|
||||
|
||||
if (WinHttpCrackUrl( url, 0, 0, &uc ))
|
||||
{
|
||||
ret = parse_script_result( result, info );
|
||||
heap_free( result );
|
||||
char *hostnameA = strdupWA_sized( uc.lpszHostName, uc.dwHostNameLength );
|
||||
|
||||
if ((ret = InternetGetProxyInfo( urlA, strlen(urlA),
|
||||
hostnameA, strlen(hostnameA), &result, &len_result )))
|
||||
{
|
||||
ret = parse_script_result( result, info );
|
||||
heap_free( result );
|
||||
}
|
||||
|
||||
heap_free( hostnameA );
|
||||
}
|
||||
heap_free( urlA );
|
||||
return InternetDeInitializeAutoProxyDll( NULL, 0 );
|
||||
|
|
|
@ -21,37 +21,29 @@
|
|||
static const WCHAR scheme_http[] = {'h','t','t','p',0};
|
||||
static const WCHAR scheme_https[] = {'h','t','t','p','s',0};
|
||||
|
||||
static BOOL set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len, DWORD flags )
|
||||
static DWORD set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len, DWORD flags, BOOL *overflow )
|
||||
{
|
||||
if (*str && !*str_len)
|
||||
{
|
||||
set_last_error( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
if (!*str_len) return TRUE;
|
||||
if (*str && !*str_len) return ERROR_INVALID_PARAMETER;
|
||||
if (!*str_len) return ERROR_SUCCESS;
|
||||
if (!*str)
|
||||
{
|
||||
if (len && *str_len && (flags & (ICU_DECODE|ICU_ESCAPE)))
|
||||
{
|
||||
set_last_error( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
if (len && *str_len && (flags & (ICU_DECODE|ICU_ESCAPE))) return ERROR_INVALID_PARAMETER;
|
||||
*str = value;
|
||||
*str_len = len;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (len > (*str_len) - 1)
|
||||
if (len >= *str_len)
|
||||
{
|
||||
*str_len = len + 1;
|
||||
set_last_error( ERROR_INSUFFICIENT_BUFFER );
|
||||
return FALSE;
|
||||
*str_len = len+1;
|
||||
*overflow = TRUE;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
memcpy( *str, value, len * sizeof(WCHAR) );
|
||||
(*str)[len] = 0;
|
||||
*str_len = len;
|
||||
}
|
||||
return TRUE;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static WCHAR *decode_url( LPCWSTR url, DWORD *len )
|
||||
|
@ -159,16 +151,30 @@ static WCHAR *escape_url( LPCWSTR url, DWORD *len )
|
|||
return ret;
|
||||
}
|
||||
|
||||
static DWORD parse_port( const WCHAR *str, DWORD len, INTERNET_PORT *ret )
|
||||
{
|
||||
const WCHAR *p = str;
|
||||
DWORD port = 0;
|
||||
while (len && isdigitW( *p ))
|
||||
{
|
||||
if ((port = port * 10 + *p - '0') > 65535) return ERROR_WINHTTP_INVALID_URL;
|
||||
p++; len--;
|
||||
}
|
||||
*ret = port;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* WinHttpCrackUrl (winhttp.@)
|
||||
*/
|
||||
BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONENTSW uc )
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
WCHAR *p, *q, *r, *url_decoded = NULL, *url_escaped = NULL;
|
||||
INTERNET_SCHEME scheme = 0;
|
||||
BOOL overflow = FALSE;
|
||||
DWORD err;
|
||||
|
||||
TRACE("%s, %d, %x, %p\n", debugstr_w(url), len, flags, uc);
|
||||
TRACE("%s, %d, %x, %p\n", debugstr_wn(url, len), len, flags, uc);
|
||||
|
||||
if (!url || !uc || uc->dwStructSize != sizeof(URL_COMPONENTS))
|
||||
{
|
||||
|
@ -204,95 +210,102 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN
|
|||
else if (p - url == 5 && !strncmpiW( url, scheme_https, 5 )) scheme = INTERNET_SCHEME_HTTPS;
|
||||
else
|
||||
{
|
||||
set_last_error( ERROR_WINHTTP_UNRECOGNIZED_SCHEME );
|
||||
err = ERROR_WINHTTP_UNRECOGNIZED_SCHEME;
|
||||
goto exit;
|
||||
}
|
||||
if (!(set_component( &uc->lpszScheme, &uc->dwSchemeLength, (WCHAR *)url, p - url, flags ))) goto exit;
|
||||
|
||||
if ((err = set_component( &uc->lpszScheme, &uc->dwSchemeLength, (WCHAR *)url, p - url, flags, &overflow ))) goto exit;
|
||||
|
||||
p++; /* skip ':' */
|
||||
if (!p[0] || p[0] != '/' || p[1] != '/') goto exit;
|
||||
if (!p[0] || p[0] != '/' || p[1] != '/')
|
||||
{
|
||||
err = ERROR_WINHTTP_INVALID_URL;
|
||||
goto exit;
|
||||
}
|
||||
p += 2;
|
||||
|
||||
if (!p[0]) goto exit;
|
||||
if (!p[0])
|
||||
{
|
||||
err = ERROR_WINHTTP_INVALID_URL;
|
||||
goto exit;
|
||||
}
|
||||
if ((q = memchrW( p, '@', len - (p - url) )) && !(memchrW( p, '/', q - p )))
|
||||
{
|
||||
if ((r = memchrW( p, ':', q - p )))
|
||||
{
|
||||
if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, r - p, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, r - p, flags, &overflow ))) goto exit;
|
||||
r++;
|
||||
if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, r, q - r, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszPassword, &uc->dwPasswordLength, r, q - r, flags, &overflow ))) goto exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, q - p, flags ))) goto exit;
|
||||
if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, q - p, flags, &overflow ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags, &overflow ))) goto exit;
|
||||
}
|
||||
p = q + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, NULL, 0, flags ))) goto exit;
|
||||
if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszUserName, &uc->dwUserNameLength, NULL, 0, flags, &overflow ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags, &overflow ))) goto exit;
|
||||
}
|
||||
if ((q = memchrW( p, '/', len - (p - url) )))
|
||||
{
|
||||
if ((r = memchrW( p, ':', q - p )))
|
||||
{
|
||||
if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, r - p, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, r - p, flags, &overflow ))) goto exit;
|
||||
r++;
|
||||
uc->nPort = atoiW( r );
|
||||
if ((err = parse_port( r, q - r, &uc->nPort ))) goto exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, q - p, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, q - p, flags, &overflow ))) goto exit;
|
||||
if (scheme == INTERNET_SCHEME_HTTP) uc->nPort = INTERNET_DEFAULT_HTTP_PORT;
|
||||
if (scheme == INTERNET_SCHEME_HTTPS) uc->nPort = INTERNET_DEFAULT_HTTPS_PORT;
|
||||
}
|
||||
|
||||
if ((r = memchrW( q, '?', len - (q - url) )))
|
||||
{
|
||||
if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, r - q, flags ))) goto exit;
|
||||
if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, r, len - (r - url), flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, r - q, flags, &overflow ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, r, len - (r - url), flags, &overflow ))) goto exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, len - (q - url), flags ))) goto exit;
|
||||
if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, len - (q - url), flags, &overflow ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags, &overflow ))) goto exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((r = memchrW( p, ':', len - (p - url) )))
|
||||
{
|
||||
if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, r - p, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, r - p, flags, &overflow ))) goto exit;
|
||||
r++;
|
||||
uc->nPort = atoiW( r );
|
||||
if ((err = parse_port( r, len - (r - url), &uc->nPort ))) goto exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, len - (p - url), flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, len - (p - url), flags, &overflow ))) goto exit;
|
||||
if (scheme == INTERNET_SCHEME_HTTP) uc->nPort = INTERNET_DEFAULT_HTTP_PORT;
|
||||
if (scheme == INTERNET_SCHEME_HTTPS) uc->nPort = INTERNET_DEFAULT_HTTPS_PORT;
|
||||
}
|
||||
if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, (WCHAR *)url + len, 0, flags ))) goto exit;
|
||||
if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, (WCHAR *)url + len, 0, flags, &overflow ))) goto exit;
|
||||
if ((err = set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags, &overflow ))) goto exit;
|
||||
}
|
||||
|
||||
ret = TRUE;
|
||||
|
||||
TRACE("scheme(%s) host(%s) port(%d) path(%s) extra(%s)\n",
|
||||
debugstr_wn( uc->lpszScheme, uc->dwSchemeLength ),
|
||||
debugstr_wn( uc->lpszHostName, uc->dwHostNameLength ),
|
||||
uc->nPort,
|
||||
debugstr_wn( uc->lpszUrlPath, uc->dwUrlPathLength ),
|
||||
TRACE("scheme(%s) host(%s) port(%d) path(%s) extra(%s)\n", debugstr_wn( uc->lpszScheme, uc->dwSchemeLength ),
|
||||
debugstr_wn( uc->lpszHostName, uc->dwHostNameLength ), uc->nPort, debugstr_wn( uc->lpszUrlPath, uc->dwUrlPathLength ),
|
||||
debugstr_wn( uc->lpszExtraInfo, uc->dwExtraInfoLength ));
|
||||
|
||||
exit:
|
||||
if (ret) uc->nScheme = scheme;
|
||||
if (!err)
|
||||
{
|
||||
if (overflow) err = ERROR_INSUFFICIENT_BUFFER;
|
||||
uc->nScheme = scheme;
|
||||
}
|
||||
heap_free( url_decoded );
|
||||
heap_free( url_escaped );
|
||||
if (ret) set_last_error( ERROR_SUCCESS );
|
||||
return ret;
|
||||
set_last_error( err );
|
||||
return !err;
|
||||
}
|
||||
|
||||
static INTERNET_SCHEME get_scheme( const WCHAR *scheme, DWORD len )
|
||||
|
|
|
@ -380,4 +380,19 @@ static inline char *strdupWA( const WCHAR *src )
|
|||
return dst;
|
||||
}
|
||||
|
||||
static inline char *strdupWA_sized( const WCHAR *src, DWORD size )
|
||||
{
|
||||
char *dst = NULL;
|
||||
if (src)
|
||||
{
|
||||
int len = WideCharToMultiByte( CP_ACP, 0, src, size, NULL, 0, NULL, NULL ) + 1;
|
||||
if ((dst = heap_alloc( len )))
|
||||
{
|
||||
WideCharToMultiByte( CP_ACP, 0, src, len, dst, size, NULL, NULL );
|
||||
dst[len - 1] = 0;
|
||||
}
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
|
||||
#endif /* _WINE_WINHTTP_PRIVATE_H_ */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
diff -pudN e:\wine\dlls\winhttp/net.c e:\reactos\dll\win32\winhttp/net.c
|
||||
--- e:\wine\dlls\winhttp/net.c 2015-02-21 17:13:15.365542100 +0100
|
||||
+++ e:\reactos\dll\win32\winhttp/net.c 2015-07-20 14:25:14.321893000 +0100
|
||||
@@ -73,6 +50,7 @@ static CRITICAL_SECTION cs_gethostbyname
|
||||
--- e:\wine\dlls\winhttp/net.c 2016-11-16 17:36:37 +0100
|
||||
+++ e:\reactos\dll\win32\winhttp/net.c 2016-10-13 11:15:39 +0100
|
||||
@@ -50,6 +50,7 @@ static CRITICAL_SECTION cs_gethostbyname
|
||||
#endif
|
||||
|
||||
/* translate a unix error code into a winsock error code */
|
||||
|
@ -9,7 +9,7 @@ diff -pudN e:\wine\dlls\winhttp/net.c e:\reactos\dll\win32\winhttp/net.c
|
|||
static int sock_get_error( int err )
|
||||
{
|
||||
#if !defined(__MINGW32__) && !defined (_MSC_VER)
|
||||
@@ -138,6 +116,15 @@ static int sock_get_error( int err )
|
||||
@@ -115,6 +116,15 @@ static int sock_get_error( int err )
|
||||
#endif
|
||||
return err;
|
||||
}
|
||||
|
@ -25,7 +25,47 @@ diff -pudN e:\wine\dlls\winhttp/net.c e:\reactos\dll\win32\winhttp/net.c
|
|||
|
||||
static int sock_send(int fd, const void *msg, size_t len, int flags)
|
||||
{
|
||||
@@ -366,11 +353,25 @@ BOOL netconn_connect( netconn_t *conn, c
|
||||
@@ -266,6 +276,28 @@ static BOOL ensure_cred_handle(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+#ifdef __REACTOS__
|
||||
+static BOOL winsock_initialized = FALSE;
|
||||
+BOOL netconn_init_winsock()
|
||||
+{
|
||||
+ WSADATA wsaData;
|
||||
+ int error;
|
||||
+ if (!winsock_initialized)
|
||||
+ {
|
||||
+ error = WSAStartup(MAKEWORD(1, 1), &wsaData);
|
||||
+ if (error)
|
||||
+ {
|
||||
+ ERR("WSAStartup failed: %d\n", error);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ else
|
||||
+ winsock_initialized = TRUE;
|
||||
+ }
|
||||
+ return winsock_initialized;
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
BOOL netconn_init( netconn_t *conn )
|
||||
{
|
||||
memset(conn, 0, sizeof(*conn));
|
||||
@@ -281,6 +313,10 @@ void netconn_unload( void )
|
||||
#ifndef HAVE_GETADDRINFO
|
||||
DeleteCriticalSection(&cs_gethostbyname);
|
||||
#endif
|
||||
+#ifdef __REACTOS__
|
||||
+ if(winsock_initialized)
|
||||
+ WSACleanup();
|
||||
+#endif
|
||||
}
|
||||
|
||||
BOOL netconn_connected( netconn_t *conn )
|
||||
@@ -343,11 +379,25 @@ BOOL netconn_connect( netconn_t *conn, c
|
||||
res = sock_get_error( errno );
|
||||
if (res == WSAEWOULDBLOCK || res == WSAEINPROGRESS)
|
||||
{
|
||||
|
@ -52,9 +92,9 @@ diff -pudN e:\wine\dlls\winhttp/net.c e:\reactos\dll\win32\winhttp/net.c
|
|||
else
|
||||
res = sock_get_error( errno );
|
||||
diff -pudN e:\wine\dlls\winhttp/request.c e:\reactos\dll\win32\winhttp/request.c
|
||||
--- e:\wine\dlls\winhttp/request.c 2015-07-14 15:44:36.027191600 +0100
|
||||
+++ e:\reactos\dll\win32\winhttp/request.c 2015-07-20 14:28:31.803188200 +0100
|
||||
@@ -1263,6 +1252,7 @@ BOOL WINAPI WinHttpSendRequest( HINTERNE
|
||||
--- e:\wine\dlls\winhttp/request.c 2016-11-16 17:36:37 +0100
|
||||
+++ e:\reactos\dll\win32\winhttp/request.c 2016-02-27 16:08:59 +0100
|
||||
@@ -1258,6 +1258,7 @@ BOOL WINAPI WinHttpSendRequest( HINTERNE
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -62,7 +102,7 @@ diff -pudN e:\wine\dlls\winhttp/request.c e:\reactos\dll\win32\winhttp/request.c
|
|||
#define ARRAYSIZE(array) (sizeof(array) / sizeof((array)[0]))
|
||||
|
||||
static const WCHAR basicW[] = {'B','a','s','i','c',0};
|
||||
@@ -2754,8 +2744,8 @@ static void free_request( struct winhttp
|
||||
@@ -2758,8 +2759,8 @@ static void free_request( struct winhttp
|
||||
CloseHandle( request->thread );
|
||||
CloseHandle( request->wait );
|
||||
CloseHandle( request->cancel );
|
||||
|
@ -73,7 +113,7 @@ diff -pudN e:\wine\dlls\winhttp/request.c e:\reactos\dll\win32\winhttp/request.c
|
|||
heap_free( request->buffer );
|
||||
heap_free( request->verb );
|
||||
VariantClear( &request->data );
|
||||
@@ -2959,16 +2949,16 @@ static HRESULT WINAPI winhttp_request_Se
|
||||
@@ -3005,16 +3006,16 @@ static HRESULT WINAPI winhttp_request_Se
|
||||
{
|
||||
case HTTPREQUEST_PROXYSETTING_DEFAULT:
|
||||
request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY;
|
||||
|
@ -94,7 +134,7 @@ diff -pudN e:\wine\dlls\winhttp/request.c e:\reactos\dll\win32\winhttp/request.c
|
|||
request->proxy.lpszProxy = NULL;
|
||||
request->proxy.lpszProxyBypass = NULL;
|
||||
break;
|
||||
@@ -2977,12 +2967,12 @@ static HRESULT WINAPI winhttp_request_Se
|
||||
@@ -3023,12 +3024,12 @@ static HRESULT WINAPI winhttp_request_Se
|
||||
request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY;
|
||||
if (V_VT( &proxy_server ) == VT_BSTR)
|
||||
{
|
||||
|
@ -110,31 +150,29 @@ diff -pudN e:\wine\dlls\winhttp/request.c e:\reactos\dll\win32\winhttp/request.c
|
|||
}
|
||||
break;
|
||||
diff -pudN e:\wine\dlls\winhttp/session.c e:\reactos\dll\win32\winhttp/session.c
|
||||
--- e:\wine\dlls\winhttp/session.c 2015-07-14 15:44:36.029191700 +0100
|
||||
+++ e:\reactos\dll\win32\winhttp/session.c 2015-07-20 14:29:15.686698200 +0100
|
||||
@@ -109,6 +81,9 @@ static void session_destroy( object_head
|
||||
heap_free( session->proxy_username );
|
||||
heap_free( session->proxy_password );
|
||||
heap_free( session );
|
||||
+#ifdef __REACTOS__
|
||||
+ WSACleanup();
|
||||
+#endif
|
||||
}
|
||||
--- e:\wine\dlls\winhttp/session.c 2016-11-16 17:36:37 +0100
|
||||
+++ e:\reactos\dll\win32\winhttp/session.c 2016-11-17 00:14:49 +0100
|
||||
@@ -197,6 +197,9 @@ static const object_vtbl_t session_vtbl
|
||||
session_set_option
|
||||
};
|
||||
|
||||
static BOOL session_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen )
|
||||
@@ -220,6 +195,11 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag
|
||||
+#ifdef __REACTOS__
|
||||
+BOOL netconn_init_winsock();
|
||||
+#endif /* __REACTOS__ */
|
||||
/***********************************************************************
|
||||
* WinHttpOpen (winhttp.@)
|
||||
*/
|
||||
@@ -204,6 +207,9 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag
|
||||
{
|
||||
session_t *session;
|
||||
HINTERNET handle = NULL;
|
||||
+#ifdef __REACTOS__
|
||||
+ WSADATA wsaData;
|
||||
+ int error = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
+ if (error) ERR("WSAStartup failed: %d\n", error);
|
||||
+ if (!netconn_init_winsock()) return NULL;
|
||||
+#endif
|
||||
|
||||
TRACE("%s, %u, %s, %s, 0x%08x\n", debugstr_w(agent), access, debugstr_w(proxy), debugstr_w(bypass), flags);
|
||||
|
||||
@@ -246,14 +226,14 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag
|
||||
@@ -230,14 +236,14 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag
|
||||
session->access = info.dwAccessType;
|
||||
if (info.lpszProxy && !(session->proxy_server = strdupW( info.lpszProxy )))
|
||||
{
|
||||
|
@ -153,7 +191,7 @@ diff -pudN e:\wine\dlls\winhttp/session.c e:\reactos\dll\win32\winhttp/session.c
|
|||
goto end;
|
||||
}
|
||||
}
|
||||
@@ -624,7 +604,7 @@ static WCHAR *blob_to_str( DWORD encodin
|
||||
@@ -610,7 +616,7 @@ static WCHAR *blob_to_str( DWORD encodin
|
||||
|
||||
static BOOL convert_sockaddr( const struct sockaddr *addr, SOCKADDR_STORAGE *addr_storage )
|
||||
{
|
||||
|
|
|
@ -200,7 +200,7 @@ reactos/dll/win32/windowscodecs # Synced to WineStaging-1.9.23
|
|||
reactos/dll/win32/windowscodecsext # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/winemp3.acm # Synced to WineStaging-1.9.23
|
||||
reactos/dll/win32/wing32 # Synced to WineStaging-1.9.11
|
||||
reactos/dll/win32/winhttp # Synced to WineStaging-1.9.16
|
||||
reactos/dll/win32/winhttp # Synced to WineStaging-1.9.23
|
||||
reactos/dll/win32/wininet # Synced to WineStaging-1.9.16
|
||||
reactos/dll/win32/winmm # Forked at Wine-20050628
|
||||
reactos/dll/win32/winmm/midimap # Forked at Wine-20050628
|
||||
|
|
Loading…
Reference in a new issue