Author: tfaber
Date: Sat Jun 23 16:40:24 2012
New Revision: 56789
URL:
http://svn.reactos.org/svn/reactos?rev=56789&view=rev
Log:
[WININET][WINHTTP]
- Initialize Winsock before using getaddrinfo (and in general). Fixes test regressions
from r56773.
See issue #7135 for more details.
Modified:
trunk/reactos/dll/win32/winhttp/session.c
trunk/reactos/dll/win32/wininet/internet.c
trunk/reactos/dll/win32/wininet/wininet_ros.diff
Modified: trunk/reactos/dll/win32/winhttp/session.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/winhttp/session.…
==============================================================================
--- trunk/reactos/dll/win32/winhttp/session.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/winhttp/session.c [iso-8859-1] Sat Jun 23 16:40:24 2012
@@ -91,6 +91,9 @@
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 @@
{
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);
Modified: trunk/reactos/dll/win32/wininet/internet.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
==============================================================================
--- trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] Sat Jun 23 16:40:24 2012
@@ -747,6 +747,9 @@
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 @@
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 }
Modified: trunk/reactos/dll/win32/wininet/wininet_ros.diff
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
==============================================================================
--- trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] Sat Jun 23 16:40:24
2012
@@ -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)
{