[RPCRT4] Call WSAStartup in rpcrt4_ip_tcp_get_top_of_tower

This fixes the crash in the rpc winetest.
This commit is contained in:
Eric Kohl 2022-12-19 13:39:52 +01:00
parent 2a783979ff
commit d01de6dc8b
2 changed files with 31 additions and 0 deletions

View file

@ -1257,6 +1257,18 @@ static size_t rpcrt4_ip_tcp_get_top_of_tower(unsigned char *tower_data,
hints.ai_canonname = NULL;
hints.ai_next = NULL;
#ifdef __REACTOS__
static BOOL wsa_inited;
if (!wsa_inited)
{
WSADATA wsadata;
WSAStartup(MAKEWORD(2, 2), &wsadata);
/* Note: WSAStartup can be called more than once so we don't bother with
* making accesses to wsa_inited thread-safe */
wsa_inited = TRUE;
}
#endif
ret = getaddrinfo(networkaddr, endpoint, &hints, &ai);
if (ret)
{

View file

@ -257,3 +257,22 @@ diff -pudN e:\wine\dlls\rpcrt4/rpc_transport.c e:\reactos\dll\win32\rpcrt4/rpc_t
break;
}
}
@@ -1257,6 +1257,18 @@ static size_t rpcrt4_ip_tcp_get_top_of_tower(unsigned char *tower_data,
hints.ai_canonname = NULL;
hints.ai_next = NULL;
+#ifdef __REACTOS__
+ static BOOL wsa_inited;
+ if (!wsa_inited)
+ {
+ WSADATA wsadata;
+ WSAStartup(MAKEWORD(2, 2), &wsadata);
+ /* Note: WSAStartup can be called more than once so we don't bother with
+ * making accesses to wsa_inited thread-safe */
+ wsa_inited = TRUE;
+ }
+#endif
+
ret = getaddrinfo(networkaddr, endpoint, &hints, &ai);
if (ret)
{