1 diff -pudN e:\wine\dlls\winhttp/net.c e:\reactos\dll\win32\winhttp/net.c
2 --- e:\wine\dlls\winhttp/net.c 2015-02-21 17:13:15.365542100 +0100
3 +++ e:\reactos\dll\win32\winhttp/net.c 2015-07-20 14:25:14.321893000 +0100
4 @@ -73,6 +50,7 @@ static CRITICAL_SECTION cs_gethostbyname
7 /* translate a unix error code into a winsock error code */
9 static int sock_get_error( int err )
11 #if !defined(__MINGW32__) && !defined (_MSC_VER)
12 @@ -138,6 +116,15 @@ static int sock_get_error( int err )
17 +#define sock_get_error(x) WSAGetLastError()
19 +static inline int unix_ioctl(int filedes, long request, void *arg)
21 + return ioctlsocket(filedes, request, arg);
23 +#define ioctlsocket unix_ioctl
26 static int sock_send(int fd, const void *msg, size_t len, int flags)
28 @@ -366,11 +353,25 @@ BOOL netconn_connect( netconn_t *conn, c
29 res = sock_get_error( errno );
30 if (res == WSAEWOULDBLOCK || res == WSAEINPROGRESS)
33 + /* ReactOS: use select instead of poll */
38 + FD_SET(conn->socket, &outfd);
41 + tv.tv_usec = timeout * 1000;
43 + if (select( 0, NULL, &outfd, NULL, &tv ) > 0)
47 pfd.fd = conn->socket;
49 if (poll( &pfd, 1, timeout ) > 0)
53 res = sock_get_error( errno );
54 diff -pudN e:\wine\dlls\winhttp/request.c e:\reactos\dll\win32\winhttp/request.c
55 --- e:\wine\dlls\winhttp/request.c 2015-07-14 15:44:36.027191600 +0100
56 +++ e:\reactos\dll\win32\winhttp/request.c 2015-07-20 14:28:31.803188200 +0100
57 @@ -1263,6 +1252,7 @@ BOOL WINAPI WinHttpSendRequest( HINTERNE
62 #define ARRAYSIZE(array) (sizeof(array) / sizeof((array)[0]))
64 static const WCHAR basicW[] = {'B','a','s','i','c',0};
65 @@ -2754,8 +2744,8 @@ static void free_request( struct winhttp
66 CloseHandle( request->thread );
67 CloseHandle( request->wait );
68 CloseHandle( request->cancel );
69 - heap_free( request->proxy.lpszProxy );
70 - heap_free( request->proxy.lpszProxyBypass );
71 + heap_free( (WCHAR *)request->proxy.lpszProxy );
72 + heap_free( (WCHAR *)request->proxy.lpszProxyBypass );
73 heap_free( request->buffer );
74 heap_free( request->verb );
75 VariantClear( &request->data );
76 @@ -2959,16 +2949,16 @@ static HRESULT WINAPI winhttp_request_Se
78 case HTTPREQUEST_PROXYSETTING_DEFAULT:
79 request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_DEFAULT_PROXY;
80 - heap_free( request->proxy.lpszProxy );
81 - heap_free( request->proxy.lpszProxyBypass );
82 + heap_free( (WCHAR *)request->proxy.lpszProxy );
83 + heap_free( (WCHAR *)request->proxy.lpszProxyBypass );
84 request->proxy.lpszProxy = NULL;
85 request->proxy.lpszProxyBypass = NULL;
88 case HTTPREQUEST_PROXYSETTING_DIRECT:
89 request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NO_PROXY;
90 - heap_free( request->proxy.lpszProxy );
91 - heap_free( request->proxy.lpszProxyBypass );
92 + heap_free( (WCHAR *)request->proxy.lpszProxy );
93 + heap_free( (WCHAR *)request->proxy.lpszProxyBypass );
94 request->proxy.lpszProxy = NULL;
95 request->proxy.lpszProxyBypass = NULL;
97 @@ -2977,12 +2967,12 @@ static HRESULT WINAPI winhttp_request_Se
98 request->proxy.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY;
99 if (V_VT( &proxy_server ) == VT_BSTR)
101 - heap_free( request->proxy.lpszProxy );
102 + heap_free( (WCHAR *)request->proxy.lpszProxy );
103 request->proxy.lpszProxy = strdupW( V_BSTR( &proxy_server ) );
105 if (V_VT( &bypass_list ) == VT_BSTR)
107 - heap_free( request->proxy.lpszProxyBypass );
108 + heap_free( (WCHAR *)request->proxy.lpszProxyBypass );
109 request->proxy.lpszProxyBypass = strdupW( V_BSTR( &bypass_list ) );
112 diff -pudN e:\wine\dlls\winhttp/session.c e:\reactos\dll\win32\winhttp/session.c
113 --- e:\wine\dlls\winhttp/session.c 2015-07-14 15:44:36.029191700 +0100
114 +++ e:\reactos\dll\win32\winhttp/session.c 2015-07-20 14:29:15.686698200 +0100
115 @@ -109,6 +81,9 @@ static void session_destroy( object_head
116 heap_free( session->proxy_username );
117 heap_free( session->proxy_password );
118 heap_free( session );
124 static BOOL session_query_option( object_header_t *hdr, DWORD option, LPVOID buffer, LPDWORD buflen )
125 @@ -220,6 +195,11 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag
128 HINTERNET handle = NULL;
131 + int error = WSAStartup(MAKEWORD(2, 2), &wsaData);
132 + if (error) ERR("WSAStartup failed: %d\n", error);
135 TRACE("%s, %u, %s, %s, 0x%08x\n", debugstr_w(agent), access, debugstr_w(proxy), debugstr_w(bypass), flags);
137 @@ -246,14 +226,14 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR ag
138 session->access = info.dwAccessType;
139 if (info.lpszProxy && !(session->proxy_server = strdupW( info.lpszProxy )))
141 - GlobalFree( info.lpszProxy );
142 - GlobalFree( info.lpszProxyBypass );
143 + GlobalFree( (LPWSTR)info.lpszProxy );
144 + GlobalFree( (LPWSTR)info.lpszProxyBypass );
147 if (info.lpszProxyBypass && !(session->proxy_bypass = strdupW( info.lpszProxyBypass )))
149 - GlobalFree( info.lpszProxy );
150 - GlobalFree( info.lpszProxyBypass );
151 + GlobalFree( (LPWSTR)info.lpszProxy );
152 + GlobalFree( (LPWSTR)info.lpszProxyBypass );
156 @@ -624,7 +604,7 @@ static WCHAR *blob_to_str( DWORD encodin
158 static BOOL convert_sockaddr( const struct sockaddr *addr, SOCKADDR_STORAGE *addr_storage )
161 +#if !defined(__MINGW32__) && !defined(_MSC_VER)
162 switch (addr->sa_family)