From f3a7a8284e18779012dd8a7deff9c54ab5b098e1 Mon Sep 17 00:00:00 2001 From: Matt Harlum Date: Sat, 30 May 2026 00:43:21 +1200 Subject: [PATCH] Fix serial socket creation so that it works under WINE --- od-win32/parser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/od-win32/parser.cpp b/od-win32/parser.cpp index 24a3366c..e365347e 100644 --- a/od-win32/parser.cpp +++ b/od-win32/parser.cpp @@ -973,6 +973,11 @@ static int opentcp (const TCHAR *sername) bool waitmode = false; const int one = 1; const struct linger linger_1s = { 1, 1 }; + ADDRINFOW hints = {0}; + + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; if (WSAStartup (MAKEWORD (2, 2), &wsadata)) { DWORD lasterror = WSAGetLastError (); @@ -999,7 +1004,7 @@ static int opentcp (const TCHAR *sername) if (!port) port = my_strdup (_T("1234")); - err = GetAddrInfoW (name, port, NULL, &socketinfo); + err = GetAddrInfoW (name, port, &hints, &socketinfo); if (err < 0) { write_log (_T("SERIAL_TCP: GetAddrInfoW() failed, %s:%s: %d\n"), name, port, WSAGetLastError ()); goto end; -- 2.47.3