mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[WINHTTP] Initialize winsock upon WinHttpOpen
As it was done before syncing with wine-staging 4.18 (5bd6580
)
ROSTESTS-348
This commit is contained in:
parent
8b5dc3bf5f
commit
4bf76a659e
2 changed files with 14 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue