[2/2] ws2_32: Shortcut socket() to WSASocketW instead of WSASocketA

Bruno Jesus 00cpxxx at gmail.com
Mon Apr 6 18:56:29 CDT 2015


Instead of cascading socket -> WSASocketA -> WSASocketW skip
WSASocketA since the WSAPROTOCOL_INFO will always be NULL.

Reduces the log from:

trace:winsock:WS_socket af=2 type=1 protocol=6
trace:winsock:WSASocketA af=2 type=1 protocol=6 protocol_info=(nil)
group=0 flags=0x1
trace:winsock:WSASocketW af=2 type=1 protocol=6 protocol_info=(nil)
group=0 flags=0x1
trace:winsock:WSASocketW        created 0160

To:

trace:winsock:WS_socket af=2 type=1 protocol=6
trace:winsock:WSASocketW af=2 type=1 protocol=6 protocol_info=(nil)
group=0 flags=0x1
trace:winsock:WSASocketW        created 0160
-------------- next part --------------

---
 dlls/ws2_32/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 21946a1..7494b5f 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -5436,7 +5436,7 @@ SOCKET WINAPI WS_socket(int af, int type, int protocol)
 {
     TRACE("af=%d type=%d protocol=%d\n", af, type, protocol);
 
-    return WSASocketA( af, type, protocol, NULL, 0,
+    return WSASocketW( af, type, protocol, NULL, 0,
                        get_per_thread_data()->opentype ? 0 : WSA_FLAG_OVERLAPPED );
 }
 
-- 
2.1.4



More information about the wine-patches mailing list