8787#endif
8888
8989#ifdef WIN_NT
90+ #include < winsock2.h>
9091#include < process.h>
9192#endif
9293
94+ #if (defined(WIN_NT) && defined(HAVE_AFUNIX_H)) || defined(HAVE_SYS_UN_H)
95+ #define HAVE_AF_UNIX_SUPPORT
96+ #endif
97+
9398#if defined(WIN_NT)
9499#include " ../common/isc_proto.h"
95100#include " ../remote/os/win32/xnet_proto.h"
@@ -100,7 +105,7 @@ const char* const PROTOCOL_INET = "inet";
100105const char * const PROTOCOL_INET4 = " inet4" ;
101106const char * const PROTOCOL_INET6 = " inet6" ;
102107
103- #if !defined(WIN_NT) && defined(HAVE_SYS_UN_H)
108+ #ifdef HAVE_AF_UNIX_SUPPORT
104109const char * const PROTOCOL_UNIX = " unix" ;
105110#endif
106111
@@ -1178,7 +1183,7 @@ static void authReceiveResponse(bool havePacket, ClntAuthBlock& authItr, rem_por
11781183
11791184static AtomicCounter remote_event_id;
11801185
1181- #if !defined(WIN_NT) && defined(HAVE_SYS_UN_H)
1186+ #ifdef HAVE_AF_UNIX_SUPPORT
11821187static bool analyzeUnixProtocol (PathName& expandedName, PathName& nodeName)
11831188{
11841189 nodeName.erase ();
@@ -1194,7 +1199,17 @@ static bool analyzeUnixProtocol(PathName& expandedName, PathName& nodeName)
11941199 PathName savedName = expandedName;
11951200 expandedName.erase (0 , prefix.length ());
11961201
1197- const PathName::size_type separator = expandedName.find (' :' );
1202+ PathName::size_type separator = expandedName.find (' :' );
1203+
1204+ #ifdef WIN_NT
1205+ if (separator == 1 )
1206+ {
1207+ const char driveLetter = expandedName[0 ];
1208+ if ((driveLetter >= ' A' && driveLetter <= ' Z' ) || (driveLetter >= ' a' && driveLetter <= ' z' ))
1209+ separator = expandedName.find (' :' , separator + 1 );
1210+ }
1211+ #endif
1212+
11981213 if (separator == PathName::npos || separator == 0 || separator == expandedName.length () - 1 )
11991214 {
12001215 expandedName = savedName;
@@ -7962,7 +7977,7 @@ static rem_port* analyze(ClntAuthBlock& cBlock, PathName& attach_name, unsigned
79627977 else
79637978#endif
79647979
7965- #if !defined(WIN_NT) && defined(HAVE_SYS_UN_H)
7980+ #ifdef HAVE_AF_UNIX_SUPPORT
79667981 if (analyzeUnixProtocol (attach_name, node_name))
79677982 {
79687983 ISC_utf8ToSystem (node_name);
0 commit comments