mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[RPCRT4] Call WSAStartup in rpcrt4_ip_tcp_get_top_of_tower
This fixes the crash in the rpc winetest.
This commit is contained in:
parent
2a783979ff
commit
d01de6dc8b
|
@ -1257,6 +1257,18 @@ static size_t rpcrt4_ip_tcp_get_top_of_tower(unsigned char *tower_data,
|
||||||
hints.ai_canonname = NULL;
|
hints.ai_canonname = NULL;
|
||||||
hints.ai_next = 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);
|
ret = getaddrinfo(networkaddr, endpoint, &hints, &ai);
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
|
|
|
@ -257,3 +257,22 @@ diff -pudN e:\wine\dlls\rpcrt4/rpc_transport.c e:\reactos\dll\win32\rpcrt4/rpc_t
|
||||||
break;
|
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)
|
||||||
|
{
|
||||||
|
|
Loading…
Reference in a new issue