[PATCH 3/4] server: Return Win32 socket types from get_socket_info.
Zebediah Figura
z.figura12 at gmail.com
Tue Sep 29 16:08:22 CDT 2020
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/ws2_32/socket.c | 6 +++---
server/sock.c | 14 +++++++-------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index a187d2de8e7..bc61b56667b 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -2306,9 +2306,9 @@ static BOOL ws_protocol_info(SOCKET s, int unicode, WSAPROTOCOL_INFOW *buffer, i
status = wine_server_call( req );
if (!status)
{
- address_family = convert_af_u2w(reply->family);
- socket_type = convert_socktype_u2w(reply->type);
- protocol = convert_proto_u2w(reply->protocol);
+ address_family = reply->family;
+ socket_type = reply->type;
+ protocol = reply->protocol;
}
}
SERVER_END_REQ;
diff --git a/server/sock.c b/server/sock.c
index 2c5c0676658..609576c52bc 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -456,7 +456,7 @@ static void sock_poll_event( struct fd *fd, int event )
else
{
/* normal data flow */
- if ( sock->type == SOCK_STREAM && ( event & POLLIN ) )
+ if (sock->type == WS_SOCK_STREAM && (event & POLLIN))
{
char dummy;
int nr;
@@ -546,8 +546,8 @@ static int sock_get_poll_events( struct fd *fd )
else if (smask & FD_READ || (sock->state & FD_WINE_LISTENING && mask & FD_ACCEPT))
ev |= POLLIN | POLLPRI;
/* We use POLLIN with 0 bytes recv() as FD_CLOSE indication for stream sockets. */
- else if ( sock->type == SOCK_STREAM && sock->state & FD_READ && mask & FD_CLOSE &&
- !(sock->hmask & FD_READ) )
+ else if (sock->type == WS_SOCK_STREAM && (sock->state & FD_READ) && (mask & FD_CLOSE) &&
+ !(sock->hmask & FD_READ))
ev |= POLLIN;
if (async_queued( &sock->write_q ))
@@ -823,9 +823,9 @@ static int init_socket( struct sock *sock, int family, int type, int protocol, u
sock->state = (type != SOCK_STREAM) ? (FD_READ|FD_WRITE) : 0;
sock->flags = flags;
- sock->proto = unix_protocol;
- sock->type = unix_type;
- sock->family = unix_family;
+ sock->proto = protocol;
+ sock->type = type;
+ sock->family = family;
if (sock->fd)
{
@@ -1550,7 +1550,7 @@ DECL_HANDLER(enable_socket_event)
sock->hmask &= ~req->mask;
sock->state |= req->sstate;
sock->state &= ~req->cstate;
- if ( sock->type != SOCK_STREAM ) sock->state &= ~STREAM_FLAG_MASK;
+ if (sock->type != WS_SOCK_STREAM) sock->state &= ~STREAM_FLAG_MASK;
sock_reselect( sock );
--
2.28.0
More information about the wine-devel
mailing list