https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4bf76a659eed706164ef62e77d680c806e92e814

commit 4bf76a659eed706164ef62e77d680c806e92e814
Author:     Victor Perevertkin <[email protected]>
AuthorDate: Fri Dec 20 01:43:07 2019 +0300
Commit:     Victor Perevertkin <[email protected]>
CommitDate: Mon Dec 30 14:57:58 2019 +0200

    [WINHTTP] Initialize winsock upon WinHttpOpen
    As it was done before syncing with wine-staging 4.18 (5bd6580)
    ROSTESTS-348
---
 dll/win32/winhttp/net.c     | 6 ++++++
 dll/win32/winhttp/session.c | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/dll/win32/winhttp/net.c b/dll/win32/winhttp/net.c
index 277a22eacb0..fcec7adde92 100644
--- a/dll/win32/winhttp/net.c
+++ b/dll/win32/winhttp/net.c
@@ -167,7 +167,11 @@ static BOOL WINAPI winsock_startup( INIT_ONCE *once, void 
*param, void **ctx )
     return TRUE;
 }
 
+#ifdef __REACTOS__
+void winsock_init(void)
+#else
 static void winsock_init(void)
+#endif
 {
     static INIT_ONCE once = INIT_ONCE_STATIC_INIT;
     InitOnceExecuteOnce( &once, winsock_startup, NULL, NULL );
@@ -185,7 +189,9 @@ struct netconn *netconn_create( struct hostdata *host, 
const struct sockaddr_sto
     unsigned int addr_len;
     BOOL ret = FALSE;
 
+#ifndef __REACTOS__
     winsock_init();
+#endif
 
     conn = heap_alloc_zero(sizeof(*conn));
     if (!conn) return NULL;
diff --git a/dll/win32/winhttp/session.c b/dll/win32/winhttp/session.c
index 8e24de736dd..4392f022c63 100644
--- a/dll/win32/winhttp/session.c
+++ b/dll/win32/winhttp/session.c
@@ -240,6 +240,10 @@ static const struct object_vtbl session_vtbl =
     session_set_option
 };
 
+#ifdef __REACTOS__
+void winsock_init(void);
+#endif
+
 /***********************************************************************
  *          WinHttpOpen (winhttp.@)
  */
@@ -297,6 +301,10 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, 
LPCWSTR proxy, LPCWST
     if (!(handle = alloc_handle( &session->hdr ))) goto end;
     session->hdr.handle = handle;
 
+#ifdef __REACTOS__
+    winsock_init();
+#endif
+
 end:
     release_object( &session->hdr );
     TRACE("returning %p\n", handle);

Reply via email to