---- wine-1.3.4/dlls/winhttp/net.c 2010-10-01 14:46:44.000000000 -0400
-+++ dll/win32/winhttp/net.c 2010-10-09 17:04:11.000000000 -0400
-@@ -158,6 +158,7 @@
+--- wine-1.5.4/dlls/winhttp/net.c 2012-06-20 14:30:41 +0200
++++ dll/win32/winhttp/net.c 2012-06-21 18:00:53 +0200
+@@ -160,6 +160,7 @@ static void ssl_lock_callback(int mode,
#endif
/* translate a unix error code into a winsock error code */
-+#if 0
++#ifndef __REACTOS__
static int sock_get_error( int err )
{
#if !defined(__MINGW32__) && !defined (_MSC_VER)
-@@ -223,6 +224,9 @@
+@@ -225,6 +226,15 @@ static int sock_get_error( int err )
#endif
return err;
}
+#else
+#define sock_get_error(x) WSAGetLastError()
++
++static inline int unix_ioctl(int filedes, long request, void *arg)
++{
++ return ioctlsocket(filedes, request, arg);
++}
++#define ioctlsocket unix_ioctl
+#endif
#ifdef SONAME_LIBSSL
static PCCERT_CONTEXT X509_to_cert_context(X509 *cert)
-@@ -632,11 +636,16 @@
+@@ -648,11 +658,17 @@ BOOL netconn_connect( netconn_t *conn, c
res = sock_get_error( errno );
if (res == WSAEWOULDBLOCK || res == WSAEINPROGRESS)
{
- struct pollfd pfd;
++ // ReactOS: use select instead of poll
+ fd_set outfd;
+ struct timeval tv;
-+
-+ FD_ZERO(&outfd);
-+ FD_SET(conn->socket, &outfd);
- pfd.fd = conn->socket;
- pfd.events = POLLOUT;
- if (poll( &pfd, 1, timeout ) > 0)
++ FD_ZERO(&outfd);
++ FD_SET(conn->socket, &outfd);
++
+ tv.tv_sec = 0;
+ tv.tv_usec = timeout * 1000;
+
ret = TRUE;
else
res = sock_get_error( errno );
-@@ -832,7 +841,7 @@
+@@ -848,7 +864,8 @@ BOOL netconn_query_data_available( netco
BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen )
{
- struct pollfd pfd;
++ // ReactOS: use select instead of poll
+ fd_set infd;
BOOL ret = FALSE;
DWORD recvd = 0;
-@@ -867,20 +876,22 @@
- return FALSE;
+@@ -884,19 +901,21 @@ BOOL netconn_get_next_line( netconn_t *c
#endif
}
--
+
- pfd.fd = conn->socket;
- pfd.events = POLLIN;
-+
+ FD_ZERO(&infd);
+ FD_SET(conn->socket, &infd);
-+
++
while (recvd < *buflen)
{
- int timeout, res;
- timeout = -1;
- if (poll( &pfd, 1, timeout ) > 0)
+ ptv = NULL;
-+
++
+ if (select( 0, &infd, NULL, NULL, ptv ) > 0)
{
if ((res = recv( conn->socket, &buffer[recvd], 1, 0 )) <= 0)
{
---- wine-1.3.4/dlls/winhttp/session.c 2010-10-01 14:46:44.000000000 -0400
-+++ dll/win32/winhttp/session.c 2010-10-09 17:04:11.000000000 -0400
-@@ -38,6 +38,9 @@
- #define DEFAULT_SEND_TIMEOUT 30000
- #define DEFAULT_RECEIVE_TIMEOUT 30000
-
-+/* FIXME */
-+#define CP_UNIXCP CP_ACP
-+
- void set_last_error( DWORD error )
- {
- /* FIXME */
---- wine-1.3.4/dlls/winhttp/request.c 2010-10-01 14:46:44.000000000 -0400
-+++ dll/win32/winhttp/request.c 2010-10-09 17:04:11.000000000 -0400
-@@ -34,6 +34,8 @@
+--- wine-1.5.4/dlls/winhttp/request.c 2012-06-20 14:30:41 +0200
++++ dll/win32/winhttp/request.c 2012-06-21 17:32:47 +0200
+@@ -38,6 +38,8 @@
#include "winhttp_private.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(winhttp);
- static const WCHAR attr_accept[] = {'A','c','c','e','p','t',0};
\ No newline at end of file
+ static const WCHAR attr_accept[] = {'A','c','c','e','p','t',0};
+--- wine-1.5.4/dlls/winhttp/rsrc.rc 2012-06-20 14:30:41 +0200
++++ dll/win32/winhttp/rsrc.rc 2012-07-14 15:25:28 +0200
+@@ -16,6 +16,12 @@
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
++/* @makedep: winhttp_tlb.tlb */
++1 TYPELIB winhttp_tlb.tlb
++
++/* @makedep: winhttp_tlb.rgs */
++1 WINE_REGISTRY winhttp_tlb.rgs
++
+ /* @makedep: pac.js */
+ pac.js 40 "pac.js"
+
+--- wine-1.5.4/dlls/winhttp/session.c 2012-07-13 15:34:57 +0200
++++ dll/win32/winhttp/session.c 2012-06-23 17:51:47 +0200
+@@ -95,6 +95,9 @@ static void session_destroy( object_head
+ 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 )
+@@ -203,6 +206,11 @@ 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);
++#endif
+
+ TRACE("%s, %u, %s, %s, 0x%08x\n", debugstr_w(agent), access, debugstr_w(proxy), debugstr_w(bypass), flags);
+