[WININET][WINHTTP]

- Initialize Winsock before using getaddrinfo (and in general). Fixes test regressions from r56773.
See issue #7135 for more details.

svn path=/trunk/; revision=56789
This commit is contained in:
Thomas Faber
2012-06-23 16:40:24 +00:00
parent f6b6eea643
commit ab09607ada
3 changed files with 41 additions and 3 deletions
+8
View File
@@ -91,6 +91,9 @@ static void session_destroy( object_header_t *hdr )
heap_free( session->proxy_username );
heap_free( session->proxy_password );
heap_free( session );
#ifdef __REACTOS__
WSACleanup();
#endif
}
static BOOL session_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen )
@@ -199,6 +202,11 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST
{
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);
#endif
TRACE("%s, %u, %s, %s, 0x%08x\n", debugstr_w(agent), access, debugstr_w(proxy), debugstr_w(bypass), flags);
+8
View File
@@ -747,6 +747,9 @@ static VOID APPINFO_Destroy(object_header_t *hdr)
heap_free(lpwai->proxyBypass);
heap_free(lpwai->proxyUsername);
heap_free(lpwai->proxyPassword);
#ifdef __REACTOS__
WSACleanup();
#endif
}
static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
@@ -908,6 +911,11 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType,
LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
{
appinfo_t *lpwai = NULL;
#ifdef __REACTOS__
WSADATA wsaData;
int error = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (error) ERR("WSAStartup failed: %d\n", error);
#endif
if (TRACE_ON(wininet)) {
#define FE(x) { x, #x }
+25 -3
View File
@@ -1,5 +1,5 @@
--- wine-1.5.4/dlls/wininet/internet.h 2012-06-20 14:38:39 +0200
+++ dll/win32/wininet/internet.h 2012-06-20 16:49:05 +0200
+++ dll/win32/wininet/internet.h 2012-06-23 17:25:14 +0200
@@ -536,7 +536,30 @@ BOOL NETCON_is_alive(netconn_t*) DECLSPE
LPCVOID NETCON_GetCert(netconn_t *connection) DECLSPEC_HIDDEN;
int NETCON_GetCipherStrength(netconn_t*) DECLSPEC_HIDDEN;
@@ -71,7 +71,7 @@
/******************************************************************************
* NETCON_secure_connect
--- wine-1.5.4/dlls/wininet/internet.c 2012-06-20 14:38:38 +0200
+++ dll/win32/wininet/internet.c 2012-06-20 15:50:05 +0200
+++ dll/win32/wininet/internet.c 2012-06-23 17:45:14 +0200
@@ -292,7 +292,9 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL,
if (g_dwTlsErrIndex == TLS_OUT_OF_INDEXES)
return FALSE;
@@ -82,7 +82,29 @@
WININET_hModule = hinstDLL;
break;
@@ -3716,19 +3718,23 @@ LPSTR INTERNET_GetResponseBuffer(void)
@@ -745,6 +747,9 @@ static VOID APPINFO_Destroy(object_heade
heap_free(lpwai->proxyBypass);
heap_free(lpwai->proxyUsername);
heap_free(lpwai->proxyPassword);
+#ifdef __REACTOS__
+ WSACleanup();
+#endif
}
static DWORD APPINFO_QueryOption(object_header_t *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode)
@@ -906,6 +911,11 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR l
LPCWSTR lpszProxy, LPCWSTR lpszProxyBypass, DWORD dwFlags)
{
appinfo_t *lpwai = NULL;
+#ifdef __REACTOS__
+ WSADATA wsaData;
+ int error = WSAStartup(MAKEWORD(2, 2), &wsaData);
+ if (error) ERR("WSAStartup failed: %d\n", error);
+#endif
if (TRACE_ON(wininet)) {
#define FE(x) { x, #x }
@@ -3716,19 +3726,23 @@ LPSTR INTERNET_GetResponseBuffer(void)
LPSTR INTERNET_GetNextLine(INT nSocket, LPDWORD dwLen)
{