"Kai Blin" <kai.blin(a)gmail.com> wrote:
+ {FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO}, };
static const int ws_socktype_map[][2] = @@ -304,6 +305,7 @@ static const int ws_socktype_map[][2] = MAP_OPTION( SOCK_DGRAM ), MAP_OPTION( SOCK_STREAM ), MAP_OPTION( SOCK_RAW ), + {FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO}, };
static const int ws_proto_map[][2] = @@ -314,6 +316,7 @@ static const int ws_proto_map[][2] = MAP_OPTION( IPPROTO_ICMP ), MAP_OPTION( IPPROTO_IGMP ), MAP_OPTION( IPPROTO_RAW ), + {FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO}, };
Although it was the case before, it's a mistake to have a comma after the last struct member initializer.
+ if (lpProtocolInfo) { + if (af == FROM_PROTOCOL_INFO) + af = lpProtocolInfo->iAddressFamily; + if (type == FROM_PROTOCOL_INFO) + type = lpProtocolInfo->iSocketType; + if (protocol == FROM_PROTOCOL_INFO) + protocol = lpProtocolInfo->iProtocol;
Please keep opening brace style/indentation consistent with code you have removed.
--- a/include/winsock.h +++ b/include/winsock.h @@ -146,6 +146,7 @@ extern "C" { /* proper 4-byte packing */ #include <pshpack4.h>
+#define FROM_PROTOCOL_INFO (-1)
PSDK has it in winsock2.h -- Dmitry.